зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1067547 - unify ScopedLogging implementations and use in nsEmbedFunctions; r=bsmedberg
MozReview-Commit-ID: 6hDZDaBsNFM --HG-- extra : rebase_source : 9422c235ebdffd84e06137bb2c63ce106cb39f0b
This commit is contained in:
Родитель
1b3a828426
Коммит
7bc8491bea
|
@ -80,16 +80,6 @@ static bool IsArg(const char* arg, const char* s)
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* A helper class which calls NS_LogInit/NS_LogTerm in its scope.
|
||||
*/
|
||||
class ScopedLogging
|
||||
{
|
||||
public:
|
||||
ScopedLogging() { NS_LogInit(); }
|
||||
~ScopedLogging() { NS_LogTerm(); }
|
||||
};
|
||||
|
||||
XRE_GetFileFromPathType XRE_GetFileFromPath;
|
||||
XRE_CreateAppDataType XRE_CreateAppData;
|
||||
XRE_FreeAppDataType XRE_FreeAppData;
|
||||
|
|
|
@ -1557,16 +1557,6 @@ ScopedXPCOMStartup::CreateAppSupport(nsISupports* aOuter, REFNSIID aIID, void**
|
|||
|
||||
nsINativeAppSupport* ScopedXPCOMStartup::gNativeAppSupport;
|
||||
|
||||
/**
|
||||
* A helper class which calls NS_LogInit/NS_LogTerm in its scope.
|
||||
*/
|
||||
class ScopedLogging
|
||||
{
|
||||
public:
|
||||
ScopedLogging() { NS_LogInit(); }
|
||||
~ScopedLogging() { NS_LogTerm(); }
|
||||
};
|
||||
|
||||
static void DumpArbitraryHelp()
|
||||
{
|
||||
nsresult rv;
|
||||
|
|
|
@ -367,7 +367,7 @@ XRE_InitChildProcess(int aArgc,
|
|||
#endif
|
||||
|
||||
// NB: This must be called before profiler_init
|
||||
NS_LogInit();
|
||||
ScopedLogging logger;
|
||||
|
||||
// This is needed by Telemetry to initialize histogram collection.
|
||||
// NB: This must be called after NS_LogInit().
|
||||
|
@ -380,7 +380,7 @@ XRE_InitChildProcess(int aArgc,
|
|||
mozilla::LogModule::Init();
|
||||
|
||||
char aLocal;
|
||||
profiler_init(&aLocal);
|
||||
GeckoProfilerInitRAII profiler(&aLocal);
|
||||
|
||||
PROFILER_LABEL("Startup", "XRE_InitChildProcess",
|
||||
js::ProfileEntry::Category::OTHER);
|
||||
|
@ -559,8 +559,6 @@ XRE_InitChildProcess(int aArgc,
|
|||
|
||||
nsresult rv = XRE_InitCommandLine(aArgc, aArgv);
|
||||
if (NS_FAILED(rv)) {
|
||||
profiler_shutdown();
|
||||
NS_LogTerm();
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -669,8 +667,6 @@ XRE_InitChildProcess(int aArgc,
|
|||
}
|
||||
|
||||
if (!process->Init()) {
|
||||
profiler_shutdown();
|
||||
NS_LogTerm();
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -717,8 +713,6 @@ XRE_InitChildProcess(int aArgc,
|
|||
}
|
||||
|
||||
Telemetry::DestroyStatisticsRecorder();
|
||||
profiler_shutdown();
|
||||
NS_LogTerm();
|
||||
return XRE_DeinitCommandLine();
|
||||
}
|
||||
|
||||
|
|
|
@ -75,20 +75,6 @@ void passed(const char* msg, ...)
|
|||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class ScopedLogging
|
||||
{
|
||||
public:
|
||||
ScopedLogging()
|
||||
{
|
||||
NS_LogInit();
|
||||
}
|
||||
|
||||
~ScopedLogging()
|
||||
{
|
||||
NS_LogTerm();
|
||||
}
|
||||
};
|
||||
|
||||
static class ScopedXPCOM : public nsIDirectoryServiceProvider2
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -268,6 +268,27 @@ XPCOM_API(void) NS_LogInit();
|
|||
|
||||
XPCOM_API(void) NS_LogTerm();
|
||||
|
||||
#ifdef __cplusplus
|
||||
/**
|
||||
* A helper class that calls NS_LogInit in its constructor and
|
||||
* NS_LogTerm in its destructor.
|
||||
*/
|
||||
|
||||
class ScopedLogging
|
||||
{
|
||||
public:
|
||||
ScopedLogging()
|
||||
{
|
||||
NS_LogInit();
|
||||
}
|
||||
|
||||
~ScopedLogging()
|
||||
{
|
||||
NS_LogTerm();
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Log construction and destruction of objects. Processing tools can use the
|
||||
* stacktraces printed by these functions to identify objects that are being
|
||||
|
|
|
@ -73,20 +73,6 @@ void passed(const char* msg, ...)
|
|||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class ScopedLogging
|
||||
{
|
||||
public:
|
||||
ScopedLogging()
|
||||
{
|
||||
NS_LogInit();
|
||||
}
|
||||
|
||||
~ScopedLogging()
|
||||
{
|
||||
NS_LogTerm();
|
||||
}
|
||||
};
|
||||
|
||||
class ScopedXPCOM : public nsIDirectoryServiceProvider2
|
||||
{
|
||||
public:
|
||||
|
|
Загрузка…
Ссылка в новой задаче