Bug 844331 - part 5 - add profile-before-change2 notification; r=bsmedberg

This commit is contained in:
Nathan Froyd 2013-03-01 15:11:21 -05:00
parent b4470eda85
commit cdcd9fd8f3
6 changed files with 6 additions and 0 deletions

View File

@ -108,6 +108,7 @@ PowerManagerService::SyncProfile()
obsServ->NotifyObservers(nullptr, "profile-change-net-teardown", context.get());
obsServ->NotifyObservers(nullptr, "profile-change-teardown", context.get());
obsServ->NotifyObservers(nullptr, "profile-before-change", context.get());
obsServ->NotifyObservers(nullptr, "profile-before-change2", context.get());
}
}

View File

@ -130,6 +130,7 @@ nsProfileDirServiceProvider::Shutdown()
NS_NAMED_LITERAL_STRING(context, "shutdown-persist");
observerService->NotifyObservers(nullptr, "profile-before-change", context.get());
observerService->NotifyObservers(nullptr, "profile-before-change2", context.get());
return NS_OK;
}

View File

@ -867,6 +867,7 @@ nsXREDirProvider::DoShutdown()
// Phase 3: Notify observers of a profile change
obsSvc->NotifyObservers(nullptr, "profile-before-change", kShutdownPersist);
obsSvc->NotifyObservers(nullptr, "profile-before-change2", kShutdownPersist);
}
mProfileNotified = false;
}

View File

@ -377,6 +377,7 @@ nsAppShell::ProcessNextNativeEvent(bool mayWait)
obsServ->NotifyObservers(nullptr, "profile-change-net-teardown", context.get());
obsServ->NotifyObservers(nullptr, "profile-change-teardown", context.get());
obsServ->NotifyObservers(nullptr, "profile-before-change", context.get());
obsServ->NotifyObservers(nullptr, "profile-before-change2", context.get());
nsCOMPtr<nsIAppStartup> appSvc = do_GetService("@mozilla.org/toolkit/app-startup;1");
if (appSvc)
appSvc->Quit(nsIAppStartup::eForceQuit);

View File

@ -4564,6 +4564,7 @@ bool nsWindow::ProcessMessage(UINT msg, WPARAM &wParam, LPARAM &lParam,
obsServ->NotifyObservers(nullptr, "profile-change-net-teardown", context.get());
obsServ->NotifyObservers(nullptr, "profile-change-teardown", context.get());
obsServ->NotifyObservers(nullptr, "profile-before-change", context.get());
obsServ->NotifyObservers(nullptr, "profile-before-change2", context.get());
// Then a controlled but very quick exit.
_exit(0);
}

View File

@ -128,6 +128,7 @@ class ScopedXPCOM : public nsIDirectoryServiceProvider2
MOZ_ALWAYS_TRUE(NS_SUCCEEDED(os->NotifyObservers(nullptr, "profile-change-net-teardown", nullptr)));
MOZ_ALWAYS_TRUE(NS_SUCCEEDED(os->NotifyObservers(nullptr, "profile-change-teardown", nullptr)));
MOZ_ALWAYS_TRUE(NS_SUCCEEDED(os->NotifyObservers(nullptr, "profile-before-change", nullptr)));
MOZ_ALWAYS_TRUE(NS_SUCCEEDED(os->NotifyObservers(nullptr, "profile-before-change2", nullptr)));
}
if (NS_FAILED(mProfD->Remove(true))) {