Index: chrome/browser/net/chrome_url_request_context.cc |
diff --git a/chrome/browser/net/chrome_url_request_context.cc b/chrome/browser/net/chrome_url_request_context.cc |
index 1ab503448c757266ae6237edf649a601078afb46..15b025c769b9e77b61f2520eebb96191eca1d93e 100644 |
--- a/chrome/browser/net/chrome_url_request_context.cc |
+++ b/chrome/browser/net/chrome_url_request_context.cc |
@@ -41,19 +41,22 @@ class FactoryForMain : public ChromeURLRequestContextFactory { |
public: |
FactoryForMain( |
const ProfileIOData* profile_io_data, |
- content::ProtocolHandlerMap* protocol_handlers) |
- : profile_io_data_(profile_io_data) { |
+ content::ProtocolHandlerMap* protocol_handlers, |
+ content::ProtocolHandlerScopedVector protocol_interceptors) |
+ : profile_io_data_(profile_io_data), |
+ protocol_interceptors_(protocol_interceptors.Pass()) { |
std::swap(protocol_handlers_, *protocol_handlers); |
} |
virtual ChromeURLRequestContext* Create() OVERRIDE { |
- profile_io_data_->Init(&protocol_handlers_); |
+ profile_io_data_->Init(&protocol_handlers_, protocol_interceptors_.Pass()); |
return profile_io_data_->GetMainRequestContext(); |
} |
private: |
const ProfileIOData* const profile_io_data_; |
content::ProtocolHandlerMap protocol_handlers_; |
+ content::ProtocolHandlerScopedVector protocol_interceptors_; |
}; |
// Factory that creates the ChromeURLRequestContext for extensions. |
@@ -79,11 +82,13 @@ class FactoryForIsolatedApp : public ChromeURLRequestContextFactory { |
ChromeURLRequestContextGetter* main_context, |
scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> |
protocol_handler_interceptor, |
- content::ProtocolHandlerMap* protocol_handlers) |
+ content::ProtocolHandlerMap* protocol_handlers, |
+ content::ProtocolHandlerScopedVector protocol_interceptors) |
: profile_io_data_(profile_io_data), |
partition_descriptor_(partition_descriptor), |
main_request_context_getter_(main_context), |
- protocol_handler_interceptor_(protocol_handler_interceptor.Pass()) { |
+ protocol_handler_interceptor_(protocol_handler_interceptor.Pass()), |
+ protocol_interceptors_(protocol_interceptors.Pass()) { |
std::swap(protocol_handlers_, *protocol_handlers); |
} |
@@ -97,7 +102,8 @@ class FactoryForIsolatedApp : public ChromeURLRequestContextFactory { |
main_request_context_getter_->GetURLRequestContext(), |
partition_descriptor_, |
protocol_handler_interceptor_.Pass(), |
- &protocol_handlers_); |
+ &protocol_handlers_, |
+ protocol_interceptors_.Pass()); |
} |
private: |
@@ -108,6 +114,7 @@ class FactoryForIsolatedApp : public ChromeURLRequestContextFactory { |
scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> |
protocol_handler_interceptor_; |
content::ProtocolHandlerMap protocol_handlers_; |
+ content::ProtocolHandlerScopedVector protocol_interceptors_; |
}; |
// Factory that creates the media ChromeURLRequestContext for a given isolated |
@@ -195,9 +202,12 @@ ChromeURLRequestContextGetter::GetNetworkTaskRunner() const { |
ChromeURLRequestContextGetter* ChromeURLRequestContextGetter::Create( |
Profile* profile, |
const ProfileIOData* profile_io_data, |
- content::ProtocolHandlerMap* protocol_handlers) { |
+ content::ProtocolHandlerMap* protocol_handlers, |
+ content::ProtocolHandlerScopedVector protocol_interceptors) { |
return new ChromeURLRequestContextGetter( |
- new FactoryForMain(profile_io_data, protocol_handlers)); |
+ new FactoryForMain(profile_io_data, |
+ protocol_handlers, |
+ protocol_interceptors.Pass())); |
} |
// static |
@@ -224,14 +234,16 @@ ChromeURLRequestContextGetter::CreateForIsolatedApp( |
const StoragePartitionDescriptor& partition_descriptor, |
scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> |
protocol_handler_interceptor, |
- content::ProtocolHandlerMap* protocol_handlers) { |
+ content::ProtocolHandlerMap* protocol_handlers, |
+ content::ProtocolHandlerScopedVector protocol_interceptors) { |
ChromeURLRequestContextGetter* main_context = |
static_cast<ChromeURLRequestContextGetter*>(profile->GetRequestContext()); |
return new ChromeURLRequestContextGetter( |
new FactoryForIsolatedApp(profile_io_data, partition_descriptor, |
main_context, |
protocol_handler_interceptor.Pass(), |
- protocol_handlers)); |
+ protocol_handlers, |
+ protocol_interceptors.Pass())); |
} |
// static |