2004-06-18 01:23:51 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04: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-18 01:23:51 +04:00
|
|
|
|
|
|
|
#ifndef nsAppRunner_h__
|
|
|
|
#define nsAppRunner_h__
|
2005-08-31 21:50:32 +04:00
|
|
|
|
|
|
|
#ifdef XP_WIN
|
|
|
|
#include <windows.h>
|
2008-10-21 07:55:57 +04:00
|
|
|
#else
|
|
|
|
#include <limits.h>
|
2005-08-31 21:50:32 +04:00
|
|
|
#endif
|
|
|
|
|
2004-06-18 01:23:51 +04:00
|
|
|
#ifndef MAXPATHLEN
|
2008-10-21 07:55:57 +04:00
|
|
|
#ifdef PATH_MAX
|
|
|
|
#define MAXPATHLEN PATH_MAX
|
|
|
|
#elif defined(_MAX_PATH)
|
2004-06-18 01:23:51 +04:00
|
|
|
#define MAXPATHLEN _MAX_PATH
|
|
|
|
#elif defined(CCHMAXPATH)
|
|
|
|
#define MAXPATHLEN CCHMAXPATH
|
|
|
|
#else
|
|
|
|
#define MAXPATHLEN 1024
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "nscore.h"
|
2006-08-17 18:22:04 +04:00
|
|
|
#include "nsXULAppAPI.h"
|
2004-06-18 01:23:51 +04:00
|
|
|
|
2005-09-07 21:31:00 +04:00
|
|
|
// This directory service key is a lot like NS_APP_LOCALSTORE_50_FILE,
|
|
|
|
// but it is always the "main" localstore file, even when we're in safe mode
|
|
|
|
// and we load localstore from somewhere else.
|
|
|
|
#define NS_LOCALSTORE_UNSAFE_FILE "LStoreS"
|
|
|
|
|
2004-06-18 01:23:51 +04:00
|
|
|
class nsACString;
|
2005-07-21 17:33:43 +04:00
|
|
|
struct nsStaticModuleInfo;
|
2004-06-18 01:23:51 +04:00
|
|
|
|
|
|
|
class nsINativeAppSupport;
|
|
|
|
class nsICmdLineService;
|
|
|
|
class nsXREDirProvider;
|
|
|
|
class nsIToolkitProfileService;
|
2012-06-06 06:08:30 +04:00
|
|
|
class nsIFile;
|
2004-06-18 01:23:51 +04:00
|
|
|
class nsIProfileLock;
|
2005-03-15 23:01:12 +03:00
|
|
|
class nsIProfileUnlocker;
|
2007-08-09 22:55:21 +04:00
|
|
|
class nsIFactory;
|
2004-06-18 01:23:51 +04:00
|
|
|
|
|
|
|
extern nsXREDirProvider* gDirServiceProvider;
|
2006-08-17 18:22:04 +04:00
|
|
|
|
|
|
|
// NOTE: gAppData will be null in embedded contexts. The "size" parameter
|
|
|
|
// will be the size of the original structure passed to XRE_main, but the
|
|
|
|
// structure will have all of the members available.
|
2004-06-18 01:23:51 +04:00
|
|
|
extern const nsXREAppData* gAppData;
|
2011-09-29 10:19:26 +04:00
|
|
|
extern bool gSafeMode;
|
2004-06-18 01:23:51 +04:00
|
|
|
|
|
|
|
extern int gArgc;
|
|
|
|
extern char **gArgv;
|
2012-05-22 18:50:04 +04:00
|
|
|
extern int gRestartArgc;
|
|
|
|
extern char **gRestartArgv;
|
2011-09-29 10:19:26 +04:00
|
|
|
extern bool gLogConsoleErrors;
|
2004-06-18 01:23:51 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Create the nativeappsupport implementation.
|
|
|
|
*
|
|
|
|
* @note XPCOMInit has not happened yet.
|
|
|
|
*/
|
|
|
|
nsresult NS_CreateNativeAppSupport(nsINativeAppSupport* *aResult);
|
|
|
|
|
2014-06-02 16:08:21 +04:00
|
|
|
nsresult
|
2004-06-18 01:23:51 +04:00
|
|
|
NS_NewToolkitProfileService(nsIToolkitProfileService* *aResult);
|
|
|
|
|
2014-06-02 16:08:21 +04:00
|
|
|
nsresult
|
2007-08-09 22:55:21 +04:00
|
|
|
NS_NewToolkitProfileFactory(nsIFactory* *aResult);
|
|
|
|
|
2005-04-26 04:37:23 +04: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 16:08:21 +04:00
|
|
|
nsresult
|
2012-06-06 06:08:30 +04:00
|
|
|
NS_LockProfilePath(nsIFile* aPath, nsIFile* aTempPath,
|
2005-04-26 04:37:23 +04:00
|
|
|
nsIProfileUnlocker* *aUnlocker, nsIProfileLock* *aResult);
|
2004-06-18 01:23:51 +04:00
|
|
|
|
2014-06-02 16:08:21 +04:00
|
|
|
void
|
2005-06-07 23:28:23 +04:00
|
|
|
WriteConsoleLog();
|
|
|
|
|
2005-08-31 21:50:32 +04:00
|
|
|
#ifdef XP_WIN
|
|
|
|
BOOL
|
2013-12-03 19:07:22 +04:00
|
|
|
WinLaunchChild(const wchar_t *exePath, int argc,
|
2013-10-11 00:36:42 +04:00
|
|
|
char **argv, HANDLE userToken = nullptr,
|
2012-07-30 18:20:58 +04:00
|
|
|
HANDLE *hProcess = nullptr);
|
2012-05-22 18:50:04 +04:00
|
|
|
BOOL
|
|
|
|
WriteStatusPending(LPCWSTR updateDirPath);
|
|
|
|
BOOL
|
|
|
|
WriteStatusApplied(LPCWSTR updateDirPath);
|
2005-08-31 21:50:32 +04:00
|
|
|
#endif
|
|
|
|
|
2004-11-08 08:00:27 +03:00
|
|
|
#define NS_NATIVEAPPSUPPORT_CONTRACTID "@mozilla.org/toolkit/native-app-support;1"
|
|
|
|
|
2009-12-15 01:13:00 +03:00
|
|
|
namespace mozilla {
|
|
|
|
namespace startup {
|
|
|
|
extern GeckoProcessType sChildProcessType;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-12-19 00:16:38 +03: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-19 01:14:53 +03:00
|
|
|
void SetupErrorHandling(const char* progname);
|
2009-12-19 00:16:38 +03:00
|
|
|
|
2004-06-18 01:23:51 +04:00
|
|
|
#endif // nsAppRunner_h__
|