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 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #ifndef nsEditRules_h__ |
michael@0 | 7 | #define nsEditRules_h__ |
michael@0 | 8 | |
michael@0 | 9 | #define NS_IEDITRULES_IID \ |
michael@0 | 10 | { 0x3836386d, 0x806a, 0x488d, \ |
michael@0 | 11 | { 0x8b, 0xab, 0xaf, 0x42, 0xbb, 0x4c, 0x90, 0x66 } } |
michael@0 | 12 | |
michael@0 | 13 | #include "nsEditor.h" |
michael@0 | 14 | |
michael@0 | 15 | class nsPlaintextEditor; |
michael@0 | 16 | class nsISelection; |
michael@0 | 17 | |
michael@0 | 18 | /*************************************************************************** |
michael@0 | 19 | * base for an object to encapsulate any additional info needed to be passed |
michael@0 | 20 | * to rules system by the editor |
michael@0 | 21 | */ |
michael@0 | 22 | class nsRulesInfo |
michael@0 | 23 | { |
michael@0 | 24 | public: |
michael@0 | 25 | |
michael@0 | 26 | nsRulesInfo(EditAction aAction) : action(aAction) {} |
michael@0 | 27 | virtual ~nsRulesInfo() {} |
michael@0 | 28 | |
michael@0 | 29 | EditAction action; |
michael@0 | 30 | }; |
michael@0 | 31 | |
michael@0 | 32 | /*************************************************************************** |
michael@0 | 33 | * Interface of editing rules. |
michael@0 | 34 | * |
michael@0 | 35 | */ |
michael@0 | 36 | class nsIEditRules : public nsISupports |
michael@0 | 37 | { |
michael@0 | 38 | public: |
michael@0 | 39 | NS_DECLARE_STATIC_IID_ACCESSOR(NS_IEDITRULES_IID) |
michael@0 | 40 | |
michael@0 | 41 | //Interfaces for addref and release and queryinterface |
michael@0 | 42 | //NOTE: Use NS_DECL_ISUPPORTS_INHERITED in any class inherited from nsIEditRules |
michael@0 | 43 | |
michael@0 | 44 | NS_IMETHOD Init(nsPlaintextEditor *aEditor)=0; |
michael@0 | 45 | NS_IMETHOD SetInitialValue(const nsAString& aValue) = 0; |
michael@0 | 46 | NS_IMETHOD DetachEditor()=0; |
michael@0 | 47 | NS_IMETHOD BeforeEdit(EditAction action, |
michael@0 | 48 | nsIEditor::EDirection aDirection) = 0; |
michael@0 | 49 | NS_IMETHOD AfterEdit(EditAction action, |
michael@0 | 50 | nsIEditor::EDirection aDirection) = 0; |
michael@0 | 51 | NS_IMETHOD WillDoAction(mozilla::dom::Selection* aSelection, nsRulesInfo* aInfo, |
michael@0 | 52 | bool* aCancel, bool* aHandled) = 0; |
michael@0 | 53 | NS_IMETHOD DidDoAction(nsISelection *aSelection, nsRulesInfo *aInfo, nsresult aResult)=0; |
michael@0 | 54 | NS_IMETHOD DocumentIsEmpty(bool *aDocumentIsEmpty)=0; |
michael@0 | 55 | NS_IMETHOD DocumentModified()=0; |
michael@0 | 56 | }; |
michael@0 | 57 | |
michael@0 | 58 | NS_DEFINE_STATIC_IID_ACCESSOR(nsIEditRules, NS_IEDITRULES_IID) |
michael@0 | 59 | |
michael@0 | 60 | #endif //nsEditRules_h__ |
michael@0 | 61 |