зеркало из https://github.com/mozilla/gecko-dev.git
Back out for now until there's a fix.
This commit is contained in:
Родитель
28b6ad7f3d
Коммит
966edcb5c4
|
@ -104,7 +104,6 @@ XPIDLSRCS = \
|
|||
nsIStreamTransportService.idl \
|
||||
nsIStreamLoader.idl \
|
||||
nsISyncStreamListener.idl \
|
||||
nsISystemProxySettings.idl \
|
||||
nsIUnicharStreamLoader.idl \
|
||||
nsIStandardURL.idl \
|
||||
nsINestedURI.idl \
|
||||
|
|
|
@ -128,14 +128,6 @@ public:
|
|||
*/
|
||||
PRBool IsLoading() { return mLoader != nsnull; }
|
||||
|
||||
/**
|
||||
* Returns true if the given URI matches the URI of our PAC file.
|
||||
*/
|
||||
PRBool IsPACURI(nsIURI *uri) {
|
||||
PRBool result;
|
||||
return mPACURI && NS_SUCCEEDED(mPACURI->Equals(uri, &result)) && result;
|
||||
}
|
||||
|
||||
private:
|
||||
NS_DECL_NSISTREAMLOADEROBSERVER
|
||||
NS_DECL_NSIINTERFACEREQUESTOR
|
||||
|
@ -170,6 +162,14 @@ private:
|
|||
*/
|
||||
void OnLoadFailure();
|
||||
|
||||
/**
|
||||
* Returns true if the given URI matches the URI of our PAC file.
|
||||
*/
|
||||
PRBool IsPACURI(nsIURI *uri) {
|
||||
PRBool result;
|
||||
return mPACURI && NS_SUCCEEDED(mPACURI->Equals(uri, &result)) && result;
|
||||
}
|
||||
|
||||
private:
|
||||
nsCOMPtr<nsIProxyAutoConfig> mPAC;
|
||||
nsCOMPtr<nsIURI> mPACURI;
|
||||
|
|
|
@ -404,12 +404,6 @@ nsProtocolProxyService::PrefsChanged(nsIPrefBranch *prefBranch,
|
|||
mProxyConfig = static_cast<ProxyConfig>(type);
|
||||
reloadPAC = PR_TRUE;
|
||||
}
|
||||
|
||||
if (mProxyConfig == eProxyConfig_System) {
|
||||
mSystemProxySettings = do_GetService(NS_SYSTEMPROXYSETTINGS_CONTRACTID);
|
||||
} else {
|
||||
mSystemProxySettings = nsnull;
|
||||
}
|
||||
}
|
||||
|
||||
if (!pref || !strcmp(pref, PROXY_PREF("http")))
|
||||
|
@ -467,10 +461,8 @@ nsProtocolProxyService::PrefsChanged(nsIPrefBranch *prefBranch,
|
|||
LoadHostFilters(tempString.get());
|
||||
}
|
||||
|
||||
// We're done if not using something that could give us a PAC URL
|
||||
// (PAC, WPAD or System)
|
||||
if (mProxyConfig != eProxyConfig_PAC && mProxyConfig != eProxyConfig_WPAD &&
|
||||
mProxyConfig != eProxyConfig_System)
|
||||
// We're done if not using PAC or WPAD
|
||||
if (mProxyConfig != eProxyConfig_PAC && mProxyConfig != eProxyConfig_WPAD)
|
||||
return;
|
||||
|
||||
// OK, we need to reload the PAC file if:
|
||||
|
@ -485,19 +477,16 @@ nsProtocolProxyService::PrefsChanged(nsIPrefBranch *prefBranch,
|
|||
if (mProxyConfig == eProxyConfig_PAC) {
|
||||
prefBranch->GetCharPref(PROXY_PREF("autoconfig_url"),
|
||||
getter_Copies(tempString));
|
||||
} else {
|
||||
}
|
||||
else if (mProxyConfig == eProxyConfig_WPAD) {
|
||||
// We diverge from the WPAD spec here in that we don't walk the
|
||||
// hosts's FQDN, stripping components until we hit a TLD. Doing so
|
||||
// is dangerous in the face of an incomplete list of TLDs, and TLDs
|
||||
// get added over time. We could consider doing only a single
|
||||
// substitution of the first component, if that proves to help
|
||||
// compatibility.
|
||||
if (mSystemProxySettings)
|
||||
mSystemProxySettings->GetPACURI(tempString);
|
||||
else
|
||||
tempString.AssignLiteral(WPAD_URL);
|
||||
}
|
||||
if (!tempString.IsEmpty())
|
||||
ConfigureFromPAC(tempString);
|
||||
}
|
||||
}
|
||||
|
@ -766,16 +755,13 @@ nsProtocolProxyService::ConfigureFromPAC(const nsCString &spec)
|
|||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
mFailedProxies.Clear();
|
||||
|
||||
nsCOMPtr<nsIURI> pacURI;
|
||||
nsresult rv = NS_NewURI(getter_AddRefs(pacURI), spec);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
if (mPACMan->IsPACURI(pacURI))
|
||||
return NS_OK;
|
||||
|
||||
mFailedProxies.Clear();
|
||||
|
||||
return mPACMan->LoadPACFromURI(pacURI);
|
||||
}
|
||||
|
||||
|
@ -950,10 +936,8 @@ nsProtocolProxyService::GetFailoverForProxy(nsIProxyInfo *aProxy,
|
|||
nsresult aStatus,
|
||||
nsIProxyInfo **aResult)
|
||||
{
|
||||
// We only support failover when a PAC file is configured, either
|
||||
// directly or via system settings
|
||||
if (mProxyConfig != eProxyConfig_PAC && mProxyConfig != eProxyConfig_WPAD &&
|
||||
mProxyConfig != eProxyConfig_System)
|
||||
// We only support failover when a PAC file is configured.
|
||||
if (mProxyConfig != eProxyConfig_PAC && mProxyConfig != eProxyConfig_WPAD)
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
|
||||
// Verify that |aProxy| is one of our nsProxyInfo objects.
|
||||
|
@ -1250,27 +1234,6 @@ nsProtocolProxyService::Resolve_Internal(nsIURI *uri,
|
|||
if (!(info.flags & nsIProtocolHandler::ALLOWS_PROXY))
|
||||
return NS_OK; // Can't proxy this (filters may not override)
|
||||
|
||||
if (mSystemProxySettings) {
|
||||
nsCAutoString PACURI;
|
||||
if (NS_SUCCEEDED(mSystemProxySettings->GetPACURI(PACURI)) &&
|
||||
!PACURI.IsEmpty()) {
|
||||
// Switch to new PAC file if that setting has changed. If the setting
|
||||
// hasn't changed, ConfigureFromPAC will exit early.
|
||||
nsresult rv = ConfigureFromPAC(PACURI);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
} else {
|
||||
nsCAutoString proxy;
|
||||
nsresult rv = mSystemProxySettings->GetProxyForURI(uri, proxy);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
ProcessPACString(proxy, result);
|
||||
return NS_OK;
|
||||
}
|
||||
// no proxy, stop search
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
// if proxies are enabled and this host:port combo is supposed to use a
|
||||
// proxy, check for a proxy.
|
||||
if (mProxyConfig == eProxyConfig_Direct ||
|
||||
|
@ -1279,8 +1242,7 @@ nsProtocolProxyService::Resolve_Internal(nsIURI *uri,
|
|||
return NS_OK;
|
||||
|
||||
// Proxy auto config magic...
|
||||
if (mProxyConfig == eProxyConfig_PAC || mProxyConfig == eProxyConfig_WPAD ||
|
||||
mProxyConfig == eProxyConfig_System) {
|
||||
if (mProxyConfig == eProxyConfig_PAC || mProxyConfig == eProxyConfig_WPAD) {
|
||||
// Do not query PAC now.
|
||||
*usePAC = PR_TRUE;
|
||||
return NS_OK;
|
||||
|
|
|
@ -47,7 +47,6 @@
|
|||
#include "nsIProtocolProxyService2.h"
|
||||
#include "nsIProtocolProxyFilter.h"
|
||||
#include "nsIProxyAutoConfig.h"
|
||||
#include "nsISystemProxySettings.h"
|
||||
#include "nsIProxyInfo.h"
|
||||
#include "nsIObserver.h"
|
||||
#include "nsDataHashtable.h"
|
||||
|
@ -316,7 +315,6 @@ protected:
|
|||
eProxyConfig_PAC,
|
||||
eProxyConfig_Direct4x,
|
||||
eProxyConfig_WPAD,
|
||||
eProxyConfig_System, // use system proxy settings if available, otherwise DIRECT
|
||||
eProxyConfig_Last
|
||||
};
|
||||
|
||||
|
@ -378,7 +376,6 @@ protected:
|
|||
PRBool mSOCKSProxyRemoteDNS;
|
||||
|
||||
nsRefPtr<nsPACMan> mPACMan; // non-null if we are using PAC
|
||||
nsCOMPtr<nsISystemProxySettings> mSystemProxySettings;
|
||||
|
||||
PRTime mSessionStart;
|
||||
nsFailedProxyTable mFailedProxies;
|
||||
|
|
|
@ -326,10 +326,6 @@
|
|||
#define NS_INCREMENTALDOWNLOAD_CONTRACTID \
|
||||
"@mozilla.org/network/incremental-download;1"
|
||||
|
||||
// component implementing nsISystemProxySettings.
|
||||
#define NS_SYSTEMPROXYSETTINGS_CONTRACTID \
|
||||
"@mozilla.org/system-proxy-settings;1"
|
||||
|
||||
// service implementing nsIStreamTransportService
|
||||
#define NS_STREAMTRANSPORTSERVICE_CLASSNAME \
|
||||
"nsStreamTransportService"
|
||||
|
|
|
@ -51,10 +51,6 @@ DIRS = \
|
|||
themes \
|
||||
$(NULL)
|
||||
|
||||
ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT)))
|
||||
DIRS += system/unixproxy
|
||||
endif
|
||||
|
||||
ifdef MOZ_CRASHREPORTER
|
||||
DIRS += crashreporter
|
||||
endif
|
||||
|
|
|
@ -147,14 +147,6 @@ COMPONENT_LIBS += \
|
|||
$(NULL)
|
||||
endif
|
||||
|
||||
ifdef MOZ_XUL
|
||||
ifdef MOZ_ENABLE_GTK2
|
||||
COMPONENT_LIBS += \
|
||||
unixproxy \
|
||||
$(NULL)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef MOZ_PERF_METRICS
|
||||
EXTRA_DSO_LIBS += mozutil_s
|
||||
endif
|
||||
|
|
|
@ -262,15 +262,6 @@
|
|||
#define XMLEXTRAS_MODULE
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
#ifdef MOZ_ENABLE_GTK2
|
||||
#define UNIXPROXY_MODULE MODULE(nsUnixProxyModule)
|
||||
#endif
|
||||
#endif
|
||||
#ifndef UNIXPROXY_MODULE
|
||||
#define UNIXPROXY_MODULE
|
||||
#endif
|
||||
|
||||
#define XUL_MODULES \
|
||||
MODULE(xpconnect) \
|
||||
MATHML_MODULES \
|
||||
|
@ -322,7 +313,6 @@
|
|||
SPELLCHECK_MODULE \
|
||||
XMLEXTRAS_MODULE \
|
||||
LAYOUT_DEBUG_MODULE \
|
||||
UNIXPROXY_MODULE \
|
||||
/* end of list */
|
||||
|
||||
#define MODULE(_name) \
|
||||
|
|
|
@ -38,10 +38,6 @@
|
|||
|
||||
#include "nsGConfService.h"
|
||||
#include "nsStringAPI.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsComponentManagerUtils.h"
|
||||
#include "nsISupportsPrimitives.h"
|
||||
#include "nsIMutableArray.h"
|
||||
|
||||
#include <gconf/gconf-client.h>
|
||||
|
||||
|
@ -127,37 +123,6 @@ nsGConfService::GetFloat(const nsACString &aKey, float* aResult)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsGConfService::GetStringList(const nsACString &aKey, nsIArray** aResult)
|
||||
{
|
||||
nsCOMPtr<nsIMutableArray> items(do_CreateInstance(NS_ARRAY_CONTRACTID));
|
||||
if (!items)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
GError* error = nsnull;
|
||||
GSList* list = gconf_client_get_list(mClient, PromiseFlatCString(aKey).get(),
|
||||
GCONF_VALUE_STRING, &error);
|
||||
if (error) {
|
||||
g_error_free(error);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
for (GSList* l = list; l; l = l->next) {
|
||||
nsCOMPtr<nsISupportsString> obj(do_CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID));
|
||||
if (!obj) {
|
||||
g_slist_free(list);
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
obj->SetData(NS_ConvertUTF8toUTF16((const char*)l->data));
|
||||
items->AppendElement(obj, PR_FALSE);
|
||||
g_free(l->data);
|
||||
}
|
||||
|
||||
g_slist_free(list);
|
||||
NS_ADDREF(*aResult = items);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsGConfService::SetBool(const nsACString &aKey, PRBool aValue)
|
||||
{
|
||||
|
|
|
@ -661,7 +661,6 @@ MAKEFILES_xulapp="
|
|||
toolkit/components/downloads/src/Makefile
|
||||
toolkit/components/filepicker/Makefile
|
||||
toolkit/system/gnome/Makefile
|
||||
toolkit/system/unixproxy/Makefile
|
||||
toolkit/components/help/Makefile
|
||||
toolkit/components/history/Makefile
|
||||
toolkit/components/history/public/Makefile
|
||||
|
|
|
@ -37,9 +37,8 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsISupports.idl"
|
||||
#include "nsIArray.idl"
|
||||
|
||||
[scriptable, uuid(5009acae-6973-48c3-b6d6-52c692cc5d9d)]
|
||||
[scriptable, uuid(01ac7b2e-c07c-465f-b35c-542eaef420a9)]
|
||||
interface nsIGConfService : nsISupports
|
||||
{
|
||||
/* Basic registry access */
|
||||
|
@ -48,12 +47,6 @@ interface nsIGConfService : nsISupports
|
|||
long getInt(in AUTF8String key);
|
||||
float getFloat(in AUTF8String key);
|
||||
|
||||
/*
|
||||
* Use this to return any list items in GConf, this will return
|
||||
* an array of UTF16 nsISupportsString's.
|
||||
*/
|
||||
nsIArray getStringList(in AUTF8String key);
|
||||
|
||||
void setBool(in AUTF8String key, in boolean value);
|
||||
void setString(in AUTF8String key, in AUTF8String value);
|
||||
void setInt(in AUTF8String key, in long value);
|
||||
|
|
Загрузка…
Ссылка в новой задаче