| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 // Test code completes the request by calling request->CompleteNow(). | 70 // Test code completes the request by calling request->CompleteNow(). |
| 71 return ERR_IO_PENDING; | 71 return ERR_IO_PENDING; |
| 72 } | 72 } |
| 73 | 73 |
| 74 void MockAsyncProxyResolverBase::CancelRequest(RequestHandle request_handle) { | 74 void MockAsyncProxyResolverBase::CancelRequest(RequestHandle request_handle) { |
| 75 scoped_refptr<Request> request = reinterpret_cast<Request*>(request_handle); | 75 scoped_refptr<Request> request = reinterpret_cast<Request*>(request_handle); |
| 76 cancelled_requests_.push_back(request); | 76 cancelled_requests_.push_back(request); |
| 77 RemovePendingRequest(request); | 77 RemovePendingRequest(request); |
| 78 } | 78 } |
| 79 | 79 |
| 80 LoadState MockAsyncProxyResolverBase::GetLoadState( |
| 81 RequestHandle request_handle) const { |
| 82 NOTREACHED(); |
| 83 return LOAD_STATE_IDLE; |
| 84 } |
| 85 |
| 86 LoadState MockAsyncProxyResolverBase::GetLoadStateThreadSafe( |
| 87 RequestHandle request_handle) const { |
| 88 NOTREACHED(); |
| 89 return LOAD_STATE_IDLE; |
| 90 } |
| 91 |
| 80 int MockAsyncProxyResolverBase::SetPacScript( | 92 int MockAsyncProxyResolverBase::SetPacScript( |
| 81 const scoped_refptr<ProxyResolverScriptData>& script_data, | 93 const scoped_refptr<ProxyResolverScriptData>& script_data, |
| 82 OldCompletionCallback* callback) { | 94 OldCompletionCallback* callback) { |
| 83 DCHECK(!pending_set_pac_script_request_.get()); | 95 DCHECK(!pending_set_pac_script_request_.get()); |
| 84 pending_set_pac_script_request_.reset( | 96 pending_set_pac_script_request_.reset( |
| 85 new SetPacScriptRequest(this, script_data, callback)); | 97 new SetPacScriptRequest(this, script_data, callback)); |
| 86 // Finished when user calls SetPacScriptRequest::CompleteNow(). | 98 // Finished when user calls SetPacScriptRequest::CompleteNow(). |
| 87 return ERR_IO_PENDING; | 99 return ERR_IO_PENDING; |
| 88 } | 100 } |
| 89 | 101 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 106 void MockAsyncProxyResolverBase::RemovePendingSetPacScriptRequest( | 118 void MockAsyncProxyResolverBase::RemovePendingSetPacScriptRequest( |
| 107 SetPacScriptRequest* request) { | 119 SetPacScriptRequest* request) { |
| 108 DCHECK_EQ(request, pending_set_pac_script_request()); | 120 DCHECK_EQ(request, pending_set_pac_script_request()); |
| 109 pending_set_pac_script_request_.reset(); | 121 pending_set_pac_script_request_.reset(); |
| 110 } | 122 } |
| 111 | 123 |
| 112 MockAsyncProxyResolverBase::MockAsyncProxyResolverBase(bool expects_pac_bytes) | 124 MockAsyncProxyResolverBase::MockAsyncProxyResolverBase(bool expects_pac_bytes) |
| 113 : ProxyResolver(expects_pac_bytes) {} | 125 : ProxyResolver(expects_pac_bytes) {} |
| 114 | 126 |
| 115 } // namespace net | 127 } // namespace net |
| OLD | NEW |