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

Unified Diff: chrome/browser/profiles/off_the_record_profile_io_data.cc

Issue 11669012: Convert ProtocolHandlerRegistry::Interceptor to a net::URLRequestJobFactory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address jhawkins' comments Created 7 years, 11 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/profiles/off_the_record_profile_io_data.cc
diff --git a/chrome/browser/profiles/off_the_record_profile_io_data.cc b/chrome/browser/profiles/off_the_record_profile_io_data.cc
index 37a3f730327a6717ddbd82040f930e06aab452bf..615a752f2e7513512a3d189bac77e961b2bfef56 100644
--- a/chrome/browser/profiles/off_the_record_profile_io_data.cc
+++ b/chrome/browser/profiles/off_the_record_profile_io_data.cc
@@ -119,10 +119,10 @@ OffTheRecordProfileIOData::Handle::GetIsolatedAppRequestContextGetter(
if (iter != app_request_context_getter_map_.end())
return iter->second;
- scoped_ptr<net::URLRequestJobFactory::Interceptor>
+ scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
protocol_handler_interceptor(
ProtocolHandlerRegistryFactory::GetForProfile(profile_)->
- CreateURLInterceptor());
+ CreateJobInterceptorFactory());
ChromeURLRequestContextGetter* context =
ChromeURLRequestContextGetter::CreateOffTheRecordForIsolatedApp(
profile_, io_data_, descriptor,
@@ -218,13 +218,12 @@ void OffTheRecordProfileIOData::LazyInitializeInternal(
scoped_ptr<net::URLRequestJobFactoryImpl> main_job_factory(
new net::URLRequestJobFactoryImpl());
- SetUpJobFactoryDefaults(
- main_job_factory.get(),
+ main_job_factory_ = SetUpJobFactoryDefaults(
+ main_job_factory.Pass(),
profile_params->protocol_handler_interceptor.Pass(),
network_delegate(),
main_context->ftp_transaction_factory(),
main_context->ftp_auth_cache());
- main_job_factory_ = main_job_factory.Pass();
main_context->set_job_factory(main_job_factory_.get());
#if defined(ENABLE_EXTENSIONS)
@@ -271,13 +270,12 @@ void OffTheRecordProfileIOData::
// job_factory::IsHandledProtocol return true, which prevents attempts to
// handle the protocol externally. We pass NULL in to
// SetUpJobFactoryDefaults() to get this effect.
- SetUpJobFactoryDefaults(
- extensions_job_factory.get(),
- scoped_ptr<net::URLRequestJobFactoryImpl::Interceptor>(NULL),
+ extensions_job_factory_ = SetUpJobFactoryDefaults(
+ extensions_job_factory.Pass(),
+ scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>(NULL),
NULL,
extensions_context->ftp_transaction_factory(),
extensions_context->ftp_auth_cache());
- extensions_job_factory_ = extensions_job_factory.Pass();
extensions_context->set_job_factory(extensions_job_factory_.get());
}
@@ -285,7 +283,7 @@ ChromeURLRequestContext*
OffTheRecordProfileIOData::InitializeAppRequestContext(
ChromeURLRequestContext* main_context,
const StoragePartitionDescriptor& partition_descriptor,
- scoped_ptr<net::URLRequestJobFactory::Interceptor>
+ scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
protocol_handler_interceptor) const {
AppRequestContext* context = new AppRequestContext(load_time_stats());
@@ -309,12 +307,13 @@ OffTheRecordProfileIOData::InitializeAppRequestContext(
scoped_ptr<net::URLRequestJobFactoryImpl> job_factory(
new net::URLRequestJobFactoryImpl());
- SetUpJobFactoryDefaults(job_factory.get(),
- protocol_handler_interceptor.Pass(),
- network_delegate(),
- context->ftp_transaction_factory(),
- context->ftp_auth_cache());
- context->SetJobFactory(job_factory.PassAs<net::URLRequestJobFactory>());
+ scoped_ptr<net::URLRequestJobFactory> top_job_factory;
+ top_job_factory = SetUpJobFactoryDefaults(job_factory.Pass(),
+ protocol_handler_interceptor.Pass(),
+ network_delegate(),
+ context->ftp_transaction_factory(),
+ context->ftp_auth_cache());
+ context->SetJobFactory(top_job_factory.Pass());
return context;
}
@@ -336,7 +335,7 @@ ChromeURLRequestContext*
OffTheRecordProfileIOData::AcquireIsolatedAppRequestContext(
ChromeURLRequestContext* main_context,
const StoragePartitionDescriptor& partition_descriptor,
- scoped_ptr<net::URLRequestJobFactory::Interceptor>
+ scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
protocol_handler_interceptor) const {
// We create per-app contexts on demand, unlike the others above.
ChromeURLRequestContext* app_request_context =
« no previous file with comments | « chrome/browser/profiles/off_the_record_profile_io_data.h ('k') | chrome/browser/profiles/profile_impl_io_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698