backing out changeset b8d97566aa8a (bug 621386) for causing xpcshell orange. a=backout

This commit is contained in:
Jonathan Kew 2011-01-28 11:26:37 +00:00
Родитель 863e2174c4
Коммит 3d97b38039
2 изменённых файлов: 13 добавлений и 27 удалений

Просмотреть файл

@ -165,7 +165,8 @@ ContentParent::ActorDestroy(ActorDestroyReason why)
kungFuDeathGrip(static_cast<nsIThreadObserver*>(this));
nsCOMPtr<nsIObserverService>
obs(do_GetService("@mozilla.org/observer-service;1"));
Cleanup();
if (obs)
obs->RemoveObserver(static_cast<nsIObserver*>(this), "xpcom-shutdown");
nsCOMPtr<nsIThreadInternal>
threadInt(do_QueryInterface(NS_GetCurrentThread()));
if (threadInt)
@ -340,36 +341,23 @@ NS_IMPL_THREADSAFE_ISUPPORTS3(ContentParent,
nsIThreadObserver,
nsIDOMGeoPositionCallback)
void
ContentParent::Cleanup()
{
// remove the global remote preferences observers
nsCOMPtr<nsIPrefBranch2> prefs
(do_GetService(NS_PREFSERVICE_CONTRACTID));
if (prefs) {
prefs->RemoveObserver("", this);
}
nsCOMPtr<nsIObserverService>
obs(do_GetService("@mozilla.org/observer-service;1"));
if (obs) {
obs->RemoveObserver(static_cast<nsIObserver*>(this), "xpcom-shutdown");
obs->RemoveObserver(static_cast<nsIObserver*>(this), "memory-pressure");
obs->RemoveObserver(static_cast<nsIObserver*>(this),
NS_IPC_IOSERVICE_SET_OFFLINE_TOPIC);
}
RecvRemoveGeolocationListener();
RecvRemoveAccelerometerListener();
}
NS_IMETHODIMP
ContentParent::Observe(nsISupports* aSubject,
const char* aTopic,
const PRUnichar* aData)
{
if (!strcmp(aTopic, "xpcom-shutdown") && mSubprocess) {
Cleanup();
// remove the global remote preferences observers
nsCOMPtr<nsIPrefBranch2> prefs
(do_GetService(NS_PREFSERVICE_CONTRACTID));
if (prefs) {
if (gSingleton) {
prefs->RemoveObserver("", this);
}
}
RecvRemoveGeolocationListener();
Close();
NS_ASSERTION(!mSubprocess, "Close should have nulled mSubprocess");
}

Просмотреть файл

@ -105,8 +105,6 @@ protected:
private:
static ContentParent* gSingleton;
void Cleanup();
// Hide the raw constructor methods since we don't want client code
// using them.
using PContentParent::SendPBrowserConstructor;