dom/mobileconnection/src/MobileConnection.h

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
     3  * You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 #ifndef mozilla_dom_network_MobileConnection_h
     6 #define mozilla_dom_network_MobileConnection_h
     8 #include "mozilla/DOMEventTargetHelper.h"
     9 #include "nsIDOMMobileConnection.h"
    10 #include "nsIMobileConnectionProvider.h"
    11 #include "nsCycleCollectionParticipant.h"
    12 #include "nsWeakPtr.h"
    14 namespace mozilla {
    15 namespace dom {
    17 class MobileConnection : public DOMEventTargetHelper
    18                        , public nsIDOMMozMobileConnection
    19 {
    20   /**
    21    * Class MobileConnection doesn't actually inherit
    22    * nsIMobileConnectionListener. Instead, it owns an
    23    * nsIMobileConnectionListener derived instance mListener and passes it to
    24    * nsIMobileConnectionProvider. The onreceived events are first delivered to
    25    * mListener and then forwarded to its owner, MobileConnection. See also bug
    26    * 775997 comment #51.
    27    */
    28   class Listener;
    30 public:
    31   NS_DECL_ISUPPORTS_INHERITED
    32   NS_DECL_NSIDOMMOZMOBILECONNECTION
    33   NS_DECL_NSIMOBILECONNECTIONLISTENER
    35   NS_REALLY_FORWARD_NSIDOMEVENTTARGET(DOMEventTargetHelper)
    37   MobileConnection(uint32_t aClientId);
    39   void Init(nsPIDOMWindow *aWindow);
    40   void Shutdown();
    42   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(MobileConnection,
    43                                            DOMEventTargetHelper)
    45 private:
    46   nsCOMPtr<nsIMobileConnectionProvider> mProvider;
    47   nsRefPtr<Listener> mListener;
    48   nsWeakPtr mWindow;
    50   uint32_t mClientId;
    52   bool CheckPermission(const char* aType);
    53 };
    55 } // namespace dom
    56 } // namespace mozilla
    58 #endif // mozilla_dom_network_MobileConnection_h

mercurial