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

Side by Side Diff: net/url_request/url_request_test_util.h

Issue 11293252: Change Interceptors into URLRequestJobFactory::ProtocolHandlers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years 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 | Annotate | Revision Log
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 #ifndef NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ 5 #ifndef NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_
6 #define NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ 6 #define NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_
7 7
8 #include <stdlib.h> 8 #include <stdlib.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 private: 293 private:
294 static std::string value_; 294 static std::string value_;
295 const std::string old_value_; 295 const std::string old_value_;
296 const std::string new_value_; 296 const std::string new_value_;
297 297
298 DISALLOW_COPY_AND_ASSIGN(ScopedCustomUrlRequestTestHttpHost); 298 DISALLOW_COPY_AND_ASSIGN(ScopedCustomUrlRequestTestHttpHost);
299 }; 299 };
300 300
301 //----------------------------------------------------------------------------- 301 //-----------------------------------------------------------------------------
302 302
303 // A simple Interceptor that returns a pre-built URLRequestJob only once. 303 // A simple ProtocolHandler that returns a pre-built URLRequestJob only once.
304 class TestJobInterceptor : public URLRequestJobFactory::Interceptor { 304 class TestJobInterceptor : public URLRequestJobFactory::ProtocolHandler {
305 public: 305 public:
306 TestJobInterceptor(); 306 TestJobInterceptor();
307 307
308 virtual URLRequestJob* MaybeIntercept( 308 virtual URLRequestJob* MaybeCreateJob(
309 URLRequest* request,
310 NetworkDelegate* network_delegate) const OVERRIDE;
311 virtual URLRequestJob* MaybeInterceptRedirect(
312 const GURL& location,
313 URLRequest* request,
314 NetworkDelegate* network_delegate) const OVERRIDE;
315 virtual URLRequestJob* MaybeInterceptResponse(
316 URLRequest* request, 309 URLRequest* request,
317 NetworkDelegate* network_delegate) const OVERRIDE; 310 NetworkDelegate* network_delegate) const OVERRIDE;
318 void set_main_intercept_job(URLRequestJob* job); 311 void set_main_intercept_job(URLRequestJob* job);
319 312
320 private: 313 private:
321 mutable URLRequestJob* main_intercept_job_; 314 mutable URLRequestJob* main_intercept_job_;
322 }; 315 };
323 316
324 } // namespace net 317 } // namespace net
325 318
326 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ 319 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_
OLDNEW
« no previous file with comments | « net/url_request/url_request_filter_unittest.cc ('k') | net/url_request/url_request_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698