OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/proxy/proxy_script_decider.h" | 5 #include "net/proxy/proxy_script_decider.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/format_macros.h" | 10 #include "base/format_macros.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 break; | 73 break; |
74 } | 74 } |
75 dict->SetString("source", source); | 75 dict->SetString("source", source); |
76 return dict; | 76 return dict; |
77 } | 77 } |
78 | 78 |
79 ProxyScriptDecider::ProxyScriptDecider( | 79 ProxyScriptDecider::ProxyScriptDecider( |
80 ProxyScriptFetcher* proxy_script_fetcher, | 80 ProxyScriptFetcher* proxy_script_fetcher, |
81 DhcpProxyScriptFetcher* dhcp_proxy_script_fetcher, | 81 DhcpProxyScriptFetcher* dhcp_proxy_script_fetcher, |
82 NetLog* net_log) | 82 NetLog* net_log) |
83 : resolver_(NULL), | 83 : proxy_script_fetcher_(proxy_script_fetcher), |
84 proxy_script_fetcher_(proxy_script_fetcher), | |
85 dhcp_proxy_script_fetcher_(dhcp_proxy_script_fetcher), | 84 dhcp_proxy_script_fetcher_(dhcp_proxy_script_fetcher), |
86 current_pac_source_index_(0u), | 85 current_pac_source_index_(0u), |
87 pac_mandatory_(false), | 86 pac_mandatory_(false), |
88 next_state_(STATE_NONE), | 87 next_state_(STATE_NONE), |
89 net_log_(BoundNetLog::Make( | 88 net_log_(BoundNetLog::Make(net_log, NetLog::SOURCE_PROXY_SCRIPT_DECIDER)), |
90 net_log, NetLog::SOURCE_PROXY_SCRIPT_DECIDER)), | |
91 fetch_pac_bytes_(false), | 89 fetch_pac_bytes_(false), |
92 quick_check_enabled_(true) { | 90 quick_check_enabled_(true) { |
93 if (proxy_script_fetcher && | 91 if (proxy_script_fetcher && |
94 proxy_script_fetcher->GetRequestContext() && | 92 proxy_script_fetcher->GetRequestContext() && |
95 proxy_script_fetcher->GetRequestContext()->host_resolver()) { | 93 proxy_script_fetcher->GetRequestContext()->host_resolver()) { |
96 host_resolver_.reset(new SingleRequestHostResolver( | 94 host_resolver_.reset(new SingleRequestHostResolver( |
97 proxy_script_fetcher->GetRequestContext()->host_resolver())); | 95 proxy_script_fetcher->GetRequestContext()->host_resolver())); |
98 } | 96 } |
99 } | 97 } |
100 | 98 |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 } | 477 } |
480 | 478 |
481 // This is safe to call in any state. | 479 // This is safe to call in any state. |
482 if (dhcp_proxy_script_fetcher_) | 480 if (dhcp_proxy_script_fetcher_) |
483 dhcp_proxy_script_fetcher_->Cancel(); | 481 dhcp_proxy_script_fetcher_->Cancel(); |
484 | 482 |
485 DidComplete(); | 483 DidComplete(); |
486 } | 484 } |
487 | 485 |
488 } // namespace net | 486 } // namespace net |
OLD | NEW |