dom/xbl/nsXBLDocumentInfo.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
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 #ifndef nsXBLDocumentInfo_h__
     6 #define nsXBLDocumentInfo_h__
     8 #include "mozilla/Attributes.h"
     9 #include "nsCOMPtr.h"
    10 #include "nsAutoPtr.h"
    11 #include "nsWeakReference.h"
    12 #include "nsIDocument.h"
    13 #include "nsCycleCollectionParticipant.h"
    15 class nsXBLPrototypeBinding;
    16 class nsXBLDocGlobalObject;
    18 class nsXBLDocumentInfo MOZ_FINAL : public nsSupportsWeakReference
    19 {
    20 public:
    21   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
    23   nsXBLDocumentInfo(nsIDocument* aDocument);
    24   virtual ~nsXBLDocumentInfo();
    26   already_AddRefed<nsIDocument> GetDocument()
    27     { nsCOMPtr<nsIDocument> copy = mDocument; return copy.forget(); }
    29   bool GetScriptAccess() const { return mScriptAccess; }
    31   nsIURI* DocumentURI() { return mDocument->GetDocumentURI(); }
    33   nsXBLPrototypeBinding* GetPrototypeBinding(const nsACString& aRef);
    34   nsresult SetPrototypeBinding(const nsACString& aRef,
    35                                nsXBLPrototypeBinding* aBinding);
    37   // This removes the binding without deleting it
    38   void RemovePrototypeBinding(const nsACString& aRef);
    40   nsresult WritePrototypeBindings();
    42   void SetFirstPrototypeBinding(nsXBLPrototypeBinding* aBinding);
    44   void FlushSkinStylesheets();
    46   bool IsChrome() { return mIsChrome; }
    48   void MarkInCCGeneration(uint32_t aGeneration);
    50   static nsresult ReadPrototypeBindings(nsIURI* aURI, nsXBLDocumentInfo** aDocInfo);
    52   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsXBLDocumentInfo)
    54 private:
    55   nsCOMPtr<nsIDocument> mDocument;
    56   bool mScriptAccess;
    57   bool mIsChrome;
    58   // the binding table owns each nsXBLPrototypeBinding
    59   nsAutoPtr<nsClassHashtable<nsCStringHashKey, nsXBLPrototypeBinding>> mBindingTable;
    61   // non-owning pointer to the first binding in the table
    62   nsXBLPrototypeBinding* mFirstBinding;
    63 };
    65 #ifdef DEBUG
    66 void AssertInCompilationScope();
    67 #else
    68 inline void AssertInCompilationScope() {}
    69 #endif
    71 #endif

mercurial