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 #include "net/proxy/mock_proxy_resolver.h" | 5 #include "net/proxy/mock_proxy_resolver.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 | 9 |
10 namespace net { | 10 namespace net { |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 cancelled_requests_.push_back(request); | 72 cancelled_requests_.push_back(request); |
73 RemovePendingRequest(request); | 73 RemovePendingRequest(request); |
74 } | 74 } |
75 | 75 |
76 LoadState MockAsyncProxyResolverBase::GetLoadState( | 76 LoadState MockAsyncProxyResolverBase::GetLoadState( |
77 RequestHandle request_handle) const { | 77 RequestHandle request_handle) const { |
78 NOTREACHED(); | 78 NOTREACHED(); |
79 return LOAD_STATE_IDLE; | 79 return LOAD_STATE_IDLE; |
80 } | 80 } |
81 | 81 |
82 LoadState MockAsyncProxyResolverBase::GetLoadStateThreadSafe( | |
83 RequestHandle request_handle) const { | |
84 NOTREACHED(); | |
85 return LOAD_STATE_IDLE; | |
86 } | |
87 | |
88 int MockAsyncProxyResolverBase::SetPacScript( | 82 int MockAsyncProxyResolverBase::SetPacScript( |
89 const scoped_refptr<ProxyResolverScriptData>& script_data, | 83 const scoped_refptr<ProxyResolverScriptData>& script_data, |
90 const CompletionCallback& callback) { | 84 const CompletionCallback& callback) { |
91 DCHECK(!pending_set_pac_script_request_.get()); | 85 DCHECK(!pending_set_pac_script_request_.get()); |
92 pending_set_pac_script_request_.reset( | 86 pending_set_pac_script_request_.reset( |
93 new SetPacScriptRequest(this, script_data, callback)); | 87 new SetPacScriptRequest(this, script_data, callback)); |
94 // Finished when user calls SetPacScriptRequest::CompleteNow(). | 88 // Finished when user calls SetPacScriptRequest::CompleteNow(). |
95 return ERR_IO_PENDING; | 89 return ERR_IO_PENDING; |
96 } | 90 } |
97 | 91 |
(...skipping 16 matching lines...) Expand all Loading... |
114 void MockAsyncProxyResolverBase::RemovePendingSetPacScriptRequest( | 108 void MockAsyncProxyResolverBase::RemovePendingSetPacScriptRequest( |
115 SetPacScriptRequest* request) { | 109 SetPacScriptRequest* request) { |
116 DCHECK_EQ(request, pending_set_pac_script_request()); | 110 DCHECK_EQ(request, pending_set_pac_script_request()); |
117 pending_set_pac_script_request_.reset(); | 111 pending_set_pac_script_request_.reset(); |
118 } | 112 } |
119 | 113 |
120 MockAsyncProxyResolverBase::MockAsyncProxyResolverBase(bool expects_pac_bytes) | 114 MockAsyncProxyResolverBase::MockAsyncProxyResolverBase(bool expects_pac_bytes) |
121 : ProxyResolver(expects_pac_bytes) {} | 115 : ProxyResolver(expects_pac_bytes) {} |
122 | 116 |
123 } // namespace net | 117 } // namespace net |
OLD | NEW |