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

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

Issue 11154006: Change initialization interface of URLRequestJobFactory objects. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Refactor to make better use of scoped_ptr. Created 8 years, 2 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 6cadb70c6d84945e0ff4211ef3a5cbd1d7be8bd1..8551c822650597f8e9e4827bce15c3e8061e930e 100644
--- a/chrome/browser/profiles/off_the_record_profile_io_data.cc
+++ b/chrome/browser/profiles/off_the_record_profile_io_data.cc
@@ -239,15 +239,18 @@ void OffTheRecordProfileIOData::LazyInitializeInternal(
main_context->set_chrome_url_data_manager_backend(
chrome_url_data_manager_backend());
- main_job_factory_.reset(new net::URLRequestJobFactoryImpl());
- extensions_job_factory_.reset(new net::URLRequestJobFactoryImpl());
+ scoped_ptr<net::URLRequestJobFactoryImpl> main_job_factory(
+ new net::URLRequestJobFactoryImpl());
+ scoped_ptr<net::URLRequestJobFactoryImpl> extensions_job_factory(
+ new net::URLRequestJobFactoryImpl());
SetUpJobFactoryDefaults(
- main_job_factory_.get(),
+ main_job_factory.get(),
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();
// TODO(shalev): The extensions_job_factory has a NULL NetworkDelegate.
// Without a network_delegate, this protocol handler will never
// handle file: requests, but as a side effect it makes
@@ -255,11 +258,12 @@ void OffTheRecordProfileIOData::LazyInitializeInternal(
// handle the protocol externally. We pass NULL in to
// SetUpJobFactoryDefaults() to get this effect.
SetUpJobFactoryDefaults(
- extensions_job_factory_.get(),
+ extensions_job_factory.get(),
scoped_ptr<net::URLRequestJobFactoryImpl::Interceptor>(NULL),
NULL,
extensions_context->ftp_transaction_factory(),
extensions_context->ftp_auth_cache());
+ extensions_job_factory_ = extensions_job_factory.Pass();
main_context->set_job_factory(main_job_factory_.get());
extensions_context->set_job_factory(extensions_job_factory_.get());
@@ -291,14 +295,14 @@ OffTheRecordProfileIOData::InitializeAppRequestContext(
context->SetHttpTransactionFactory(app_http_cache.Pass());
- scoped_ptr<net::URLRequestJobFactory> job_factory(
+ 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.Pass());
+ context->SetJobFactory(job_factory.PassAs<net::URLRequestJobFactory>());
return context;
}
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_impl_io_data.h » ('j') | chrome/browser/profiles/profile_io_data.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698