Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef nsPrintPreviewListener_h__
8 #define nsPrintPreviewListener_h__
10 // Interfaces needed to be included
11 #include "nsIDOMEventListener.h"
12 // Helper Classes
13 #include "nsCOMPtr.h"
14 #include "mozilla/Attributes.h"
16 namespace mozilla {
17 namespace dom {
18 class EventTarget;
19 }
20 }
22 //
23 // class nsPrintPreviewListener
24 //
25 // The class that listens to the chrome events and tells the embedding
26 // chrome to show context menus, as appropriate. Handles registering itself
27 // with the DOM with AddChromeListeners() and removing itself with
28 // RemoveChromeListeners().
29 //
30 class nsPrintPreviewListener MOZ_FINAL : public nsIDOMEventListener
32 {
33 public:
34 NS_DECL_ISUPPORTS
35 NS_DECL_NSIDOMEVENTLISTENER
37 nsPrintPreviewListener(mozilla::dom::EventTarget* aTarget);
38 ~nsPrintPreviewListener();
40 // Add/remove the relevant listeners, based on what interfaces
41 // the embedding chrome implements.
42 nsresult AddListeners();
43 nsresult RemoveListeners();
45 private:
47 nsCOMPtr<mozilla::dom::EventTarget> mEventTarget;
49 }; // class nsPrintPreviewListener
53 #endif /* nsPrintPreviewListener_h__ */