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

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: Created 7 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 | « no previous file | net/proxy/proxy_script_decider.cc » ('j') | net/proxy/proxy_script_decider.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..941490215d726b880cc5c9449f4775781c12a8ed 100644
--- a/net/proxy/proxy_script_decider.h
+++ b/net/proxy/proxy_script_decider.h
@@ -12,9 +12,11 @@
#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/proxy/proxy_config.h"
#include "net/proxy/proxy_resolver.h"
#include "url/gurl.h"
@@ -103,12 +105,15 @@ class NET_EXPORT_PRIVATE ProxyScriptDecider {
enum State {
STATE_NONE,
+ STATE_QUICK_CHECK,
+ STATE_QUICK_CHECK_COMPLETE,
STATE_WAIT,
STATE_WAIT_COMPLETE,
STATE_FETCH_PAC_SCRIPT,
STATE_FETCH_PAC_SCRIPT_COMPLETE,
STATE_VERIFY_PAC_SCRIPT,
STATE_VERIFY_PAC_SCRIPT_COMPLETE,
+ STATE_FAILED,
};
// Returns ordered list of PAC urls to try for |config|.
@@ -118,6 +123,10 @@ class NET_EXPORT_PRIVATE ProxyScriptDecider {
int DoLoop(int result);
void DoCallback(int result);
+ int DoQuickCheck();
+ int DoQuickCheckComplete();
+ void OnQuickCheckComplete(int result);
+
int DoWait();
int DoWaitComplete(int result);
@@ -142,6 +151,7 @@ class NET_EXPORT_PRIVATE ProxyScriptDecider {
// Returns the current PAC URL we are fetching/testing.
const PacSource& current_pac_source() const;
+ void OnQuickCheckTimerFired();
void OnWaitTimerFired();
void DidComplete();
void Cancel();
@@ -175,6 +185,12 @@ class NET_EXPORT_PRIVATE ProxyScriptDecider {
ProxyConfig effective_config_;
scoped_refptr<ProxyResolverScriptData> script_data_;
+ scoped_ptr<HostResolver> host_resolver_;
+ AddressList wpad_addrs_;
+ HostResolver::RequestHandle wpad_req_;
+ base::TimeDelta quick_check_delay_;
szym 2013/08/21 19:11:21 Do you anticipate changing this value? If not, dec
+ base::OneShotTimer<ProxyScriptDecider> quick_check_timer_;
+ base::Time quick_check_started_;
szym 2013/08/21 19:11:21 Instead of storing it here, bind it into the Callb
szym 2013/08/21 19:21:09 Both the timer and HostResolver::Request. Complet
DISALLOW_COPY_AND_ASSIGN(ProxyScriptDecider);
};
« no previous file with comments | « no previous file | net/proxy/proxy_script_decider.cc » ('j') | net/proxy/proxy_script_decider.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698