2004-06-17 21:23:51 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2004-06-17 21:23:51 +00:00
|
|
|
|
|
|
|
#ifndef nsAppRunner_h__
|
|
|
|
#define nsAppRunner_h__
|
2005-08-31 17:50:32 +00:00
|
|
|
|
|
|
|
#ifdef XP_WIN
|
|
|
|
#include <windows.h>
|
2008-10-21 03:55:57 +00:00
|
|
|
#else
|
|
|
|
#include <limits.h>
|
2005-08-31 17:50:32 +00:00
|
|
|
#endif
|
|
|
|
|
2004-06-17 21:23:51 +00:00
|
|
|
#ifndef MAXPATHLEN
|
2008-10-21 03:55:57 +00:00
|
|
|
#ifdef PATH_MAX
|
|
|
|
#define MAXPATHLEN PATH_MAX
|
|
|
|
#elif defined(_MAX_PATH)
|
2004-06-17 21:23:51 +00:00
|
|
|
#define MAXPATHLEN _MAX_PATH
|
|
|
|
#elif defined(CCHMAXPATH)
|
|
|
|
#define MAXPATHLEN CCHMAXPATH
|
|
|
|
#else
|
|
|
|
#define MAXPATHLEN 1024
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2017-08-16 23:48:52 +00:00
|
|
|
#include "nsStringFwd.h"
|
2006-08-17 14:22:04 +00:00
|
|
|
#include "nsXULAppAPI.h"
|
2004-06-17 21:23:51 +00:00
|
|
|
|
|
|
|
class nsINativeAppSupport;
|
|
|
|
class nsXREDirProvider;
|
|
|
|
class nsIToolkitProfileService;
|
2012-06-06 02:08:30 +00:00
|
|
|
class nsIFile;
|
2004-06-17 21:23:51 +00:00
|
|
|
class nsIProfileLock;
|
2005-03-15 20:01:12 +00:00
|
|
|
class nsIProfileUnlocker;
|
2007-08-09 18:55:21 +00:00
|
|
|
class nsIFactory;
|
2004-06-17 21:23:51 +00:00
|
|
|
|
|
|
|
extern nsXREDirProvider* gDirServiceProvider;
|
2006-08-17 14:22:04 +00:00
|
|
|
|
2016-12-02 14:07:24 +00:00
|
|
|
// NOTE: gAppData will be null in embedded contexts.
|
|
|
|
extern const mozilla::XREAppData* gAppData;
|
2011-09-29 06:19:26 +00:00
|
|
|
extern bool gSafeMode;
|
2004-06-17 21:23:51 +00:00
|
|
|
|
|
|
|
extern int gArgc;
|
|
|
|
extern char **gArgv;
|
2012-05-22 14:50:04 +00:00
|
|
|
extern int gRestartArgc;
|
|
|
|
extern char **gRestartArgv;
|
2018-05-27 19:22:05 +00:00
|
|
|
extern bool gRestartedByOS;
|
2011-09-29 06:19:26 +00:00
|
|
|
extern bool gLogConsoleErrors;
|
2016-04-19 10:00:59 +00:00
|
|
|
extern nsString gAbsoluteArgv0Path;
|
2004-06-17 21:23:51 +00:00
|
|
|
|
2015-01-14 22:24:09 +00:00
|
|
|
extern bool gIsGtest;
|
|
|
|
|
2004-06-17 21:23:51 +00:00
|
|
|
/**
|
|
|
|
* Create the nativeappsupport implementation.
|
|
|
|
*
|
|
|
|
* @note XPCOMInit has not happened yet.
|
|
|
|
*/
|
|
|
|
nsresult NS_CreateNativeAppSupport(nsINativeAppSupport* *aResult);
|
2018-09-15 17:17:11 +00:00
|
|
|
already_AddRefed<nsINativeAppSupport> NS_GetNativeAppSupport();
|
2004-06-17 21:23:51 +00:00
|
|
|
|
2014-06-02 12:08:21 +00:00
|
|
|
nsresult
|
2004-06-17 21:23:51 +00:00
|
|
|
NS_NewToolkitProfileService(nsIToolkitProfileService* *aResult);
|
|
|
|
|
2014-06-02 12:08:21 +00:00
|
|
|
nsresult
|
2007-08-09 18:55:21 +00:00
|
|
|
NS_NewToolkitProfileFactory(nsIFactory* *aResult);
|
|
|
|
|
2005-04-26 00:37:23 +00:00
|
|
|
/**
|
|
|
|
* Try to acquire exclusive access to the specified profile directory.
|
|
|
|
*
|
|
|
|
* @param aPath
|
|
|
|
* The profile directory to lock.
|
|
|
|
* @param aTempPath
|
|
|
|
* The corresponding profile temporary directory.
|
|
|
|
* @param aUnlocker
|
|
|
|
* A callback interface used to attempt to unlock a profile that
|
|
|
|
* appears to be locked.
|
|
|
|
* @param aResult
|
|
|
|
* The resulting profile lock object (or null if the profile could
|
|
|
|
* not be locked).
|
|
|
|
*
|
|
|
|
* @return NS_ERROR_FILE_ACCESS_DENIED to indicate that the profile
|
|
|
|
* directory cannot be unlocked.
|
|
|
|
*/
|
2014-06-02 12:08:21 +00:00
|
|
|
nsresult
|
2012-06-06 02:08:30 +00:00
|
|
|
NS_LockProfilePath(nsIFile* aPath, nsIFile* aTempPath,
|
2005-04-26 00:37:23 +00:00
|
|
|
nsIProfileUnlocker* *aUnlocker, nsIProfileLock* *aResult);
|
2004-06-17 21:23:51 +00:00
|
|
|
|
2014-06-02 12:08:21 +00:00
|
|
|
void
|
2005-06-07 19:28:23 +00:00
|
|
|
WriteConsoleLog();
|
|
|
|
|
2015-12-29 12:56:00 +00:00
|
|
|
void
|
|
|
|
OverrideDefaultLocaleIfNeeded();
|
|
|
|
|
2016-06-07 19:58:14 +00:00
|
|
|
/**
|
|
|
|
* Allow exit() calls to complete. This should be done from a proper Gecko
|
|
|
|
* shutdown path. Otherwise we aim to catch improper shutdowns.
|
|
|
|
*/
|
|
|
|
void
|
|
|
|
MozExpectedExit();
|
|
|
|
|
2005-08-31 17:50:32 +00:00
|
|
|
#ifdef XP_WIN
|
2014-11-03 13:22:39 +00:00
|
|
|
void
|
|
|
|
UseParentConsole();
|
|
|
|
|
2005-08-31 17:50:32 +00:00
|
|
|
BOOL
|
2013-12-03 15:07:22 +00:00
|
|
|
WinLaunchChild(const wchar_t *exePath, int argc,
|
2013-10-10 20:36:42 +00:00
|
|
|
char **argv, HANDLE userToken = nullptr,
|
2012-07-30 14:20:58 +00:00
|
|
|
HANDLE *hProcess = nullptr);
|
2018-05-15 22:37:45 +00:00
|
|
|
|
|
|
|
#define PREF_WIN_REGISTER_APPLICATION_RESTART "toolkit.winRegisterApplicationRestart"
|
2005-08-31 17:50:32 +00:00
|
|
|
#endif
|
|
|
|
|
2009-12-14 22:13:00 +00:00
|
|
|
namespace mozilla {
|
|
|
|
namespace startup {
|
2018-03-05 23:19:07 +00:00
|
|
|
Result<nsCOMPtr<nsIFile>, nsresult> GetIncompleteStartupFile(nsIFile* aProfLD);
|
|
|
|
|
2009-12-14 22:13:00 +00:00
|
|
|
extern GeckoProcessType sChildProcessType;
|
2015-07-13 15:25:42 +00:00
|
|
|
} // namespace startup
|
2017-03-11 16:01:34 +00:00
|
|
|
|
|
|
|
const char* PlatformBuildID();
|
|
|
|
|
2015-07-13 15:25:42 +00:00
|
|
|
} // namespace mozilla
|
2009-12-14 22:13:00 +00:00
|
|
|
|
2009-12-18 21:16:38 +00:00
|
|
|
/**
|
|
|
|
* Set up platform specific error handling such as suppressing DLL load dialog
|
|
|
|
* and the JIT debugger on Windows, and install unix signal handlers.
|
|
|
|
*/
|
2009-12-18 22:14:53 +00:00
|
|
|
void SetupErrorHandling(const char* progname);
|
2009-12-18 21:16:38 +00:00
|
|
|
|
2018-06-27 09:19:00 +00:00
|
|
|
|
|
|
|
#ifdef MOZ_ASAN_REPORTER
|
|
|
|
extern "C" {
|
|
|
|
void MOZ_EXPORT __sanitizer_set_report_path(const char *path);
|
|
|
|
}
|
|
|
|
void setASanReporterPath(nsIFile* aDir);
|
|
|
|
|
|
|
|
already_AddRefed<nsIFile> GetFileFromEnv(const char *name);
|
|
|
|
#endif
|
|
|
|
|
2004-06-17 21:23:51 +00:00
|
|
|
#endif // nsAppRunner_h__
|