dom/xbl/nsXBLResourceLoader.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 /* -*- 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 nsXBLResourceLoader_h
     7 #define nsXBLResourceLoader_h
     9 #include "mozilla/Attributes.h"
    10 #include "nsCOMPtr.h"
    11 #include "nsICSSLoaderObserver.h"
    12 #include "nsCOMArray.h"
    13 #include "nsCycleCollectionParticipant.h"
    15 class nsIContent;
    16 class nsIAtom;
    17 class nsXBLPrototypeResources;
    18 class nsXBLPrototypeBinding;
    19 struct nsXBLResource;
    20 class nsIObjectOutputStream;
    22 // *********************************************************************/
    23 // The XBLResourceLoader class
    25 class nsXBLResourceLoader : public nsICSSLoaderObserver
    26 {
    27 public:
    28   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
    29   NS_DECL_CYCLE_COLLECTION_CLASS(nsXBLResourceLoader)
    31   // nsICSSLoaderObserver
    32   NS_IMETHOD StyleSheetLoaded(nsCSSStyleSheet* aSheet, bool aWasAlternate,
    33                               nsresult aStatus) MOZ_OVERRIDE;
    35   void LoadResources(bool* aResult);
    36   void AddResource(nsIAtom* aResourceType, const nsAString& aSrc);
    37   void AddResourceListener(nsIContent* aElement);
    39   nsXBLResourceLoader(nsXBLPrototypeBinding* aBinding,
    40                       nsXBLPrototypeResources* aResources);
    41   virtual ~nsXBLResourceLoader();
    43   void NotifyBoundElements();
    45   nsresult Write(nsIObjectOutputStream* aStream);
    47 // MEMBER VARIABLES
    48   nsXBLPrototypeBinding* mBinding; // A pointer back to our binding.
    49   nsXBLPrototypeResources* mResources; // A pointer back to our resources
    50                                        // information.  May be null if the
    51                                        // resources have already been
    52                                        // destroyed.
    54   nsXBLResource* mResourceList; // The list of resources we need to load.
    55   nsXBLResource* mLastResource;
    57   bool mLoadingResources;
    58   // We need mInLoadResourcesFunc because we do a mixture of sync and
    59   // async loads.
    60   bool mInLoadResourcesFunc;
    61   int16_t mPendingSheets; // The number of stylesheets that have yet to load.
    63   // Bound elements that are waiting on the stylesheets and scripts.
    64   nsCOMArray<nsIContent> mBoundElements;
    65 };
    67 #endif

mercurial