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 nsAppRunner_h__ |
michael@0 | 7 | #define nsAppRunner_h__ |
michael@0 | 8 | |
michael@0 | 9 | #ifdef XP_WIN |
michael@0 | 10 | #include <windows.h> |
michael@0 | 11 | #else |
michael@0 | 12 | #include <limits.h> |
michael@0 | 13 | #endif |
michael@0 | 14 | |
michael@0 | 15 | #ifndef MAXPATHLEN |
michael@0 | 16 | #ifdef PATH_MAX |
michael@0 | 17 | #define MAXPATHLEN PATH_MAX |
michael@0 | 18 | #elif defined(_MAX_PATH) |
michael@0 | 19 | #define MAXPATHLEN _MAX_PATH |
michael@0 | 20 | #elif defined(CCHMAXPATH) |
michael@0 | 21 | #define MAXPATHLEN CCHMAXPATH |
michael@0 | 22 | #else |
michael@0 | 23 | #define MAXPATHLEN 1024 |
michael@0 | 24 | #endif |
michael@0 | 25 | #endif |
michael@0 | 26 | |
michael@0 | 27 | #include "nscore.h" |
michael@0 | 28 | #include "nsXULAppAPI.h" |
michael@0 | 29 | |
michael@0 | 30 | // This directory service key is a lot like NS_APP_LOCALSTORE_50_FILE, |
michael@0 | 31 | // but it is always the "main" localstore file, even when we're in safe mode |
michael@0 | 32 | // and we load localstore from somewhere else. |
michael@0 | 33 | #define NS_LOCALSTORE_UNSAFE_FILE "LStoreS" |
michael@0 | 34 | |
michael@0 | 35 | class nsACString; |
michael@0 | 36 | struct nsStaticModuleInfo; |
michael@0 | 37 | |
michael@0 | 38 | class nsINativeAppSupport; |
michael@0 | 39 | class nsICmdLineService; |
michael@0 | 40 | class nsXREDirProvider; |
michael@0 | 41 | class nsIToolkitProfileService; |
michael@0 | 42 | class nsIFile; |
michael@0 | 43 | class nsIProfileLock; |
michael@0 | 44 | class nsIProfileUnlocker; |
michael@0 | 45 | class nsIFactory; |
michael@0 | 46 | |
michael@0 | 47 | extern nsXREDirProvider* gDirServiceProvider; |
michael@0 | 48 | |
michael@0 | 49 | // NOTE: gAppData will be null in embedded contexts. The "size" parameter |
michael@0 | 50 | // will be the size of the original structure passed to XRE_main, but the |
michael@0 | 51 | // structure will have all of the members available. |
michael@0 | 52 | extern const nsXREAppData* gAppData; |
michael@0 | 53 | extern bool gSafeMode; |
michael@0 | 54 | |
michael@0 | 55 | extern int gArgc; |
michael@0 | 56 | extern char **gArgv; |
michael@0 | 57 | extern int gRestartArgc; |
michael@0 | 58 | extern char **gRestartArgv; |
michael@0 | 59 | extern bool gLogConsoleErrors; |
michael@0 | 60 | |
michael@0 | 61 | /** |
michael@0 | 62 | * Create the nativeappsupport implementation. |
michael@0 | 63 | * |
michael@0 | 64 | * @note XPCOMInit has not happened yet. |
michael@0 | 65 | */ |
michael@0 | 66 | nsresult NS_CreateNativeAppSupport(nsINativeAppSupport* *aResult); |
michael@0 | 67 | |
michael@0 | 68 | NS_HIDDEN_(nsresult) |
michael@0 | 69 | NS_NewToolkitProfileService(nsIToolkitProfileService* *aResult); |
michael@0 | 70 | |
michael@0 | 71 | NS_HIDDEN_(nsresult) |
michael@0 | 72 | NS_NewToolkitProfileFactory(nsIFactory* *aResult); |
michael@0 | 73 | |
michael@0 | 74 | /** |
michael@0 | 75 | * Try to acquire exclusive access to the specified profile directory. |
michael@0 | 76 | * |
michael@0 | 77 | * @param aPath |
michael@0 | 78 | * The profile directory to lock. |
michael@0 | 79 | * @param aTempPath |
michael@0 | 80 | * The corresponding profile temporary directory. |
michael@0 | 81 | * @param aUnlocker |
michael@0 | 82 | * A callback interface used to attempt to unlock a profile that |
michael@0 | 83 | * appears to be locked. |
michael@0 | 84 | * @param aResult |
michael@0 | 85 | * The resulting profile lock object (or null if the profile could |
michael@0 | 86 | * not be locked). |
michael@0 | 87 | * |
michael@0 | 88 | * @return NS_ERROR_FILE_ACCESS_DENIED to indicate that the profile |
michael@0 | 89 | * directory cannot be unlocked. |
michael@0 | 90 | */ |
michael@0 | 91 | NS_HIDDEN_(nsresult) |
michael@0 | 92 | NS_LockProfilePath(nsIFile* aPath, nsIFile* aTempPath, |
michael@0 | 93 | nsIProfileUnlocker* *aUnlocker, nsIProfileLock* *aResult); |
michael@0 | 94 | |
michael@0 | 95 | NS_HIDDEN_(void) |
michael@0 | 96 | WriteConsoleLog(); |
michael@0 | 97 | |
michael@0 | 98 | #ifdef XP_WIN |
michael@0 | 99 | BOOL |
michael@0 | 100 | WinLaunchChild(const wchar_t *exePath, int argc, |
michael@0 | 101 | char **argv, HANDLE userToken = nullptr, |
michael@0 | 102 | HANDLE *hProcess = nullptr); |
michael@0 | 103 | BOOL |
michael@0 | 104 | WriteStatusPending(LPCWSTR updateDirPath); |
michael@0 | 105 | BOOL |
michael@0 | 106 | WriteStatusApplied(LPCWSTR updateDirPath); |
michael@0 | 107 | #endif |
michael@0 | 108 | |
michael@0 | 109 | #define NS_NATIVEAPPSUPPORT_CONTRACTID "@mozilla.org/toolkit/native-app-support;1" |
michael@0 | 110 | |
michael@0 | 111 | namespace mozilla { |
michael@0 | 112 | namespace startup { |
michael@0 | 113 | extern GeckoProcessType sChildProcessType; |
michael@0 | 114 | } |
michael@0 | 115 | } |
michael@0 | 116 | |
michael@0 | 117 | /** |
michael@0 | 118 | * Set up platform specific error handling such as suppressing DLL load dialog |
michael@0 | 119 | * and the JIT debugger on Windows, and install unix signal handlers. |
michael@0 | 120 | */ |
michael@0 | 121 | void SetupErrorHandling(const char* progname); |
michael@0 | 122 | |
michael@0 | 123 | #endif // nsAppRunner_h__ |