dom/icc/src/IccListener.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_IccListener_h
     6 #define mozilla_dom_IccListener_h
     8 #include "nsAutoPtr.h"
     9 #include "nsIIccProvider.h"
    11 namespace mozilla {
    12 namespace dom {
    14 class IccManager;
    15 class Icc;
    17 class IccListener : public nsIIccListener
    18 {
    19 public:
    20   NS_DECL_ISUPPORTS
    21   NS_DECL_NSIICCLISTENER
    23   IccListener(IccManager* aIccManager, uint32_t aClientId);
    24   ~IccListener();
    26   void
    27   Shutdown();
    29   already_AddRefed<Icc>
    30   GetIcc()
    31   {
    32     nsRefPtr<Icc> icc = mIcc;
    33     return icc.forget();
    34   }
    36 private:
    37   uint32_t mClientId;
    38   // We did not setup 'mIcc' and 'mIccManager' being a participant of cycle
    39   // collection is because in Navigator->Invalidate() it will call
    40   // mIccManager->Shutdown(), then IccManager will call Shutdown() of each
    41   // IccListener, this will release the reference and break the cycle.
    42   nsRefPtr<Icc> mIcc;
    43   nsRefPtr<IccManager> mIccManager;
    44   // mProvider is a xpcom service and will be released at shutdown, so it
    45   // doesn't need to be cycle collected.
    46   nsCOMPtr<nsIIccProvider> mProvider;
    47 };
    49 } // namespace dom
    50 } // namespace mozilla
    52 #endif // mozilla_dom_IccListener_h

mercurial