| 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 #include "net/url_request/test_url_request_interceptor.h" | 5 #include "net/url_request/test_url_request_interceptor.h" |
| 6 | 6 |
| 7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
| 8 #include "base/threading/sequenced_worker_pool.h" | 8 #include "base/threading/sequenced_worker_pool.h" |
| 9 #include "base/threading/thread_restrictions.h" | 9 #include "base/threading/thread_restrictions.h" |
| 10 #include "net/url_request/url_request.h" | 10 #include "net/url_request/url_request.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 } | 115 } |
| 116 { | 116 { |
| 117 base::AutoLock auto_lock(hit_count_lock_); | 117 base::AutoLock auto_lock(hit_count_lock_); |
| 118 ++hit_count_; | 118 ++hit_count_; |
| 119 } | 119 } |
| 120 | 120 |
| 121 return new TestURLRequestJob( | 121 return new TestURLRequestJob( |
| 122 request, network_delegate, it->second, worker_task_runner_); | 122 request, network_delegate, it->second, worker_task_runner_); |
| 123 } | 123 } |
| 124 | 124 |
| 125 net::URLRequestJob* MaybeInterceptResponse( |
| 126 net::URLRequest* request, |
| 127 net::NetworkDelegate* network_delegate) const override { |
| 128 return NULL; |
| 129 } |
| 130 |
| 131 net::URLRequestJob* MaybeInterceptRedirect( |
| 132 net::URLRequest* request, |
| 133 net::NetworkDelegate* network_delegate, |
| 134 const GURL& location) const override { |
| 135 return NULL; |
| 136 } |
| 137 |
| 125 const std::string scheme_; | 138 const std::string scheme_; |
| 126 const std::string hostname_; | 139 const std::string hostname_; |
| 127 | 140 |
| 128 const scoped_refptr<base::TaskRunner> network_task_runner_; | 141 const scoped_refptr<base::TaskRunner> network_task_runner_; |
| 129 const scoped_refptr<base::TaskRunner> worker_task_runner_; | 142 const scoped_refptr<base::TaskRunner> worker_task_runner_; |
| 130 | 143 |
| 131 ResponseMap responses_; | 144 ResponseMap responses_; |
| 132 ResponseMap ignore_query_responses_; | 145 ResponseMap ignore_query_responses_; |
| 133 | 146 |
| 134 mutable base::Lock hit_count_lock_; | 147 mutable base::Lock hit_count_lock_; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 LocalHostTestURLRequestInterceptor::LocalHostTestURLRequestInterceptor( | 203 LocalHostTestURLRequestInterceptor::LocalHostTestURLRequestInterceptor( |
| 191 const scoped_refptr<base::TaskRunner>& network_task_runner, | 204 const scoped_refptr<base::TaskRunner>& network_task_runner, |
| 192 const scoped_refptr<base::TaskRunner>& worker_task_runner) | 205 const scoped_refptr<base::TaskRunner>& worker_task_runner) |
| 193 : TestURLRequestInterceptor("http", | 206 : TestURLRequestInterceptor("http", |
| 194 "localhost", | 207 "localhost", |
| 195 network_task_runner, | 208 network_task_runner, |
| 196 worker_task_runner) { | 209 worker_task_runner) { |
| 197 } | 210 } |
| 198 | 211 |
| 199 } // namespace net | 212 } // namespace net |
| OLD | NEW |