Backed out changeset c15814d1ec25 (bug 939318)

This commit is contained in:
Ed Morley 2014-09-24 16:17:18 +01:00
parent ca18436281
commit 2a563b594e

View File

@ -37,7 +37,6 @@
#include "nsPIDNSService.h"
#include "nsIProtocolProxyService2.h"
#include "MainThreadUtils.h"
#include "nsIWidget.h"
#if defined(XP_WIN)
#include "nsNativeConnectionHelper.h"
@ -200,7 +199,6 @@ nsIOService::Init()
observerService->AddObserver(this, kProfileDoChange, true);
observerService->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, true);
observerService->AddObserver(this, NS_NETWORK_LINK_TOPIC, true);
observerService->AddObserver(this, NS_WIDGET_WAKE_OBSERVER_TOPIC, true);
}
else
NS_WARNING("failed to get observer service");
@ -912,12 +910,14 @@ nsIOService::Observe(nsISupports *subject,
nsCOMPtr<nsIPrefBranch> prefBranch = do_QueryInterface(subject);
if (prefBranch)
PrefsChanged(prefBranch, NS_ConvertUTF16toUTF8(data).get());
} else if (!strcmp(topic, kProfileChangeNetTeardownTopic)) {
}
else if (!strcmp(topic, kProfileChangeNetTeardownTopic)) {
if (!mOffline) {
mOfflineForProfileChange = true;
SetOffline(true);
}
} else if (!strcmp(topic, kProfileChangeNetRestoreTopic)) {
}
else if (!strcmp(topic, kProfileChangeNetRestoreTopic)) {
if (mOfflineForProfileChange) {
mOfflineForProfileChange = false;
if (!mManageOfflineStatus ||
@ -925,7 +925,8 @@ nsIOService::Observe(nsISupports *subject,
SetOffline(false);
}
}
} else if (!strcmp(topic, kProfileDoChange)) {
}
else if (!strcmp(topic, kProfileDoChange)) {
if (data && NS_LITERAL_STRING("startup").Equals(data)) {
// Lazy initialization of network link service (see bug 620472)
InitializeNetworkLinkService();
@ -937,7 +938,8 @@ nsIOService::Observe(nsISupports *subject,
GetPrefBranch(getter_AddRefs(prefBranch));
PrefsChanged(prefBranch, MANAGE_OFFLINE_STATUS_PREF);
}
} else if (!strcmp(topic, NS_XPCOM_SHUTDOWN_OBSERVER_ID)) {
}
else if (!strcmp(topic, NS_XPCOM_SHUTDOWN_OBSERVER_ID)) {
// Remember we passed XPCOM shutdown notification to prevent any
// changes of the offline status from now. We must not allow going
// online after this point.
@ -951,19 +953,6 @@ nsIOService::Observe(nsISupports *subject,
if (!mOfflineForProfileChange && mManageOfflineStatus) {
OnNetworkLinkEvent(NS_ConvertUTF16toUTF8(data).get());
}
} else if (!strcmp(topic, NS_WIDGET_WAKE_OBSERVER_TOPIC)) {
// coming back alive from sleep
nsCOMPtr<nsIObserverService> observerService =
mozilla::services::GetObserverService();
NS_ASSERTION(observerService, "The observer service should not be null");
if (observerService) {
(void)observerService->
NotifyObservers(nullptr,
NS_NETWORK_LINK_TOPIC,
MOZ_UTF16(NS_NETWORK_LINK_DATA_CHANGED));
}
}
return NS_OK;