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 #ifndef NET_PROXY_DHCP_PROXY_SCRIPT_FETCHER_WIN_H_ | 5 #ifndef NET_PROXY_DHCP_PROXY_SCRIPT_FETCHER_WIN_H_ |
6 #define NET_PROXY_DHCP_PROXY_SCRIPT_FETCHER_WIN_H_ | 6 #define NET_PROXY_DHCP_PROXY_SCRIPT_FETCHER_WIN_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/threading/non_thread_safe.h" | 15 #include "base/threading/thread_checker.h" |
16 #include "base/time/time.h" | 16 #include "base/time/time.h" |
17 #include "base/timer/timer.h" | 17 #include "base/timer/timer.h" |
18 #include "net/base/net_export.h" | 18 #include "net/base/net_export.h" |
19 #include "net/proxy/dhcp_proxy_script_fetcher.h" | 19 #include "net/proxy/dhcp_proxy_script_fetcher.h" |
20 | 20 |
21 namespace base { | 21 namespace base { |
22 class SequencedWorkerPool; | 22 class SequencedWorkerPool; |
23 class TaskRunner; | 23 class TaskRunner; |
24 } | 24 } |
25 | 25 |
26 namespace net { | 26 namespace net { |
27 | 27 |
28 class DhcpProxyScriptAdapterFetcher; | 28 class DhcpProxyScriptAdapterFetcher; |
29 class URLRequestContext; | 29 class URLRequestContext; |
30 | 30 |
31 // Windows-specific implementation. | 31 // Windows-specific implementation. |
32 class NET_EXPORT_PRIVATE DhcpProxyScriptFetcherWin | 32 class NET_EXPORT_PRIVATE DhcpProxyScriptFetcherWin |
33 : public DhcpProxyScriptFetcher, | 33 : public DhcpProxyScriptFetcher, |
34 public base::SupportsWeakPtr<DhcpProxyScriptFetcherWin>, | 34 public base::SupportsWeakPtr<DhcpProxyScriptFetcherWin> { |
35 NON_EXPORTED_BASE(public base::NonThreadSafe) { | |
36 public: | 35 public: |
37 // Creates a DhcpProxyScriptFetcherWin that issues requests through | 36 // Creates a DhcpProxyScriptFetcherWin that issues requests through |
38 // |url_request_context|. |url_request_context| must remain valid for | 37 // |url_request_context|. |url_request_context| must remain valid for |
39 // the lifetime of DhcpProxyScriptFetcherWin. | 38 // the lifetime of DhcpProxyScriptFetcherWin. |
40 explicit DhcpProxyScriptFetcherWin(URLRequestContext* url_request_context); | 39 explicit DhcpProxyScriptFetcherWin(URLRequestContext* url_request_context); |
41 ~DhcpProxyScriptFetcherWin() override; | 40 ~DhcpProxyScriptFetcherWin() override; |
42 | 41 |
43 // DhcpProxyScriptFetcher implementation. | 42 // DhcpProxyScriptFetcher implementation. |
44 int Fetch(base::string16* utf16_text, | 43 int Fetch(base::string16* utf16_text, |
45 const CompletionCallback& callback) override; | 44 const CompletionCallback& callback) override; |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 170 |
172 // NULL or the AdapterQuery currently in flight. | 171 // NULL or the AdapterQuery currently in flight. |
173 scoped_refptr<AdapterQuery> last_query_; | 172 scoped_refptr<AdapterQuery> last_query_; |
174 | 173 |
175 // Time |Fetch()| was last called, 0 if never. | 174 // Time |Fetch()| was last called, 0 if never. |
176 base::TimeTicks fetch_start_time_; | 175 base::TimeTicks fetch_start_time_; |
177 | 176 |
178 // Worker pool we use for all DHCP lookup tasks. | 177 // Worker pool we use for all DHCP lookup tasks. |
179 scoped_refptr<base::SequencedWorkerPool> worker_pool_; | 178 scoped_refptr<base::SequencedWorkerPool> worker_pool_; |
180 | 179 |
| 180 THREAD_CHECKER(thread_checker_); |
| 181 |
181 DISALLOW_IMPLICIT_CONSTRUCTORS(DhcpProxyScriptFetcherWin); | 182 DISALLOW_IMPLICIT_CONSTRUCTORS(DhcpProxyScriptFetcherWin); |
182 }; | 183 }; |
183 | 184 |
184 } // namespace net | 185 } // namespace net |
185 | 186 |
186 #endif // NET_PROXY_DHCP_PROXY_SCRIPT_FETCHER_WIN_H_ | 187 #endif // NET_PROXY_DHCP_PROXY_SCRIPT_FETCHER_WIN_H_ |
OLD | NEW |