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: 3; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
michael@0 | 2 | * |
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 nsWindowRoot_h__ |
michael@0 | 8 | #define nsWindowRoot_h__ |
michael@0 | 9 | |
michael@0 | 10 | class nsPIDOMWindow; |
michael@0 | 11 | class nsIDOMEventListener; |
michael@0 | 12 | class nsIDOMEvent; |
michael@0 | 13 | |
michael@0 | 14 | namespace mozilla { |
michael@0 | 15 | class EventChainPostVisitor; |
michael@0 | 16 | class EventChainPreVisitor; |
michael@0 | 17 | } // namespace mozilla |
michael@0 | 18 | |
michael@0 | 19 | #include "mozilla/Attributes.h" |
michael@0 | 20 | #include "mozilla/EventListenerManager.h" |
michael@0 | 21 | #include "nsIDOMEventTarget.h" |
michael@0 | 22 | #include "nsPIWindowRoot.h" |
michael@0 | 23 | #include "nsCycleCollectionParticipant.h" |
michael@0 | 24 | #include "nsAutoPtr.h" |
michael@0 | 25 | |
michael@0 | 26 | class nsWindowRoot : public nsPIWindowRoot |
michael@0 | 27 | { |
michael@0 | 28 | public: |
michael@0 | 29 | nsWindowRoot(nsPIDOMWindow* aWindow); |
michael@0 | 30 | virtual ~nsWindowRoot(); |
michael@0 | 31 | |
michael@0 | 32 | NS_DECL_CYCLE_COLLECTING_ISUPPORTS |
michael@0 | 33 | NS_DECL_NSIDOMEVENTTARGET |
michael@0 | 34 | |
michael@0 | 35 | virtual mozilla::EventListenerManager* |
michael@0 | 36 | GetExistingListenerManager() const MOZ_OVERRIDE; |
michael@0 | 37 | virtual mozilla::EventListenerManager* |
michael@0 | 38 | GetOrCreateListenerManager() MOZ_OVERRIDE; |
michael@0 | 39 | |
michael@0 | 40 | using mozilla::dom::EventTarget::RemoveEventListener; |
michael@0 | 41 | virtual void AddEventListener(const nsAString& aType, |
michael@0 | 42 | mozilla::dom::EventListener* aListener, |
michael@0 | 43 | bool aUseCapture, |
michael@0 | 44 | const mozilla::dom::Nullable<bool>& aWantsUntrusted, |
michael@0 | 45 | mozilla::ErrorResult& aRv) MOZ_OVERRIDE; |
michael@0 | 46 | |
michael@0 | 47 | // nsPIWindowRoot |
michael@0 | 48 | |
michael@0 | 49 | virtual nsPIDOMWindow* GetWindow() MOZ_OVERRIDE; |
michael@0 | 50 | |
michael@0 | 51 | virtual nsresult GetControllers(nsIControllers** aResult) MOZ_OVERRIDE; |
michael@0 | 52 | virtual nsresult GetControllerForCommand(const char * aCommand, |
michael@0 | 53 | nsIController** _retval) MOZ_OVERRIDE; |
michael@0 | 54 | |
michael@0 | 55 | virtual nsIDOMNode* GetPopupNode() MOZ_OVERRIDE; |
michael@0 | 56 | virtual void SetPopupNode(nsIDOMNode* aNode) MOZ_OVERRIDE; |
michael@0 | 57 | |
michael@0 | 58 | virtual void SetParentTarget(mozilla::dom::EventTarget* aTarget) MOZ_OVERRIDE |
michael@0 | 59 | { |
michael@0 | 60 | mParent = aTarget; |
michael@0 | 61 | } |
michael@0 | 62 | virtual mozilla::dom::EventTarget* GetParentTarget() MOZ_OVERRIDE { return mParent; } |
michael@0 | 63 | virtual nsIDOMWindow* GetOwnerGlobal() MOZ_OVERRIDE; |
michael@0 | 64 | |
michael@0 | 65 | NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsWindowRoot, |
michael@0 | 66 | nsIDOMEventTarget) |
michael@0 | 67 | |
michael@0 | 68 | protected: |
michael@0 | 69 | // Members |
michael@0 | 70 | nsCOMPtr<nsPIDOMWindow> mWindow; |
michael@0 | 71 | // We own the manager, which owns event listeners attached to us. |
michael@0 | 72 | nsRefPtr<mozilla::EventListenerManager> mListenerManager; // [Strong] |
michael@0 | 73 | nsCOMPtr<nsIDOMNode> mPopupNode; // [OWNER] |
michael@0 | 74 | |
michael@0 | 75 | nsCOMPtr<mozilla::dom::EventTarget> mParent; |
michael@0 | 76 | }; |
michael@0 | 77 | |
michael@0 | 78 | extern already_AddRefed<mozilla::dom::EventTarget> |
michael@0 | 79 | NS_NewWindowRoot(nsPIDOMWindow* aWindow); |
michael@0 | 80 | |
michael@0 | 81 | #endif |