mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-13 18:27:35 +00:00
Bug 840758 - Get the profile directory earlier. r=BenWa.
This commit is contained in:
parent
a8c1ef95ef
commit
94c8150cf2
@ -26,6 +26,7 @@ enum ShutdownChecksMode {
|
||||
};
|
||||
extern ShutdownChecksMode gShutdownChecks;
|
||||
|
||||
void InitWritePoisoning();
|
||||
void PoisonWrite();
|
||||
void DisableWritePoisoning();
|
||||
void EnableWritePoisoning();
|
||||
|
@ -41,7 +41,7 @@ std::vector<int>& getDebugFDs() {
|
||||
return *DebugFDs;
|
||||
}
|
||||
|
||||
void PoisonWriteBase()
|
||||
void InitWritePoisoning()
|
||||
{
|
||||
nsCOMPtr<nsIFile> mozFile;
|
||||
NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(mozFile));
|
||||
|
@ -44,7 +44,6 @@ public:
|
||||
};
|
||||
|
||||
bool PoisonWriteEnabled();
|
||||
void PoisonWriteBase();
|
||||
bool ValidWriteAssert(bool ok);
|
||||
void BaseCleanup();
|
||||
// This method should always be called with the debugFDs lock.
|
||||
|
@ -247,8 +247,6 @@ void PoisonWrite() {
|
||||
if (!PoisonWriteEnabled())
|
||||
return;
|
||||
|
||||
PoisonWriteBase();
|
||||
|
||||
for (int i = 0; i < NumFunctions; ++i) {
|
||||
FuncData *d = Functions[i];
|
||||
if (!d->Function)
|
||||
|
@ -48,8 +48,6 @@ void PoisonWrite() {
|
||||
if (!PoisonWriteEnabled())
|
||||
return;
|
||||
|
||||
PoisonWriteBase();
|
||||
|
||||
sNtDllInterceptor.Init("ntdll.dll");
|
||||
sNtDllInterceptor.AddHook("NtFlushBuffersFile", reinterpret_cast<intptr_t>(patched_FlushBuffersFile), reinterpret_cast<void**>(&gOriginalFlushBuffersFile));
|
||||
}
|
||||
|
@ -600,6 +600,10 @@ ShutdownXPCOM(nsIServiceManager* servMgr)
|
||||
// observers themselves might call ClearOnShutdown().
|
||||
mozilla::KillClearOnShutdown();
|
||||
|
||||
// Write poisoning needs to find the profile directory, so it has to
|
||||
// be initialized before mozilla::services::Shutdown.
|
||||
InitWritePoisoning();
|
||||
|
||||
// XPCOM is officially in shutdown mode NOW
|
||||
// Set this only after the observers have been notified as this
|
||||
// will cause servicemanager to become inaccessible.
|
||||
|
Loading…
Reference in New Issue
Block a user