Sat, 03 Jan 2015 20:18:00 +0100
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.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* vim: set ts=2 sw=2 et tw=80: */ |
michael@0 | 3 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 6 | |
michael@0 | 7 | #ifndef nsLocation_h__ |
michael@0 | 8 | #define nsLocation_h__ |
michael@0 | 9 | |
michael@0 | 10 | #include "nsIDOMLocation.h" |
michael@0 | 11 | #include "nsString.h" |
michael@0 | 12 | #include "nsIWeakReferenceUtils.h" |
michael@0 | 13 | #include "nsWrapperCache.h" |
michael@0 | 14 | #include "nsCycleCollectionParticipant.h" |
michael@0 | 15 | #include "js/TypeDecls.h" |
michael@0 | 16 | |
michael@0 | 17 | class nsIURI; |
michael@0 | 18 | class nsIDocShell; |
michael@0 | 19 | class nsIDocShellLoadInfo; |
michael@0 | 20 | |
michael@0 | 21 | //***************************************************************************** |
michael@0 | 22 | // nsLocation: Script "location" object |
michael@0 | 23 | //***************************************************************************** |
michael@0 | 24 | |
michael@0 | 25 | class nsLocation : public nsIDOMLocation |
michael@0 | 26 | , public nsWrapperCache |
michael@0 | 27 | { |
michael@0 | 28 | public: |
michael@0 | 29 | nsLocation(nsIDocShell *aDocShell); |
michael@0 | 30 | virtual ~nsLocation(); |
michael@0 | 31 | |
michael@0 | 32 | NS_DECL_CYCLE_COLLECTING_ISUPPORTS |
michael@0 | 33 | NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsLocation) |
michael@0 | 34 | |
michael@0 | 35 | void SetDocShell(nsIDocShell *aDocShell); |
michael@0 | 36 | nsIDocShell *GetDocShell(); |
michael@0 | 37 | |
michael@0 | 38 | // nsIDOMLocation |
michael@0 | 39 | NS_DECL_NSIDOMLOCATION |
michael@0 | 40 | |
michael@0 | 41 | protected: |
michael@0 | 42 | // In the case of jar: uris, we sometimes want the place the jar was |
michael@0 | 43 | // fetched from as the URI instead of the jar: uri itself. Pass in |
michael@0 | 44 | // true for aGetInnermostURI when that's the case. |
michael@0 | 45 | nsresult GetURI(nsIURI** aURL, bool aGetInnermostURI = false); |
michael@0 | 46 | nsresult GetWritableURI(nsIURI** aURL); |
michael@0 | 47 | nsresult SetURI(nsIURI* aURL, bool aReplace = false); |
michael@0 | 48 | nsresult SetHrefWithBase(const nsAString& aHref, nsIURI* aBase, |
michael@0 | 49 | bool aReplace); |
michael@0 | 50 | nsresult SetHrefWithContext(JSContext* cx, const nsAString& aHref, |
michael@0 | 51 | bool aReplace); |
michael@0 | 52 | |
michael@0 | 53 | nsresult GetSourceBaseURL(JSContext* cx, nsIURI** sourceURL); |
michael@0 | 54 | nsresult CheckURL(nsIURI *url, nsIDocShellLoadInfo** aLoadInfo); |
michael@0 | 55 | bool CallerSubsumes(); |
michael@0 | 56 | |
michael@0 | 57 | nsString mCachedHash; |
michael@0 | 58 | nsWeakPtr mDocShell; |
michael@0 | 59 | nsWeakPtr mOuter; |
michael@0 | 60 | }; |
michael@0 | 61 | |
michael@0 | 62 | #endif // nsLocation_h__ |
michael@0 | 63 |