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: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef mozilla_dom_mobilemessage_MobileMessageManager_h
7 #define mozilla_dom_mobilemessage_MobileMessageManager_h
9 #include "mozilla/DOMEventTargetHelper.h"
10 #include "nsIDOMMobileMessageManager.h"
11 #include "nsIObserver.h"
13 class nsIDOMMozSmsMessage;
14 class nsIDOMMozMmsMessage;
16 namespace mozilla {
17 namespace dom {
19 class MobileMessageManager : public DOMEventTargetHelper
20 , public nsIDOMMozMobileMessageManager
21 , public nsIObserver
22 {
23 public:
24 NS_DECL_ISUPPORTS_INHERITED
25 NS_DECL_NSIOBSERVER
26 NS_DECL_NSIDOMMOZMOBILEMESSAGEMANAGER
28 NS_REALLY_FORWARD_NSIDOMEVENTTARGET(DOMEventTargetHelper)
30 void Init(nsPIDOMWindow *aWindow);
31 void Shutdown();
33 private:
34 /**
35 * Internal Send() method used to send one message.
36 */
37 nsresult Send(JSContext* aCx, JS::Handle<JSObject*> aGlobal,
38 uint32_t aServiceId,
39 JS::Handle<JSString*> aNumber,
40 const nsAString& aMessage,
41 JS::Value* aRequest);
43 nsresult DispatchTrustedSmsEventToSelf(const char* aTopic,
44 const nsAString& aEventName,
45 nsISupports* aMsg);
47 /**
48 * Helper to get message ID from SMS/MMS Message object
49 */
50 nsresult GetMessageId(JSContext* aCx, const JS::Value& aMessage,
51 int32_t* aId);
52 };
54 } // namespace dom
55 } // namespace mozilla
57 #endif // mozilla_dom_mobilemessage_MobileMessageManager_h