OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_MOCK_PROXY_RESOLVER_H_ | 5 #ifndef NET_PROXY_MOCK_PROXY_RESOLVER_H_ |
6 #define NET_PROXY_MOCK_PROXY_RESOLVER_H_ | 6 #define NET_PROXY_MOCK_PROXY_RESOLVER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 MessageLoop* origin_loop_; | 90 MessageLoop* origin_loop_; |
91 }; | 91 }; |
92 | 92 |
93 typedef std::vector<scoped_refptr<Request> > RequestsList; | 93 typedef std::vector<scoped_refptr<Request> > RequestsList; |
94 | 94 |
95 // ProxyResolver implementation: | 95 // ProxyResolver implementation: |
96 virtual int GetProxyForURL(const GURL& url, | 96 virtual int GetProxyForURL(const GURL& url, |
97 ProxyInfo* results, | 97 ProxyInfo* results, |
98 CompletionCallback* callback, | 98 CompletionCallback* callback, |
99 RequestHandle* request_handle, | 99 RequestHandle* request_handle, |
100 LoadLog* /*load_log*/) { | 100 const BoundNetLog& /*net_log*/) { |
101 scoped_refptr<Request> request = new Request(this, url, results, callback); | 101 scoped_refptr<Request> request = new Request(this, url, results, callback); |
102 pending_requests_.push_back(request); | 102 pending_requests_.push_back(request); |
103 | 103 |
104 if (request_handle) | 104 if (request_handle) |
105 *request_handle = reinterpret_cast<RequestHandle>(request.get()); | 105 *request_handle = reinterpret_cast<RequestHandle>(request.get()); |
106 | 106 |
107 // Test code completes the request by calling request->CompleteNow(). | 107 // Test code completes the request by calling request->CompleteNow(). |
108 return ERR_IO_PENDING; | 108 return ERR_IO_PENDING; |
109 } | 109 } |
110 | 110 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 | 170 |
171 class MockAsyncProxyResolverExpectsBytes : public MockAsyncProxyResolverBase { | 171 class MockAsyncProxyResolverExpectsBytes : public MockAsyncProxyResolverBase { |
172 public: | 172 public: |
173 MockAsyncProxyResolverExpectsBytes() | 173 MockAsyncProxyResolverExpectsBytes() |
174 : MockAsyncProxyResolverBase(true /*expects_pac_bytes*/) {} | 174 : MockAsyncProxyResolverBase(true /*expects_pac_bytes*/) {} |
175 }; | 175 }; |
176 | 176 |
177 } // namespace net | 177 } // namespace net |
178 | 178 |
179 #endif // NET_PROXY_MOCK_PROXY_RESOLVER_H_ | 179 #endif // NET_PROXY_MOCK_PROXY_RESOLVER_H_ |
OLD | NEW |