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=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 file, |
michael@0 | 5 | * You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 6 | |
michael@0 | 7 | #ifndef nsIOfflineStorage_h__ |
michael@0 | 8 | #define nsIOfflineStorage_h__ |
michael@0 | 9 | |
michael@0 | 10 | #include "nsIFileStorage.h" |
michael@0 | 11 | |
michael@0 | 12 | #include "mozilla/dom/quota/PersistenceType.h" |
michael@0 | 13 | |
michael@0 | 14 | #define NS_OFFLINESTORAGE_IID \ |
michael@0 | 15 | {0xec7e878d, 0xc8c1, 0x402e, \ |
michael@0 | 16 | { 0xa2, 0xc4, 0xf6, 0x82, 0x29, 0x4e, 0x3c, 0xb1 } } |
michael@0 | 17 | |
michael@0 | 18 | class nsPIDOMWindow; |
michael@0 | 19 | |
michael@0 | 20 | namespace mozilla { |
michael@0 | 21 | namespace dom { |
michael@0 | 22 | namespace quota { |
michael@0 | 23 | class Client; |
michael@0 | 24 | } |
michael@0 | 25 | } |
michael@0 | 26 | } |
michael@0 | 27 | |
michael@0 | 28 | class nsIOfflineStorage : public nsIFileStorage |
michael@0 | 29 | { |
michael@0 | 30 | public: |
michael@0 | 31 | typedef mozilla::dom::quota::Client Client; |
michael@0 | 32 | typedef mozilla::dom::quota::PersistenceType PersistenceType; |
michael@0 | 33 | |
michael@0 | 34 | NS_DECLARE_STATIC_IID_ACCESSOR(NS_OFFLINESTORAGE_IID) |
michael@0 | 35 | |
michael@0 | 36 | NS_IMETHOD_(Client*) |
michael@0 | 37 | GetClient() = 0; |
michael@0 | 38 | |
michael@0 | 39 | NS_IMETHOD_(bool) |
michael@0 | 40 | IsOwned(nsPIDOMWindow* aOwner) = 0; |
michael@0 | 41 | |
michael@0 | 42 | NS_IMETHOD_(PersistenceType) |
michael@0 | 43 | Type() |
michael@0 | 44 | { |
michael@0 | 45 | return mPersistenceType; |
michael@0 | 46 | } |
michael@0 | 47 | |
michael@0 | 48 | NS_IMETHOD_(const nsACString&) |
michael@0 | 49 | Group() |
michael@0 | 50 | { |
michael@0 | 51 | return mGroup; |
michael@0 | 52 | } |
michael@0 | 53 | |
michael@0 | 54 | NS_IMETHOD_(const nsACString&) |
michael@0 | 55 | Origin() = 0; |
michael@0 | 56 | |
michael@0 | 57 | // Implementation of this method should close the storage (without aborting |
michael@0 | 58 | // running operations nor discarding pending operations). |
michael@0 | 59 | NS_IMETHOD_(nsresult) |
michael@0 | 60 | Close() = 0; |
michael@0 | 61 | |
michael@0 | 62 | // Whether or not the storage has had Close called on it. |
michael@0 | 63 | NS_IMETHOD_(bool) |
michael@0 | 64 | IsClosed() = 0; |
michael@0 | 65 | |
michael@0 | 66 | // Implementation of this method should close the storage, all running |
michael@0 | 67 | // operations should be aborted and pending operations should be discarded. |
michael@0 | 68 | NS_IMETHOD_(void) |
michael@0 | 69 | Invalidate() = 0; |
michael@0 | 70 | |
michael@0 | 71 | protected: |
michael@0 | 72 | nsIOfflineStorage() |
michael@0 | 73 | : mPersistenceType(mozilla::dom::quota::PERSISTENCE_TYPE_INVALID) |
michael@0 | 74 | { } |
michael@0 | 75 | |
michael@0 | 76 | virtual ~nsIOfflineStorage() |
michael@0 | 77 | { } |
michael@0 | 78 | |
michael@0 | 79 | PersistenceType mPersistenceType; |
michael@0 | 80 | nsCString mGroup; |
michael@0 | 81 | }; |
michael@0 | 82 | |
michael@0 | 83 | NS_DEFINE_STATIC_IID_ACCESSOR(nsIOfflineStorage, NS_OFFLINESTORAGE_IID) |
michael@0 | 84 | |
michael@0 | 85 | #define NS_DECL_NSIOFFLINESTORAGE \ |
michael@0 | 86 | NS_IMETHOD_(Client*) \ |
michael@0 | 87 | GetClient() MOZ_OVERRIDE; \ |
michael@0 | 88 | \ |
michael@0 | 89 | NS_IMETHOD_(bool) \ |
michael@0 | 90 | IsOwned(nsPIDOMWindow* aOwner) MOZ_OVERRIDE; \ |
michael@0 | 91 | \ |
michael@0 | 92 | NS_IMETHOD_(const nsACString&) \ |
michael@0 | 93 | Origin() MOZ_OVERRIDE; \ |
michael@0 | 94 | \ |
michael@0 | 95 | NS_IMETHOD_(nsresult) \ |
michael@0 | 96 | Close() MOZ_OVERRIDE; \ |
michael@0 | 97 | \ |
michael@0 | 98 | NS_IMETHOD_(bool) \ |
michael@0 | 99 | IsClosed() MOZ_OVERRIDE; \ |
michael@0 | 100 | \ |
michael@0 | 101 | NS_IMETHOD_(void) \ |
michael@0 | 102 | Invalidate() MOZ_OVERRIDE; |
michael@0 | 103 | |
michael@0 | 104 | #endif // nsIOfflineStorage_h__ |