зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 775de48c0e2b (bug 939318)
This commit is contained in:
Родитель
3838458451
Коммит
dca57a5741
|
@ -29,7 +29,6 @@
|
|||
#include "mozilla/Mutex.h"
|
||||
#include "mozilla/CondVar.h"
|
||||
#include "nsISystemProxySettings.h"
|
||||
#include "nsINetworkLinkService.h"
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
|
@ -415,59 +414,14 @@ nsProtocolProxyService::Init()
|
|||
PrefsChanged(prefBranch, nullptr);
|
||||
}
|
||||
|
||||
// register for shutdown notification so we can clean ourselves up properly.
|
||||
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
|
||||
if (obs) {
|
||||
// register for shutdown notification so we can clean ourselves up
|
||||
// properly.
|
||||
if (obs)
|
||||
obs->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false);
|
||||
|
||||
obs->AddObserver(this, NS_NETWORK_LINK_TOPIC, false);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// ReloadNetworkPAC() checks if there's a non-networked PAC in use then avoids
|
||||
// to call ReloadPAC()
|
||||
nsresult
|
||||
nsProtocolProxyService::ReloadNetworkPAC()
|
||||
{
|
||||
nsCOMPtr<nsIPrefBranch> prefs =
|
||||
do_GetService(NS_PREFSERVICE_CONTRACTID);
|
||||
if (!prefs) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
int32_t type;
|
||||
nsresult rv = prefs->GetIntPref(PROXY_PREF("type"), &type);
|
||||
if (NS_FAILED(rv)) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (type == PROXYCONFIG_PAC) {
|
||||
nsXPIDLCString pacSpec;
|
||||
prefs->GetCharPref(PROXY_PREF("autoconfig_url"),
|
||||
getter_Copies(pacSpec));
|
||||
if (!pacSpec.IsEmpty()) {
|
||||
nsCOMPtr<nsIURI> pacURI;
|
||||
NS_NewURI(getter_AddRefs(pacURI), pacSpec);
|
||||
nsProtocolInfo pac;
|
||||
GetProtocolInfo(pacURI, &pac);
|
||||
|
||||
if (!pac.scheme.EqualsLiteral("file") &&
|
||||
!pac.scheme.EqualsLiteral("data")) {
|
||||
LOG((": received network changed event, reload PAC"));
|
||||
ReloadPAC();
|
||||
}
|
||||
}
|
||||
} else if ((type == PROXYCONFIG_WPAD) || (type == PROXYCONFIG_SYSTEM)) {
|
||||
ReloadPAC();
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsProtocolProxyService::Observe(nsISupports *aSubject,
|
||||
const char *aTopic,
|
||||
|
@ -486,12 +440,6 @@ nsProtocolProxyService::Observe(nsISupports *aSubject,
|
|||
mPACMan->Shutdown();
|
||||
mPACMan = nullptr;
|
||||
}
|
||||
} else if (strcmp(aTopic, NS_NETWORK_LINK_TOPIC) == 0) {
|
||||
nsCString converted = NS_ConvertUTF16toUTF8(aData);
|
||||
const char *state = converted.get();
|
||||
if (!strcmp(state, NS_NETWORK_LINK_DATA_CHANGED)) {
|
||||
ReloadNetworkPAC();
|
||||
}
|
||||
}
|
||||
else {
|
||||
NS_ASSERTION(strcmp(aTopic, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID) == 0,
|
||||
|
|
|
@ -280,7 +280,6 @@ protected:
|
|||
private:
|
||||
nsresult SetupPACThread();
|
||||
nsresult ResetPACThread();
|
||||
nsresult ReloadNetworkPAC();
|
||||
|
||||
public:
|
||||
// The Sun Forte compiler and others implement older versions of the
|
||||
|
|
Загрузка…
Ссылка в новой задаче