Back out for now until there's a fix.

This commit is contained in:
reed@reedloden.com 2008-01-29 09:57:17 -08:00
Родитель 28b6ad7f3d
Коммит 966edcb5c4
11 изменённых файлов: 21 добавлений и 132 удалений

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

@ -104,7 +104,6 @@ XPIDLSRCS = \
nsIStreamTransportService.idl \ nsIStreamTransportService.idl \
nsIStreamLoader.idl \ nsIStreamLoader.idl \
nsISyncStreamListener.idl \ nsISyncStreamListener.idl \
nsISystemProxySettings.idl \
nsIUnicharStreamLoader.idl \ nsIUnicharStreamLoader.idl \
nsIStandardURL.idl \ nsIStandardURL.idl \
nsINestedURI.idl \ nsINestedURI.idl \

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

@ -128,14 +128,6 @@ public:
*/ */
PRBool IsLoading() { return mLoader != nsnull; } 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: private:
NS_DECL_NSISTREAMLOADEROBSERVER NS_DECL_NSISTREAMLOADEROBSERVER
NS_DECL_NSIINTERFACEREQUESTOR NS_DECL_NSIINTERFACEREQUESTOR
@ -170,6 +162,14 @@ private:
*/ */
void OnLoadFailure(); 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: private:
nsCOMPtr<nsIProxyAutoConfig> mPAC; nsCOMPtr<nsIProxyAutoConfig> mPAC;
nsCOMPtr<nsIURI> mPACURI; nsCOMPtr<nsIURI> mPACURI;

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

@ -404,12 +404,6 @@ nsProtocolProxyService::PrefsChanged(nsIPrefBranch *prefBranch,
mProxyConfig = static_cast<ProxyConfig>(type); mProxyConfig = static_cast<ProxyConfig>(type);
reloadPAC = PR_TRUE; reloadPAC = PR_TRUE;
} }
if (mProxyConfig == eProxyConfig_System) {
mSystemProxySettings = do_GetService(NS_SYSTEMPROXYSETTINGS_CONTRACTID);
} else {
mSystemProxySettings = nsnull;
}
} }
if (!pref || !strcmp(pref, PROXY_PREF("http"))) if (!pref || !strcmp(pref, PROXY_PREF("http")))
@ -467,10 +461,8 @@ nsProtocolProxyService::PrefsChanged(nsIPrefBranch *prefBranch,
LoadHostFilters(tempString.get()); LoadHostFilters(tempString.get());
} }
// We're done if not using something that could give us a PAC URL // We're done if not using PAC or WPAD
// (PAC, WPAD or System) if (mProxyConfig != eProxyConfig_PAC && mProxyConfig != eProxyConfig_WPAD)
if (mProxyConfig != eProxyConfig_PAC && mProxyConfig != eProxyConfig_WPAD &&
mProxyConfig != eProxyConfig_System)
return; return;
// OK, we need to reload the PAC file if: // OK, we need to reload the PAC file if:
@ -485,20 +477,17 @@ nsProtocolProxyService::PrefsChanged(nsIPrefBranch *prefBranch,
if (mProxyConfig == eProxyConfig_PAC) { if (mProxyConfig == eProxyConfig_PAC) {
prefBranch->GetCharPref(PROXY_PREF("autoconfig_url"), prefBranch->GetCharPref(PROXY_PREF("autoconfig_url"),
getter_Copies(tempString)); getter_Copies(tempString));
} else { }
else if (mProxyConfig == eProxyConfig_WPAD) {
// We diverge from the WPAD spec here in that we don't walk the // 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 // 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 // is dangerous in the face of an incomplete list of TLDs, and TLDs
// get added over time. We could consider doing only a single // get added over time. We could consider doing only a single
// substitution of the first component, if that proves to help // substitution of the first component, if that proves to help
// compatibility. // compatibility.
if (mSystemProxySettings) tempString.AssignLiteral(WPAD_URL);
mSystemProxySettings->GetPACURI(tempString);
else
tempString.AssignLiteral(WPAD_URL);
} }
if (!tempString.IsEmpty()) ConfigureFromPAC(tempString);
ConfigureFromPAC(tempString);
} }
} }
@ -766,16 +755,13 @@ nsProtocolProxyService::ConfigureFromPAC(const nsCString &spec)
return NS_ERROR_OUT_OF_MEMORY; return NS_ERROR_OUT_OF_MEMORY;
} }
mFailedProxies.Clear();
nsCOMPtr<nsIURI> pacURI; nsCOMPtr<nsIURI> pacURI;
nsresult rv = NS_NewURI(getter_AddRefs(pacURI), spec); nsresult rv = NS_NewURI(getter_AddRefs(pacURI), spec);
if (NS_FAILED(rv)) if (NS_FAILED(rv))
return rv; return rv;
if (mPACMan->IsPACURI(pacURI))
return NS_OK;
mFailedProxies.Clear();
return mPACMan->LoadPACFromURI(pacURI); return mPACMan->LoadPACFromURI(pacURI);
} }
@ -950,10 +936,8 @@ nsProtocolProxyService::GetFailoverForProxy(nsIProxyInfo *aProxy,
nsresult aStatus, nsresult aStatus,
nsIProxyInfo **aResult) nsIProxyInfo **aResult)
{ {
// We only support failover when a PAC file is configured, either // We only support failover when a PAC file is configured.
// directly or via system settings if (mProxyConfig != eProxyConfig_PAC && mProxyConfig != eProxyConfig_WPAD)
if (mProxyConfig != eProxyConfig_PAC && mProxyConfig != eProxyConfig_WPAD &&
mProxyConfig != eProxyConfig_System)
return NS_ERROR_NOT_AVAILABLE; return NS_ERROR_NOT_AVAILABLE;
// Verify that |aProxy| is one of our nsProxyInfo objects. // Verify that |aProxy| is one of our nsProxyInfo objects.
@ -1250,37 +1234,15 @@ nsProtocolProxyService::Resolve_Internal(nsIURI *uri,
if (!(info.flags & nsIProtocolHandler::ALLOWS_PROXY)) if (!(info.flags & nsIProtocolHandler::ALLOWS_PROXY))
return NS_OK; // Can't proxy this (filters may not override) 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 // if proxies are enabled and this host:port combo is supposed to use a
// proxy, check for a proxy. // proxy, check for a proxy.
if (mProxyConfig == eProxyConfig_Direct || if (mProxyConfig == eProxyConfig_Direct ||
(mProxyConfig == eProxyConfig_Manual && (mProxyConfig == eProxyConfig_Manual &&
!CanUseProxy(uri, info.defaultPort))) !CanUseProxy(uri, info.defaultPort)))
return NS_OK; return NS_OK;
// Proxy auto config magic... // Proxy auto config magic...
if (mProxyConfig == eProxyConfig_PAC || mProxyConfig == eProxyConfig_WPAD || if (mProxyConfig == eProxyConfig_PAC || mProxyConfig == eProxyConfig_WPAD) {
mProxyConfig == eProxyConfig_System) {
// Do not query PAC now. // Do not query PAC now.
*usePAC = PR_TRUE; *usePAC = PR_TRUE;
return NS_OK; return NS_OK;

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

@ -47,7 +47,6 @@
#include "nsIProtocolProxyService2.h" #include "nsIProtocolProxyService2.h"
#include "nsIProtocolProxyFilter.h" #include "nsIProtocolProxyFilter.h"
#include "nsIProxyAutoConfig.h" #include "nsIProxyAutoConfig.h"
#include "nsISystemProxySettings.h"
#include "nsIProxyInfo.h" #include "nsIProxyInfo.h"
#include "nsIObserver.h" #include "nsIObserver.h"
#include "nsDataHashtable.h" #include "nsDataHashtable.h"
@ -316,7 +315,6 @@ protected:
eProxyConfig_PAC, eProxyConfig_PAC,
eProxyConfig_Direct4x, eProxyConfig_Direct4x,
eProxyConfig_WPAD, eProxyConfig_WPAD,
eProxyConfig_System, // use system proxy settings if available, otherwise DIRECT
eProxyConfig_Last eProxyConfig_Last
}; };
@ -378,7 +376,6 @@ protected:
PRBool mSOCKSProxyRemoteDNS; PRBool mSOCKSProxyRemoteDNS;
nsRefPtr<nsPACMan> mPACMan; // non-null if we are using PAC nsRefPtr<nsPACMan> mPACMan; // non-null if we are using PAC
nsCOMPtr<nsISystemProxySettings> mSystemProxySettings;
PRTime mSessionStart; PRTime mSessionStart;
nsFailedProxyTable mFailedProxies; nsFailedProxyTable mFailedProxies;

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

@ -326,10 +326,6 @@
#define NS_INCREMENTALDOWNLOAD_CONTRACTID \ #define NS_INCREMENTALDOWNLOAD_CONTRACTID \
"@mozilla.org/network/incremental-download;1" "@mozilla.org/network/incremental-download;1"
// component implementing nsISystemProxySettings.
#define NS_SYSTEMPROXYSETTINGS_CONTRACTID \
"@mozilla.org/system-proxy-settings;1"
// service implementing nsIStreamTransportService // service implementing nsIStreamTransportService
#define NS_STREAMTRANSPORTSERVICE_CLASSNAME \ #define NS_STREAMTRANSPORTSERVICE_CLASSNAME \
"nsStreamTransportService" "nsStreamTransportService"

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

@ -51,10 +51,6 @@ DIRS = \
themes \ themes \
$(NULL) $(NULL)
ifneq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT)))
DIRS += system/unixproxy
endif
ifdef MOZ_CRASHREPORTER ifdef MOZ_CRASHREPORTER
DIRS += crashreporter DIRS += crashreporter
endif endif

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

@ -147,14 +147,6 @@ COMPONENT_LIBS += \
$(NULL) $(NULL)
endif endif
ifdef MOZ_XUL
ifdef MOZ_ENABLE_GTK2
COMPONENT_LIBS += \
unixproxy \
$(NULL)
endif
endif
ifdef MOZ_PERF_METRICS ifdef MOZ_PERF_METRICS
EXTRA_DSO_LIBS += mozutil_s EXTRA_DSO_LIBS += mozutil_s
endif endif

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

@ -262,15 +262,6 @@
#define XMLEXTRAS_MODULE #define XMLEXTRAS_MODULE
#endif #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 \ #define XUL_MODULES \
MODULE(xpconnect) \ MODULE(xpconnect) \
MATHML_MODULES \ MATHML_MODULES \
@ -322,7 +313,6 @@
SPELLCHECK_MODULE \ SPELLCHECK_MODULE \
XMLEXTRAS_MODULE \ XMLEXTRAS_MODULE \
LAYOUT_DEBUG_MODULE \ LAYOUT_DEBUG_MODULE \
UNIXPROXY_MODULE \
/* end of list */ /* end of list */
#define MODULE(_name) \ #define MODULE(_name) \

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

@ -38,10 +38,6 @@
#include "nsGConfService.h" #include "nsGConfService.h"
#include "nsStringAPI.h" #include "nsStringAPI.h"
#include "nsCOMPtr.h"
#include "nsComponentManagerUtils.h"
#include "nsISupportsPrimitives.h"
#include "nsIMutableArray.h"
#include <gconf/gconf-client.h> #include <gconf/gconf-client.h>
@ -127,37 +123,6 @@ nsGConfService::GetFloat(const nsACString &aKey, float* aResult)
return NS_OK; 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 NS_IMETHODIMP
nsGConfService::SetBool(const nsACString &aKey, PRBool aValue) nsGConfService::SetBool(const nsACString &aKey, PRBool aValue)
{ {

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

@ -661,7 +661,6 @@ MAKEFILES_xulapp="
toolkit/components/downloads/src/Makefile toolkit/components/downloads/src/Makefile
toolkit/components/filepicker/Makefile toolkit/components/filepicker/Makefile
toolkit/system/gnome/Makefile toolkit/system/gnome/Makefile
toolkit/system/unixproxy/Makefile
toolkit/components/help/Makefile toolkit/components/help/Makefile
toolkit/components/history/Makefile toolkit/components/history/Makefile
toolkit/components/history/public/Makefile toolkit/components/history/public/Makefile

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

@ -37,9 +37,8 @@
* ***** END LICENSE BLOCK ***** */ * ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl" #include "nsISupports.idl"
#include "nsIArray.idl"
[scriptable, uuid(5009acae-6973-48c3-b6d6-52c692cc5d9d)] [scriptable, uuid(01ac7b2e-c07c-465f-b35c-542eaef420a9)]
interface nsIGConfService : nsISupports interface nsIGConfService : nsISupports
{ {
/* Basic registry access */ /* Basic registry access */
@ -48,12 +47,6 @@ interface nsIGConfService : nsISupports
long getInt(in AUTF8String key); long getInt(in AUTF8String key);
float getFloat(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 setBool(in AUTF8String key, in boolean value);
void setString(in AUTF8String key, in AUTF8String value); void setString(in AUTF8String key, in AUTF8String value);
void setInt(in AUTF8String key, in long value); void setInt(in AUTF8String key, in long value);