2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07: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/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#ifndef nsAppRunner_h__
|
|
|
|
#define nsAppRunner_h__
|
|
|
|
|
|
|
|
#ifdef XP_WIN
|
|
|
|
#include <windows.h>
|
2008-10-20 20:55:57 -07:00
|
|
|
#else
|
|
|
|
#include <limits.h>
|
2007-03-22 10:30:00 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef MAXPATHLEN
|
2008-10-20 20:55:57 -07:00
|
|
|
#ifdef PATH_MAX
|
|
|
|
#define MAXPATHLEN PATH_MAX
|
|
|
|
#elif defined(_MAX_PATH)
|
2007-03-22 10:30:00 -07:00
|
|
|
#define MAXPATHLEN _MAX_PATH
|
|
|
|
#elif defined(CCHMAXPATH)
|
|
|
|
#define MAXPATHLEN CCHMAXPATH
|
|
|
|
#else
|
|
|
|
#define MAXPATHLEN 1024
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "nscore.h"
|
|
|
|
#include "nsXULAppAPI.h"
|
|
|
|
|
|
|
|
// 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"
|
|
|
|
|
|
|
|
class nsACString;
|
|
|
|
struct nsStaticModuleInfo;
|
|
|
|
|
|
|
|
class nsINativeAppSupport;
|
|
|
|
class nsICmdLineService;
|
|
|
|
class nsXREDirProvider;
|
|
|
|
class nsIToolkitProfileService;
|
2012-06-05 19:08:30 -07:00
|
|
|
class nsIFile;
|
2007-03-22 10:30:00 -07:00
|
|
|
class nsIProfileLock;
|
|
|
|
class nsIProfileUnlocker;
|
2007-08-09 11:55:21 -07:00
|
|
|
class nsIFactory;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
extern nsXREDirProvider* gDirServiceProvider;
|
|
|
|
|
|
|
|
// 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.
|
|
|
|
extern const nsXREAppData* gAppData;
|
2011-09-28 23:19:26 -07:00
|
|
|
extern bool gSafeMode;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
extern int gArgc;
|
|
|
|
extern char **gArgv;
|
2012-05-22 07:50:04 -07:00
|
|
|
extern int gRestartArgc;
|
|
|
|
extern char **gRestartArgv;
|
2011-09-28 23:19:26 -07:00
|
|
|
extern bool gLogConsoleErrors;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Create the nativeappsupport implementation.
|
|
|
|
*
|
|
|
|
* @note XPCOMInit has not happened yet.
|
|
|
|
*/
|
|
|
|
nsresult NS_CreateNativeAppSupport(nsINativeAppSupport* *aResult);
|
|
|
|
|
2014-06-02 05:08:21 -07:00
|
|
|
nsresult
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_NewToolkitProfileService(nsIToolkitProfileService* *aResult);
|
|
|
|
|
2014-06-02 05:08:21 -07:00
|
|
|
nsresult
|
2007-08-09 11:55:21 -07:00
|
|
|
NS_NewToolkitProfileFactory(nsIFactory* *aResult);
|
|
|
|
|
2007-03-22 10:30:00 -07: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 05:08:21 -07:00
|
|
|
nsresult
|
2012-06-05 19:08:30 -07:00
|
|
|
NS_LockProfilePath(nsIFile* aPath, nsIFile* aTempPath,
|
2007-03-22 10:30:00 -07:00
|
|
|
nsIProfileUnlocker* *aUnlocker, nsIProfileLock* *aResult);
|
|
|
|
|
2014-06-02 05:08:21 -07:00
|
|
|
void
|
2007-03-22 10:30:00 -07:00
|
|
|
WriteConsoleLog();
|
|
|
|
|
|
|
|
#ifdef XP_WIN
|
|
|
|
BOOL
|
2013-12-03 07:07:22 -08:00
|
|
|
WinLaunchChild(const wchar_t *exePath, int argc,
|
2013-10-10 13:36:42 -07:00
|
|
|
char **argv, HANDLE userToken = nullptr,
|
2012-07-30 07:20:58 -07:00
|
|
|
HANDLE *hProcess = nullptr);
|
2012-05-22 07:50:04 -07:00
|
|
|
BOOL
|
|
|
|
WriteStatusPending(LPCWSTR updateDirPath);
|
|
|
|
BOOL
|
|
|
|
WriteStatusApplied(LPCWSTR updateDirPath);
|
2007-03-22 10:30:00 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define NS_NATIVEAPPSUPPORT_CONTRACTID "@mozilla.org/toolkit/native-app-support;1"
|
|
|
|
|
2009-12-14 14:13:00 -08:00
|
|
|
namespace mozilla {
|
|
|
|
namespace startup {
|
|
|
|
extern GeckoProcessType sChildProcessType;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-12-18 13:16:38 -08: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 14:14:53 -08:00
|
|
|
void SetupErrorHandling(const char* progname);
|
2009-12-18 13:16:38 -08:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
#endif // nsAppRunner_h__
|