Backed out changeset df6b25262c65 (bug 1244474) for timeouts in automation.py
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Fri, 01 Jul 2016 14:08:00 +0200
changeset 383216 9ef5260af8f32989b2a5e1d0bd9a4f9103b566c6
parent 383215 fa394e9ab7168769233fd8999cb8cc076b951c5c
child 383217 5ecebd971de4d59c5fd54cf47842606d025fd0be
push id21963
push userdmitchell@mozilla.com
push dateFri, 01 Jul 2016 19:54:18 +0000
bugs1244474
milestone50.0a1
backs outdf6b25262c658e87715c98990d36a6b7fd8f8a0a
Backed out changeset df6b25262c65 (bug 1244474) for timeouts in automation.py
modules/libpref/init/all.js
netwerk/base/ProxyAutoConfig.cpp
netwerk/base/ProxyAutoConfig.h
netwerk/base/nsPACMan.cpp
netwerk/base/nsPACMan.h
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -1951,18 +1951,16 @@ pref("network.cookie.cookieBehavior",   
 #endif
 pref("network.cookie.thirdparty.sessionOnly", false);
 pref("network.cookie.lifetimePolicy",       0); // 0-accept, 1-dontUse 2-acceptForSession, 3-acceptForNDays
 pref("network.cookie.prefsMigrated",        false);
 pref("network.cookie.lifetime.days",        90); // Ignored unless network.cookie.lifetimePolicy is 3.
 
 // The PAC file to load.  Ignored unless network.proxy.type is 2.
 pref("network.proxy.autoconfig_url", "");
-// Strip off paths when sending URLs to PAC scripts
-pref("network.proxy.autoconfig_url.include_path", false);
 
 // If we cannot load the PAC file, then try again (doubling from interval_min
 // until we reach interval_max or the PAC file is successfully loaded).
 pref("network.proxy.autoconfig_retry_interval_min", 5);    // 5 seconds
 pref("network.proxy.autoconfig_retry_interval_max", 300);  // 5 minutes
 
 // Use the HSTS preload list by default
 pref("network.stricttransportsecurity.preloadlist", true);
--- a/netwerk/base/ProxyAutoConfig.cpp
+++ b/netwerk/base/ProxyAutoConfig.cpp
@@ -6,17 +6,16 @@
 
 #include "ProxyAutoConfig.h"
 #include "nsICancelable.h"
 #include "nsIDNSListener.h"
 #include "nsIDNSRecord.h"
 #include "nsIDNSService.h"
 #include "nsThreadUtils.h"
 #include "nsIConsoleService.h"
-#include "nsIURLParser.h"
 #include "nsJSUtils.h"
 #include "jsfriendapi.h"
 #include "prnetdb.h"
 #include "nsITimer.h"
 #include "mozilla/net/DNS.h"
 #include "nsServiceManagerUtils.h"
 #include "nsNetCID.h"
 
@@ -731,27 +730,25 @@ const JSClass JSRuntimeWrapper::sGlobalC
 void
 ProxyAutoConfig::SetThreadLocalIndex(uint32_t index)
 {
   sRunningIndex = index;
 }
 
 nsresult
 ProxyAutoConfig::Init(const nsCString &aPACURI,
-                      const nsCString &aPACScript,
-                      bool aIncludePath)
+                      const nsCString &aPACScript)
 {
   mPACURI = aPACURI;
   mPACScript = sPacUtils;
   mPACScript.Append(aPACScript);
 
   if (!GetRunning())
     return SetupJS();
 
-  mIncludePath = aIncludePath;
   mJSNeedsSetup = true;
   return NS_OK;
 }
 
 nsresult
 ProxyAutoConfig::SetupJS()
 {
   mJSNeedsSetup = false;
@@ -839,39 +836,17 @@ ProxyAutoConfig::GetProxyForURI(const ns
   // while the event loop is spinning on a DNS function. Don't early return.
   SetRunning(this);
   mRunningHost = aTestHost;
   mRunningAppId = aAppId;
   mRunningAppOrigin = aAppOrigin;
   mRunningIsInIsolatedMozBrowser = aIsInIsolatedMozBrowser;
 
   nsresult rv = NS_ERROR_FAILURE;
-  uint32_t schemePos;
-  int32_t schemeLen;
-  uint32_t authorityPos;
-  int32_t authorityLen;
-  uint32_t pathPos;
-  int32_t pathLen;
-
-  nsCString clensedURI = aTestURI;
-
-  if (!mIncludePath) {
-    nsCOMPtr<nsIURLParser> urlParser =
-      do_GetService(NS_STDURLPARSER_CONTRACTID, &rv);
-    rv = urlParser->ParseURL(aTestURI.get(), aTestURI.Length(),
-                             &schemePos, &schemeLen,
-                             &authorityPos, &authorityLen,
-                             &pathPos, &pathLen);
-    if (NS_SUCCEEDED(rv)) {
-      // cut off the path
-      aTestURI.Left(clensedURI, aTestURI.Length() - pathLen);
-    }
-  }
-
-  JS::RootedString uriString(cx, JS_NewStringCopyZ(cx, clensedURI.get()));
+  JS::RootedString uriString(cx, JS_NewStringCopyZ(cx, aTestURI.get()));
   JS::RootedString hostString(cx, JS_NewStringCopyZ(cx, aTestHost.get()));
 
   if (uriString && hostString) {
     JS::AutoValueArray<2> args(cx);
     args[0].setString(uriString);
     args[1].setString(hostString);
 
     JS::Rooted<JS::Value> rval(cx);
--- a/netwerk/base/ProxyAutoConfig.h
+++ b/netwerk/base/ProxyAutoConfig.h
@@ -25,18 +25,17 @@ union NetAddr;
 // thread and running nested event loops. GetProxyForURI is not re-entrant.
 
 class ProxyAutoConfig  {
 public:
   ProxyAutoConfig();
   ~ProxyAutoConfig();
 
   nsresult Init(const nsCString &aPACURI,
-                const nsCString &aPACScript,
-                bool aIncludePath);
+                const nsCString &aPACScript);
   void     SetThreadLocalIndex(uint32_t index);
   void     Shutdown();
   void     GC();
   bool     MyIPAddress(const JS::CallArgs &aArgs);
   bool     MyAppId(const JS::CallArgs &aArgs);
   bool     MyAppOrigin(const JS::CallArgs &aArgs);
   bool     IsInIsolatedMozBrowser(const JS::CallArgs &aArgs);
   bool     ResolveAddress(const nsCString &aHostName,
@@ -104,17 +103,16 @@ private:
   bool MyIPAddressTryHost(const nsCString &hostName, unsigned int timeout,
                           const JS::CallArgs &aArgs, bool* aResult);
 
   JSRuntimeWrapper *mJSRuntime;
   bool              mJSNeedsSetup;
   bool              mShutdown;
   nsCString         mPACScript;
   nsCString         mPACURI;
-  bool              mIncludePath;
   nsCString         mRunningHost;
   uint32_t          mRunningAppId;
   nsString          mRunningAppOrigin;
   bool              mRunningIsInIsolatedMozBrowser;
   nsCOMPtr<nsITimer> mTimer;
 };
 
 } // namespace net
--- a/netwerk/base/nsPACMan.cpp
+++ b/netwerk/base/nsPACMan.cpp
@@ -12,17 +12,16 @@
 #include "nsIPromptFactory.h"
 #include "nsIHttpChannel.h"
 #include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 #include "nsNetUtil.h"
 #include "nsIAsyncVerifyRedirectCallback.h"
 #include "nsISystemProxySettings.h"
 #include "nsContentUtils.h"
-#include "mozilla/Preferences.h"
 #ifdef MOZ_NUWA_PROCESS
 #include "ipc/Nuwa.h"
 #endif
 
 //-----------------------------------------------------------------------------
 
 namespace mozilla {
 namespace net {
@@ -206,18 +205,17 @@ public:
       mCancel = false;
       return NS_OK;
     }
 
     if (mSetupPAC) {
       mSetupPAC = false;
 
       mPACMan->mPAC.Init(mSetupPACURI,
-                         mSetupPACData,
-                         mPACMan->mIncludePath);
+                         mSetupPACData);
 
       RefPtr<PACLoadComplete> runnable = new PACLoadComplete(mPACMan);
       NS_DispatchToMainThread(runnable);
       return NS_OK;
     }
 
     mPACMan->ProcessPendingQ();
     return NS_OK;
@@ -299,32 +297,28 @@ PendingPACQuery::Run()
   return NS_OK;
 }
 
 //-----------------------------------------------------------------------------
 
 static bool sThreadLocalSetup = false;
 static uint32_t sThreadLocalIndex = 0xdeadbeef; // out of range
 
-static const char *kPACIncludePath =
-  "network.proxy.autoconfig_url.include_path";
-
 nsPACMan::nsPACMan()
   : mLoadPending(false)
   , mShutdown(false)
   , mLoadFailureCount(0)
   , mInProgress(false)
 {
   MOZ_ASSERT(NS_IsMainThread(), "pacman must be created on main thread");
   if (!sThreadLocalSetup){
     sThreadLocalSetup = true;
     PR_NewThreadPrivateIndex(&sThreadLocalIndex, nullptr);
   }
   mPAC.SetThreadLocalIndex(sThreadLocalIndex);
-  mIncludePath = Preferences::GetBool(kPACIncludePath, false);
 }
 
 nsPACMan::~nsPACMan()
 {
   if (mPACThread) {
     if (NS_IsMainThread()) {
       mPACThread->Shutdown();
     }
--- a/netwerk/base/nsPACMan.h
+++ b/netwerk/base/nsPACMan.h
@@ -237,17 +237,16 @@ private:
 
   nsCOMPtr<nsIStreamLoader>    mLoader;
   bool                         mLoadPending;
   Atomic<bool, Relaxed>        mShutdown;
   TimeStamp                    mScheduledReload;
   uint32_t                     mLoadFailureCount;
 
   bool                         mInProgress;
-  bool                         mIncludePath;
 };
 
 extern LazyLogModule gProxyLog;
 
 } // namespace net
 } // namespace mozilla
 
 #endif  // nsPACMan_h__