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_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/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 63 |
64 private: | 64 private: |
65 MockAsyncProxyResolverBase* resolver_; | 65 MockAsyncProxyResolverBase* resolver_; |
66 const scoped_refptr<ProxyResolverScriptData> script_data_; | 66 const scoped_refptr<ProxyResolverScriptData> script_data_; |
67 net::CompletionCallback callback_; | 67 net::CompletionCallback callback_; |
68 base::MessageLoop* origin_loop_; | 68 base::MessageLoop* origin_loop_; |
69 }; | 69 }; |
70 | 70 |
71 typedef std::vector<scoped_refptr<Request> > RequestsList; | 71 typedef std::vector<scoped_refptr<Request> > RequestsList; |
72 | 72 |
73 virtual ~MockAsyncProxyResolverBase(); | 73 ~MockAsyncProxyResolverBase() override; |
74 | 74 |
75 // ProxyResolver implementation. | 75 // ProxyResolver implementation. |
76 virtual int GetProxyForURL(const GURL& url, | 76 int GetProxyForURL(const GURL& url, |
77 ProxyInfo* results, | 77 ProxyInfo* results, |
78 const net::CompletionCallback& callback, | 78 const net::CompletionCallback& callback, |
79 RequestHandle* request_handle, | 79 RequestHandle* request_handle, |
80 const BoundNetLog& /*net_log*/) override; | 80 const BoundNetLog& /*net_log*/) override; |
81 virtual void CancelRequest(RequestHandle request_handle) override; | 81 void CancelRequest(RequestHandle request_handle) override; |
82 virtual LoadState GetLoadState(RequestHandle request_handle) const override; | 82 LoadState GetLoadState(RequestHandle request_handle) const override; |
83 virtual int SetPacScript( | 83 int SetPacScript(const scoped_refptr<ProxyResolverScriptData>& script_data, |
84 const scoped_refptr<ProxyResolverScriptData>& script_data, | 84 const net::CompletionCallback& callback) override; |
85 const net::CompletionCallback& callback) override; | 85 void CancelSetPacScript() override; |
86 virtual void CancelSetPacScript() override; | |
87 | 86 |
88 const RequestsList& pending_requests() const { | 87 const RequestsList& pending_requests() const { |
89 return pending_requests_; | 88 return pending_requests_; |
90 } | 89 } |
91 | 90 |
92 const RequestsList& cancelled_requests() const { | 91 const RequestsList& cancelled_requests() const { |
93 return cancelled_requests_; | 92 return cancelled_requests_; |
94 } | 93 } |
95 | 94 |
96 SetPacScriptRequest* pending_set_pac_script_request() const; | 95 SetPacScriptRequest* pending_set_pac_script_request() const; |
(...skipping 23 matching lines...) Expand all Loading... |
120 | 119 |
121 class MockAsyncProxyResolverExpectsBytes : public MockAsyncProxyResolverBase { | 120 class MockAsyncProxyResolverExpectsBytes : public MockAsyncProxyResolverBase { |
122 public: | 121 public: |
123 MockAsyncProxyResolverExpectsBytes() | 122 MockAsyncProxyResolverExpectsBytes() |
124 : MockAsyncProxyResolverBase(true /*expects_pac_bytes*/) {} | 123 : MockAsyncProxyResolverBase(true /*expects_pac_bytes*/) {} |
125 }; | 124 }; |
126 | 125 |
127 } // namespace net | 126 } // namespace net |
128 | 127 |
129 #endif // NET_PROXY_MOCK_PROXY_RESOLVER_H_ | 128 #endif // NET_PROXY_MOCK_PROXY_RESOLVER_H_ |
OLD | NEW |