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 "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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 } | 168 } |
169 | 169 |
170 ProtocolHandlerRegistry::JobInterceptorFactory::~JobInterceptorFactory() { | 170 ProtocolHandlerRegistry::JobInterceptorFactory::~JobInterceptorFactory() { |
171 } | 171 } |
172 | 172 |
173 void ProtocolHandlerRegistry::JobInterceptorFactory::Chain( | 173 void ProtocolHandlerRegistry::JobInterceptorFactory::Chain( |
174 scoped_ptr<net::URLRequestJobFactory> job_factory) { | 174 scoped_ptr<net::URLRequestJobFactory> job_factory) { |
175 job_factory_ = job_factory.Pass(); | 175 job_factory_ = job_factory.Pass(); |
176 } | 176 } |
177 | 177 |
178 bool ProtocolHandlerRegistry::JobInterceptorFactory::SetProtocolHandler( | |
179 const std::string& scheme, ProtocolHandler* protocol_handler) { | |
180 return job_factory_->SetProtocolHandler(scheme, protocol_handler); | |
181 } | |
182 | |
183 void ProtocolHandlerRegistry::JobInterceptorFactory::AddInterceptor( | |
184 Interceptor* interceptor) { | |
185 return job_factory_->AddInterceptor(interceptor); | |
186 } | |
187 | |
188 net::URLRequestJob* | 178 net::URLRequestJob* |
189 ProtocolHandlerRegistry::JobInterceptorFactory::MaybeCreateJobWithInterceptor( | 179 ProtocolHandlerRegistry::JobInterceptorFactory::MaybeCreateJobWithInterceptor( |
190 net::URLRequest* request, net::NetworkDelegate* network_delegate) const { | 180 net::URLRequest* request, net::NetworkDelegate* network_delegate) const { |
191 return job_factory_->MaybeCreateJobWithInterceptor(request, network_delegate); | 181 return job_factory_->MaybeCreateJobWithInterceptor(request, network_delegate); |
192 } | 182 } |
193 | 183 |
194 net::URLRequestJob* | 184 net::URLRequestJob* |
195 ProtocolHandlerRegistry::JobInterceptorFactory:: | 185 ProtocolHandlerRegistry::JobInterceptorFactory:: |
196 MaybeCreateJobWithProtocolHandler( | 186 MaybeCreateJobWithProtocolHandler( |
197 const std::string& scheme, | 187 const std::string& scheme, |
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
901 | 891 |
902 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> | 892 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> |
903 ProtocolHandlerRegistry::CreateJobInterceptorFactory() { | 893 ProtocolHandlerRegistry::CreateJobInterceptorFactory() { |
904 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 894 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
905 // this is always created on the UI thread (in profile_io's | 895 // this is always created on the UI thread (in profile_io's |
906 // InitializeOnUIThread. Any method calls must be done | 896 // InitializeOnUIThread. Any method calls must be done |
907 // on the IO thread (this is checked). | 897 // on the IO thread (this is checked). |
908 return scoped_ptr<JobInterceptorFactory>(new JobInterceptorFactory( | 898 return scoped_ptr<JobInterceptorFactory>(new JobInterceptorFactory( |
909 io_thread_delegate_)); | 899 io_thread_delegate_)); |
910 } | 900 } |
OLD | NEW |