From 620f57148c311c4dc2cf680a4a5861fbdcd29993 Mon Sep 17 00:00:00 2001 From: "ericroman@google.com" Date: Tue, 4 Aug 2009 22:43:12 +0000 Subject: Better match IE's proxy settings. * When BOTH autodetect and custom PAC script are given, try both. * Use successful PAC parsing as the heuristic for determining when a script is valid (rather than first-request). * Only apply the proxy bypass list when using non-PAC. The high level explanation on how this works: http://sites.google.com/a/chromium.org/dev/developers/design-documents/proxy-settings-fallback BUG= http://crbug.com/18271, http://crbug.com/9985 TEST=unit tests. Review URL: http://codereview.chromium.org/160510 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22430 0039d316-1c4b-4281-b951-d872f2087c98 --- net/proxy/single_threaded_proxy_resolver.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'net/proxy/single_threaded_proxy_resolver.h') diff --git a/net/proxy/single_threaded_proxy_resolver.h b/net/proxy/single_threaded_proxy_resolver.h index 010e526..fff23b8 100644 --- a/net/proxy/single_threaded_proxy_resolver.h +++ b/net/proxy/single_threaded_proxy_resolver.h @@ -37,6 +37,7 @@ class SingleThreadedProxyResolver : public ProxyResolver { CompletionCallback* callback, RequestHandle* request); virtual void CancelRequest(RequestHandle request); + virtual void CancelSetPacScript(); protected: // The wrapped (synchronous) ProxyResolver. @@ -47,18 +48,17 @@ class SingleThreadedProxyResolver : public ProxyResolver { // thread. class Job; friend class Job; + class SetPacScriptTask; + friend class SetPacScriptTask; // FIFO queue that contains the in-progress job, and any pending jobs. typedef std::deque > PendingJobsQueue; base::Thread* thread() { return thread_.get(); } // ProxyResolver implementation: - virtual void SetPacScriptByUrlInternal(const GURL& pac_url); - virtual void SetPacScriptByDataInternal(const std::string& bytes); - - // Helper for shared code between SetPacScriptByUrlInternal() and - // SetPacScriptByDataInternal() -- the unused parameter is set to empty. - void SetPacScriptHelper(const GURL& pac_url, const std::string& bytes); + virtual int SetPacScript(const GURL& pac_url, + const std::string& pac_bytes, + CompletionCallback* callback); // Starts the worker thread if it isn't already running. void EnsureThreadStarted(); @@ -71,6 +71,10 @@ class SingleThreadedProxyResolver : public ProxyResolver { // DCHECK for verification purposes. void RemoveFrontOfJobsQueueAndStartNext(Job* expected_job); + // Clears |outstanding_set_pac_script_task_|. + // Called when |task| has just finished. + void RemoveOutstandingSetPacScriptTask(SetPacScriptTask* task); + // The synchronous resolver implementation. scoped_ptr resolver_; @@ -81,6 +85,7 @@ class SingleThreadedProxyResolver : public ProxyResolver { scoped_ptr thread_; PendingJobsQueue pending_jobs_; + scoped_refptr outstanding_set_pac_script_task_; }; } // namespace net -- cgit v1.1