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: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
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 nsArray_h__ |
michael@0 | 7 | #define nsArray_h__ |
michael@0 | 8 | |
michael@0 | 9 | #include "nsIMutableArray.h" |
michael@0 | 10 | #include "nsCOMArray.h" |
michael@0 | 11 | #include "nsCOMPtr.h" |
michael@0 | 12 | #include "nsCycleCollectionParticipant.h" |
michael@0 | 13 | #include "mozilla/Attributes.h" |
michael@0 | 14 | |
michael@0 | 15 | // {35C66FD1-95E9-4e0a-80C5-C3BD2B375481} |
michael@0 | 16 | #define NS_ARRAY_CID \ |
michael@0 | 17 | { 0x35c66fd1, 0x95e9, 0x4e0a, \ |
michael@0 | 18 | { 0x80, 0xc5, 0xc3, 0xbd, 0x2b, 0x37, 0x54, 0x81 } } |
michael@0 | 19 | |
michael@0 | 20 | class nsArray : public nsIMutableArray |
michael@0 | 21 | { |
michael@0 | 22 | public: |
michael@0 | 23 | NS_DECL_ISUPPORTS |
michael@0 | 24 | NS_DECL_NSIARRAY |
michael@0 | 25 | NS_DECL_NSIMUTABLEARRAY |
michael@0 | 26 | |
michael@0 | 27 | /* Both of these factory functions create a cycle-collectable array |
michael@0 | 28 | on the main thread and a non-cycle-collectable array on other |
michael@0 | 29 | threads. */ |
michael@0 | 30 | static already_AddRefed<nsIMutableArray> Create(); |
michael@0 | 31 | /* Only for the benefit of the XPCOM module system, use Create() |
michael@0 | 32 | instead. */ |
michael@0 | 33 | static nsresult XPCOMConstructor(nsISupports* aOuter, const nsIID& aIID, |
michael@0 | 34 | void** aResult); |
michael@0 | 35 | protected: |
michael@0 | 36 | nsArray() { } |
michael@0 | 37 | nsArray(const nsArray& other); |
michael@0 | 38 | nsArray(const nsCOMArray_base& aBaseArray) : mArray(aBaseArray) |
michael@0 | 39 | { } |
michael@0 | 40 | |
michael@0 | 41 | virtual ~nsArray(); // nsArrayCC inherits from this |
michael@0 | 42 | |
michael@0 | 43 | nsCOMArray_base mArray; |
michael@0 | 44 | }; |
michael@0 | 45 | |
michael@0 | 46 | class nsArrayCC MOZ_FINAL : public nsArray |
michael@0 | 47 | { |
michael@0 | 48 | friend class nsArray; |
michael@0 | 49 | |
michael@0 | 50 | public: |
michael@0 | 51 | NS_DECL_CYCLE_COLLECTING_ISUPPORTS |
michael@0 | 52 | NS_DECL_CYCLE_COLLECTION_CLASS(nsArrayCC) |
michael@0 | 53 | |
michael@0 | 54 | private: |
michael@0 | 55 | nsArrayCC() : nsArray() { } |
michael@0 | 56 | nsArrayCC(const nsArrayCC& other); |
michael@0 | 57 | nsArrayCC(const nsCOMArray_base& aBaseArray) : nsArray(aBaseArray) |
michael@0 | 58 | { } |
michael@0 | 59 | }; |
michael@0 | 60 | |
michael@0 | 61 | #endif |