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: IDL; tab-width: 8; 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 | #include "nsISupports.idl" |
michael@0 | 7 | |
michael@0 | 8 | interface nsIFile; |
michael@0 | 9 | interface nsIProfileUnlocker; |
michael@0 | 10 | |
michael@0 | 11 | /** |
michael@0 | 12 | * Hold on to a profile lock. Once you release the last reference to this |
michael@0 | 13 | * interface, the profile lock is released. |
michael@0 | 14 | */ |
michael@0 | 15 | [scriptable, uuid(7c58c703-d245-4864-8d75-9648ca4a6139)] |
michael@0 | 16 | interface nsIProfileLock : nsISupports |
michael@0 | 17 | { |
michael@0 | 18 | /** |
michael@0 | 19 | * The main profile directory. |
michael@0 | 20 | */ |
michael@0 | 21 | readonly attribute nsIFile directory; |
michael@0 | 22 | |
michael@0 | 23 | /** |
michael@0 | 24 | * A directory corresponding to the main profile directory that exists for |
michael@0 | 25 | * the purpose of storing data on the local filesystem, including cache |
michael@0 | 26 | * files or other data files that may not represent critical user data. |
michael@0 | 27 | * (e.g., this directory may not be included as part of a backup scheme.) |
michael@0 | 28 | * |
michael@0 | 29 | * In some cases, this directory may just be the main profile directory. |
michael@0 | 30 | */ |
michael@0 | 31 | readonly attribute nsIFile localDirectory; |
michael@0 | 32 | |
michael@0 | 33 | /** |
michael@0 | 34 | * The timestamp of an existing profile lock at lock time. |
michael@0 | 35 | */ |
michael@0 | 36 | readonly attribute PRTime replacedLockTime; |
michael@0 | 37 | |
michael@0 | 38 | /** |
michael@0 | 39 | * Unlock the profile. |
michael@0 | 40 | */ |
michael@0 | 41 | void unlock(); |
michael@0 | 42 | }; |
michael@0 | 43 | |
michael@0 | 44 | /** |
michael@0 | 45 | * A interface representing a profile. |
michael@0 | 46 | * @note THIS INTERFACE SHOULD BE IMPLEMENTED BY THE TOOLKIT CODE ONLY! DON'T |
michael@0 | 47 | * EVEN THINK ABOUT IMPLEMENTING THIS IN JAVASCRIPT! |
michael@0 | 48 | */ |
michael@0 | 49 | [scriptable, uuid(7422b090-4a86-4407-972e-75468a625388)] |
michael@0 | 50 | interface nsIToolkitProfile : nsISupports |
michael@0 | 51 | { |
michael@0 | 52 | /** |
michael@0 | 53 | * The location of the profile directory. |
michael@0 | 54 | */ |
michael@0 | 55 | readonly attribute nsIFile rootDir; |
michael@0 | 56 | |
michael@0 | 57 | /** |
michael@0 | 58 | * The location of the profile local directory, which may be the same as |
michael@0 | 59 | * the root directory. See nsIProfileLock::localDirectory. |
michael@0 | 60 | */ |
michael@0 | 61 | readonly attribute nsIFile localDir; |
michael@0 | 62 | |
michael@0 | 63 | /** |
michael@0 | 64 | * The name of the profile. |
michael@0 | 65 | */ |
michael@0 | 66 | attribute AUTF8String name; |
michael@0 | 67 | |
michael@0 | 68 | /** |
michael@0 | 69 | * Removes the profile from the registry of profiles. |
michael@0 | 70 | * |
michael@0 | 71 | * @param removeFiles |
michael@0 | 72 | * Indicates whether or not the profile directory should be |
michael@0 | 73 | * removed in addition. |
michael@0 | 74 | */ |
michael@0 | 75 | void remove(in boolean removeFiles); |
michael@0 | 76 | |
michael@0 | 77 | /** |
michael@0 | 78 | * Lock this profile using platform-specific locking methods. |
michael@0 | 79 | * |
michael@0 | 80 | * @param lockFile If locking fails, this may return a lockFile object |
michael@0 | 81 | * which can be used in platform-specific ways to |
michael@0 | 82 | * determine which process has the file locked. Null |
michael@0 | 83 | * may be passed. |
michael@0 | 84 | * @return An interface which holds a profile lock as long as you reference |
michael@0 | 85 | * it. |
michael@0 | 86 | * @throws NS_ERROR_FILE_ACCESS_DENIED if the profile was already locked. |
michael@0 | 87 | */ |
michael@0 | 88 | nsIProfileLock lock(out nsIProfileUnlocker aUnlocker); |
michael@0 | 89 | }; |