OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_MULTI_THREADED_PROXY_RESOLVER_H_ | 5 #ifndef NET_PROXY_MULTI_THREADED_PROXY_RESOLVER_H_ |
6 #define NET_PROXY_MULTI_THREADED_PROXY_RESOLVER_H_ | 6 #define NET_PROXY_MULTI_THREADED_PROXY_RESOLVER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <deque> | 9 #include <deque> |
10 #include <vector> | 10 #include <vector> |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
87 // | 87 // |
88 // The constructor takes ownership of |resolver_factory|. | 88 // The constructor takes ownership of |resolver_factory|. |
89 MultiThreadedProxyResolver(ProxyResolverFactory* resolver_factory, | 89 MultiThreadedProxyResolver(ProxyResolverFactory* resolver_factory, |
90 size_t max_num_threads); | 90 size_t max_num_threads); |
91 | 91 |
92 virtual ~MultiThreadedProxyResolver(); | 92 virtual ~MultiThreadedProxyResolver(); |
93 | 93 |
94 // ProxyResolver implementation: | 94 // ProxyResolver implementation: |
95 virtual int GetProxyForURL(const GURL& url, | 95 virtual int GetProxyForURL(const GURL& url, |
96 ProxyInfo* results, | 96 ProxyInfo* results, |
97 OldCompletionCallback* callback, | 97 const net::CompletionCallback& callback, |
James Hawkins
2011/12/17 23:50:55
Remove net:: here and elsewhere.
James Hawkins
2011/12/18 00:05:47
Done.
| |
98 RequestHandle* request, | 98 RequestHandle* request, |
99 const BoundNetLog& net_log) OVERRIDE; | 99 const BoundNetLog& net_log) OVERRIDE; |
100 virtual void CancelRequest(RequestHandle request) OVERRIDE; | 100 virtual void CancelRequest(RequestHandle request) OVERRIDE; |
101 virtual LoadState GetLoadState(RequestHandle request) const OVERRIDE; | 101 virtual LoadState GetLoadState(RequestHandle request) const OVERRIDE; |
102 virtual LoadState GetLoadStateThreadSafe( | 102 virtual LoadState GetLoadStateThreadSafe( |
103 RequestHandle request) const OVERRIDE; | 103 RequestHandle request) const OVERRIDE; |
104 virtual void CancelSetPacScript() OVERRIDE; | 104 virtual void CancelSetPacScript() OVERRIDE; |
105 virtual void PurgeMemory() OVERRIDE; | 105 virtual void PurgeMemory() OVERRIDE; |
106 virtual int SetPacScript( | 106 virtual int SetPacScript( |
107 const scoped_refptr<ProxyResolverScriptData>& script_data, | 107 const scoped_refptr<ProxyResolverScriptData>& script_data, |
108 OldCompletionCallback* callback) OVERRIDE; | 108 const net::CompletionCallback& callback) OVERRIDE; |
109 | 109 |
110 private: | 110 private: |
111 class Executor; | 111 class Executor; |
112 class Job; | 112 class Job; |
113 class SetPacScriptJob; | 113 class SetPacScriptJob; |
114 class GetProxyForURLJob; | 114 class GetProxyForURLJob; |
115 // FIFO queue of pending jobs waiting to be started. | 115 // FIFO queue of pending jobs waiting to be started. |
116 // TODO(eroman): Make this priority queue. | 116 // TODO(eroman): Make this priority queue. |
117 typedef std::deque<scoped_refptr<Job> > PendingJobsQueue; | 117 typedef std::deque<scoped_refptr<Job> > PendingJobsQueue; |
118 typedef std::vector<scoped_refptr<Executor> > ExecutorList; | 118 typedef std::vector<scoped_refptr<Executor> > ExecutorList; |
(...skipping 18 matching lines...) Expand all Loading... | |
137 const scoped_ptr<ProxyResolverFactory> resolver_factory_; | 137 const scoped_ptr<ProxyResolverFactory> resolver_factory_; |
138 const size_t max_num_threads_; | 138 const size_t max_num_threads_; |
139 PendingJobsQueue pending_jobs_; | 139 PendingJobsQueue pending_jobs_; |
140 ExecutorList executors_; | 140 ExecutorList executors_; |
141 scoped_refptr<ProxyResolverScriptData> current_script_data_; | 141 scoped_refptr<ProxyResolverScriptData> current_script_data_; |
142 }; | 142 }; |
143 | 143 |
144 } // namespace net | 144 } // namespace net |
145 | 145 |
146 #endif // NET_PROXY_MULTI_THREADED_PROXY_RESOLVER_H_ | 146 #endif // NET_PROXY_MULTI_THREADED_PROXY_RESOLVER_H_ |
OLD | NEW |