Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1142)

Side by Side Diff: net/url_request/test_url_request_interceptor.cc

Issue 686343002: Add MaybeInterceptRedirect/Response to URLRequestInterceptor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698