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 DeleteTextTxn_h__ |
michael@0 | 7 | #define DeleteTextTxn_h__ |
michael@0 | 8 | |
michael@0 | 9 | #include "EditTxn.h" |
michael@0 | 10 | #include "nsCOMPtr.h" |
michael@0 | 11 | #include "nsCycleCollectionParticipant.h" |
michael@0 | 12 | #include "nsID.h" |
michael@0 | 13 | #include "nsIDOMCharacterData.h" |
michael@0 | 14 | #include "nsString.h" |
michael@0 | 15 | #include "nscore.h" |
michael@0 | 16 | |
michael@0 | 17 | class nsEditor; |
michael@0 | 18 | class nsRangeUpdater; |
michael@0 | 19 | |
michael@0 | 20 | /** |
michael@0 | 21 | * A transaction that removes text from a content node. |
michael@0 | 22 | */ |
michael@0 | 23 | class DeleteTextTxn : public EditTxn |
michael@0 | 24 | { |
michael@0 | 25 | public: |
michael@0 | 26 | /** initialize the transaction. |
michael@0 | 27 | * @param aEditor the provider of basic editing operations |
michael@0 | 28 | * @param aElement the content node to remove text from |
michael@0 | 29 | * @param aOffset the location in aElement to begin the deletion |
michael@0 | 30 | * @param aNumCharsToDelete the number of characters to delete. Not the number of bytes! |
michael@0 | 31 | */ |
michael@0 | 32 | NS_IMETHOD Init(nsEditor* aEditor, |
michael@0 | 33 | nsIDOMCharacterData* aCharData, |
michael@0 | 34 | uint32_t aOffset, |
michael@0 | 35 | uint32_t aNumCharsToDelete, |
michael@0 | 36 | nsRangeUpdater* aRangeUpdater); |
michael@0 | 37 | |
michael@0 | 38 | DeleteTextTxn(); |
michael@0 | 39 | |
michael@0 | 40 | NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(DeleteTextTxn, EditTxn) |
michael@0 | 41 | NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr); |
michael@0 | 42 | |
michael@0 | 43 | NS_DECL_EDITTXN |
michael@0 | 44 | |
michael@0 | 45 | uint32_t GetOffset() { return mOffset; } |
michael@0 | 46 | |
michael@0 | 47 | uint32_t GetNumCharsToDelete() { return mNumCharsToDelete; } |
michael@0 | 48 | |
michael@0 | 49 | protected: |
michael@0 | 50 | |
michael@0 | 51 | /** the provider of basic editing operations */ |
michael@0 | 52 | nsEditor* mEditor; |
michael@0 | 53 | |
michael@0 | 54 | /** the CharacterData node to operate upon */ |
michael@0 | 55 | nsCOMPtr<nsIDOMCharacterData> mCharData; |
michael@0 | 56 | |
michael@0 | 57 | /** the offset into mCharData where the deletion is to take place */ |
michael@0 | 58 | uint32_t mOffset; |
michael@0 | 59 | |
michael@0 | 60 | /** the number of characters to delete */ |
michael@0 | 61 | uint32_t mNumCharsToDelete; |
michael@0 | 62 | |
michael@0 | 63 | /** the text that was deleted */ |
michael@0 | 64 | nsString mDeletedText; |
michael@0 | 65 | |
michael@0 | 66 | /** range updater object */ |
michael@0 | 67 | nsRangeUpdater* mRangeUpdater; |
michael@0 | 68 | }; |
michael@0 | 69 | |
michael@0 | 70 | #endif |