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

Side by Side Diff: content/browser/loader/resource_dispatcher_host_unittest.cc

Issue 686343002: Add MaybeInterceptRedirect/Response to URLRequestInterceptor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Chained factory interfaces 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 <vector> 5 #include <vector>
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 485
486 void SetNetworkStartNotificationJobGeneration(bool notification) { 486 void SetNetworkStartNotificationJobGeneration(bool notification) {
487 network_start_notification_ = notification; 487 network_start_notification_ = notification;
488 } 488 }
489 489
490 net::URLRequestJob* MaybeCreateJobWithProtocolHandler( 490 net::URLRequestJob* MaybeCreateJobWithProtocolHandler(
491 const std::string& scheme, 491 const std::string& scheme,
492 net::URLRequest* request, 492 net::URLRequest* request,
493 net::NetworkDelegate* network_delegate) const override; 493 net::NetworkDelegate* network_delegate) const override;
494 494
495 net::URLRequestJob* MaybeInterceptRedirect(
496 net::URLRequest* request,
497 net::NetworkDelegate* network_delegate,
498 const GURL& location) const override;
michaeln 2014/11/06 21:07:46 maybe inline these one-liners to return nullptr
bengr 2014/11/06 23:58:01 Acknowledged.
499
500 net::URLRequestJob* MaybeInterceptResponse(
501 net::URLRequest* request,
502 net::NetworkDelegate* network_delegate) const override;
503
495 bool IsHandledProtocol(const std::string& scheme) const override { 504 bool IsHandledProtocol(const std::string& scheme) const override {
496 return supported_schemes_.count(scheme) > 0; 505 return supported_schemes_.count(scheme) > 0;
497 } 506 }
498 507
499 bool IsHandledURL(const GURL& url) const override { 508 bool IsHandledURL(const GURL& url) const override {
500 return supported_schemes_.count(url.scheme()) > 0; 509 return supported_schemes_.count(url.scheme()) > 0;
501 } 510 }
502 511
503 bool IsSafeRedirectTarget(const GURL& location) const override { 512 bool IsSafeRedirectTarget(const GURL& location) const override {
504 return false; 513 return false;
(...skipping 2488 matching lines...) Expand 10 before | Expand all | Expand 10 after
2993 false); 3002 false);
2994 } else { 3003 } else {
2995 return new net::URLRequestTestJob( 3004 return new net::URLRequestTestJob(
2996 request, network_delegate, 3005 request, network_delegate,
2997 test_fixture_->response_headers_, test_fixture_->response_data_, 3006 test_fixture_->response_headers_, test_fixture_->response_data_,
2998 false); 3007 false);
2999 } 3008 }
3000 } 3009 }
3001 } 3010 }
3002 3011
3012 net::URLRequestJob* TestURLRequestJobFactory::MaybeInterceptRedirect(
3013 net::URLRequest* request,
3014 net::NetworkDelegate* network_delegate,
3015 const GURL& location) const {
3016 return nullptr;
3017 }
3018
3019 net::URLRequestJob* TestURLRequestJobFactory::MaybeInterceptResponse(
3020 net::URLRequest* request,
3021 net::NetworkDelegate* network_delegate) const {
3022 return nullptr;
3023 }
3024
3003 } // namespace content 3025 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698