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

Unified Diff: net/proxy/proxy_script_decider.h

Issue 23181010: Fast-fail WPAD detection. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Only invoke native resolver. Created 7 years, 3 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
Index: net/proxy/proxy_script_decider.h
diff --git a/net/proxy/proxy_script_decider.h b/net/proxy/proxy_script_decider.h
index 9a77938ec8e4aef834281184e16d1d55913b9b3c..740c58fdff20ecaabd84c187e05a270d22f0ae9f 100644
--- a/net/proxy/proxy_script_decider.h
+++ b/net/proxy/proxy_script_decider.h
@@ -12,9 +12,12 @@
#include "base/strings/string16.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
+#include "net/base/address_list.h"
#include "net/base/completion_callback.h"
#include "net/base/net_export.h"
#include "net/base/net_log.h"
+#include "net/dns/host_resolver.h"
+#include "net/dns/single_request_host_resolver.h"
#include "net/proxy/proxy_config.h"
#include "net/proxy/proxy_resolver.h"
#include "url/gurl.h"
@@ -76,6 +79,8 @@ class NET_EXPORT_PRIVATE ProxyScriptDecider {
// TODO(eroman): Return a const-pointer.
ProxyResolverScriptData* script_data() const;
+ void SetHostResolverForTesting(HostResolver* resolver);
szym 2013/09/16 21:50:32 Needs comment. Is this going to be used for quickc
Elly Fong-Jones 2013/09/16 22:10:11 Deleted.
+
private:
// Represents the sources from which we can get PAC files; two types of
// auto-detect or a custom URL.
@@ -105,6 +110,8 @@ class NET_EXPORT_PRIVATE ProxyScriptDecider {
STATE_NONE,
STATE_WAIT,
STATE_WAIT_COMPLETE,
+ STATE_QUICK_CHECK,
+ STATE_QUICK_CHECK_COMPLETE,
STATE_FETCH_PAC_SCRIPT,
STATE_FETCH_PAC_SCRIPT_COMPLETE,
STATE_VERIFY_PAC_SCRIPT,
@@ -121,6 +128,9 @@ class NET_EXPORT_PRIVATE ProxyScriptDecider {
int DoWait();
int DoWaitComplete(int result);
+ int DoQuickCheck();
+ int DoQuickCheckComplete(int result);
+
int DoFetchPacScript();
int DoFetchPacScriptComplete(int result);
@@ -175,6 +185,10 @@ class NET_EXPORT_PRIVATE ProxyScriptDecider {
ProxyConfig effective_config_;
scoped_refptr<ProxyResolverScriptData> script_data_;
+ AddressList wpad_addresses_;
+ base::OneShotTimer<ProxyScriptDecider> quick_check_timer_;
+ scoped_ptr<SingleRequestHostResolver> host_resolver_;
+ base::Time quick_check_start_time_;
DISALLOW_COPY_AND_ASSIGN(ProxyScriptDecider);
};

Powered by Google App Engine
This is Rietveld 408576698