Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(619)

Unified Diff: net/proxy/proxy_service.h

Issue 160510: Better match IE's proxy settings.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix merge conflict Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/proxy/proxy_script_fetcher_unittest.cc ('k') | net/proxy/proxy_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_service.h
===================================================================
--- net/proxy/proxy_service.h (revision 22399)
+++ net/proxy/proxy_service.h (working copy)
@@ -24,9 +24,10 @@
namespace net {
-class ProxyScriptFetcher;
+class InitProxyResolver;
class ProxyConfigService;
class ProxyResolver;
+class ProxyScriptFetcher;
// This class can be used to resolve the proxy server to use when loading a
// HTTP(S) URL. It uses the given ProxyResolver to handle the actual proxy
@@ -165,15 +166,16 @@
// Tries to update the configuration if it hasn't been checked in a while.
void UpdateConfigIfOld();
- // Returns true if this ProxyService is downloading a PAC script on behalf
- // of ProxyResolverWithoutFetch. Resolve requests will be frozen until
- // the fetch has completed.
- bool IsFetchingPacScript() const {
- return in_progress_fetch_config_id_ != ProxyConfig::INVALID_ID;
+ // Returns true if the proxy resolver is being initialized for PAC
+ // (downloading PAC script(s) + testing).
+ // Resolve requests will be frozen until the initialization has completed.
+ bool IsInitializingProxyResolver() const {
+ return init_proxy_resolver_.get() != NULL;
}
- // Callback for when the PAC script has finished downloading.
- void OnScriptFetchCompletion(int result);
+ // Callback for when the proxy resolver has been initialized with a
+ // PAC script.
+ void OnInitProxyResolverComplete(int result);
// Returns ERR_IO_PENDING if the request cannot be completed synchronously.
// Otherwise it fills |result| with the proxy information for |url|.
@@ -185,6 +187,10 @@
const ProxyConfig::ProxyRules& rules,
ProxyInfo* result);
+ // Cancel all of the requests sent to the ProxyResolver. These will be
+ // restarted when calling ResumeAllPendingRequests().
+ void SuspendAllPendingRequests();
+
// Sends all the unstarted pending requests off to the resolver.
void ResumeAllPendingRequests();
@@ -194,12 +200,6 @@
// Removes |req| from the list of pending requests.
void RemovePendingRequest(PacRequest* req);
- // Returns true if the resolver is all set-up and ready to accept requests.
- // Returns false if requests are blocked (because the PAC script is being
- // downloaded). May have the side-effect of starting the PAC script
- // download.
- bool PrepareResolverForRequests();
-
// Called to indicate that a PacRequest completed. The |config_id| parameter
// indicates the proxy configuration that was queried. |result_code| is OK
// if the PAC file could be downloaded and executed. Otherwise, it is an
@@ -215,6 +215,9 @@
// heuristic).
static bool IsLocalName(const GURL& url);
+ // Helper to download the PAC script (wpad + custom) and apply fallback rules.
+ scoped_ptr<InitProxyResolver> init_proxy_resolver_;
+
scoped_ptr<ProxyConfigService> config_service_;
scoped_ptr<ProxyResolver> resolver_;
@@ -242,23 +245,8 @@
// external PAC script fetching.
scoped_ptr<ProxyScriptFetcher> proxy_script_fetcher_;
- // Callback for when |proxy_script_fetcher_| is done.
- CompletionCallbackImpl<ProxyService> proxy_script_fetcher_callback_;
-
- // The ID of the configuration for which we last downloaded a PAC script.
- // If no PAC script has been fetched yet, will be ProxyConfig::INVALID_ID.
- ProxyConfig::ID fetched_pac_config_id_;
-
- // The error corresponding with |fetched_pac_config_id_|, or OK.
- int fetched_pac_error_;
-
- // The ID of the configuration for which we are currently downloading the
- // PAC script. If no fetch is in progress, will be ProxyConfig::INVALID_ID.
- ProxyConfig::ID in_progress_fetch_config_id_;
-
- // The results of the current in progress fetch, or empty string.
- std::string in_progress_fetch_bytes_;
-
+ // Callback for when |init_proxy_resolver_| is done.
+ CompletionCallbackImpl<ProxyService> init_proxy_resolver_callback_;
DISALLOW_COPY_AND_ASSIGN(ProxyService);
};
« no previous file with comments | « net/proxy/proxy_script_fetcher_unittest.cc ('k') | net/proxy/proxy_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698