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: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* vim: set ts=8 sts=2 et sw=2 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 BackstagePass_h__ |
michael@0 | 8 | #define BackstagePass_h__ |
michael@0 | 9 | |
michael@0 | 10 | #include "nsISupports.h" |
michael@0 | 11 | #include "nsWeakReference.h" |
michael@0 | 12 | #include "nsIGlobalObject.h" |
michael@0 | 13 | #include "nsIScriptObjectPrincipal.h" |
michael@0 | 14 | #include "nsIXPCScriptable.h" |
michael@0 | 15 | |
michael@0 | 16 | #include "js/HeapAPI.h" |
michael@0 | 17 | |
michael@0 | 18 | class BackstagePass : public nsIGlobalObject, |
michael@0 | 19 | public nsIScriptObjectPrincipal, |
michael@0 | 20 | public nsIXPCScriptable, |
michael@0 | 21 | public nsIClassInfo, |
michael@0 | 22 | public nsSupportsWeakReference |
michael@0 | 23 | { |
michael@0 | 24 | public: |
michael@0 | 25 | NS_DECL_ISUPPORTS |
michael@0 | 26 | NS_DECL_NSIXPCSCRIPTABLE |
michael@0 | 27 | NS_DECL_NSICLASSINFO |
michael@0 | 28 | |
michael@0 | 29 | virtual nsIPrincipal* GetPrincipal() { |
michael@0 | 30 | return mPrincipal; |
michael@0 | 31 | } |
michael@0 | 32 | |
michael@0 | 33 | virtual JSObject* GetGlobalJSObject() { |
michael@0 | 34 | return mGlobal; |
michael@0 | 35 | } |
michael@0 | 36 | |
michael@0 | 37 | virtual void ForgetGlobalObject() { |
michael@0 | 38 | mGlobal = nullptr; |
michael@0 | 39 | } |
michael@0 | 40 | |
michael@0 | 41 | virtual void SetGlobalObject(JSObject* global) { |
michael@0 | 42 | mGlobal = global; |
michael@0 | 43 | } |
michael@0 | 44 | |
michael@0 | 45 | BackstagePass(nsIPrincipal *prin) : |
michael@0 | 46 | mPrincipal(prin) |
michael@0 | 47 | { |
michael@0 | 48 | } |
michael@0 | 49 | |
michael@0 | 50 | virtual ~BackstagePass() { } |
michael@0 | 51 | |
michael@0 | 52 | private: |
michael@0 | 53 | nsCOMPtr<nsIPrincipal> mPrincipal; |
michael@0 | 54 | JS::TenuredHeap<JSObject*> mGlobal; |
michael@0 | 55 | }; |
michael@0 | 56 | |
michael@0 | 57 | nsresult |
michael@0 | 58 | NS_NewBackstagePass(BackstagePass** ret); |
michael@0 | 59 | |
michael@0 | 60 | #endif // BackstagePass_h__ |