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

Side by Side Diff: chrome/browser/custom_handlers/protocol_handler_registry.cc

Issue 686343002: Add MaybeInterceptRedirect/Response to URLRequestInterceptor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed next_states_ 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 "chrome/browser/custom_handlers/protocol_handler_registry.h" 5 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 net::NetworkDelegate* network_delegate) const { 183 net::NetworkDelegate* network_delegate) const {
184 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 184 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
185 net::URLRequestJob* job = io_thread_delegate_->MaybeCreateJob( 185 net::URLRequestJob* job = io_thread_delegate_->MaybeCreateJob(
186 request, network_delegate); 186 request, network_delegate);
187 if (job) 187 if (job)
188 return job; 188 return job;
189 return job_factory_->MaybeCreateJobWithProtocolHandler( 189 return job_factory_->MaybeCreateJobWithProtocolHandler(
190 scheme, request, network_delegate); 190 scheme, request, network_delegate);
191 } 191 }
192 192
193 net::URLRequestJob*
194 ProtocolHandlerRegistry::JobInterceptorFactory::MaybeInterceptRedirect(
195 net::URLRequest* request,
196 net::NetworkDelegate* network_delegate,
197 const GURL& location) const {
198 return NULL;
199 }
200
201 net::URLRequestJob*
202 ProtocolHandlerRegistry::JobInterceptorFactory::MaybeInterceptResponse(
203 net::URLRequest* request,
204 net::NetworkDelegate* network_delegate) const {
205 return NULL;
206 }
207
193 bool ProtocolHandlerRegistry::JobInterceptorFactory::IsHandledProtocol( 208 bool ProtocolHandlerRegistry::JobInterceptorFactory::IsHandledProtocol(
194 const std::string& scheme) const { 209 const std::string& scheme) const {
195 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 210 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
196 return io_thread_delegate_->IsHandledProtocol(scheme) || 211 return io_thread_delegate_->IsHandledProtocol(scheme) ||
197 job_factory_->IsHandledProtocol(scheme); 212 job_factory_->IsHandledProtocol(scheme);
198 } 213 }
199 214
200 bool ProtocolHandlerRegistry::JobInterceptorFactory::IsHandledURL( 215 bool ProtocolHandlerRegistry::JobInterceptorFactory::IsHandledURL(
201 const GURL& url) const { 216 const GURL& url) const {
202 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 217 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after
954 969
955 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> 970 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
956 ProtocolHandlerRegistry::CreateJobInterceptorFactory() { 971 ProtocolHandlerRegistry::CreateJobInterceptorFactory() {
957 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 972 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
958 // this is always created on the UI thread (in profile_io's 973 // this is always created on the UI thread (in profile_io's
959 // InitializeOnUIThread. Any method calls must be done 974 // InitializeOnUIThread. Any method calls must be done
960 // on the IO thread (this is checked). 975 // on the IO thread (this is checked).
961 return scoped_ptr<JobInterceptorFactory>( 976 return scoped_ptr<JobInterceptorFactory>(
962 new JobInterceptorFactory(io_thread_delegate_.get())); 977 new JobInterceptorFactory(io_thread_delegate_.get()));
963 } 978 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698