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

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

Issue 11896113: Add chrome-search: access from Instant overlay (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Yet another rebase Created 7 years, 9 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
« no previous file with comments | « chrome/browser/profiles/off_the_record_profile_io_data.h ('k') | chrome/browser/profiles/profile.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 dfe2a8b1e19b928a7da88394907faf3bccb9f12a..411de3a7d0c0197366297b66a21e89fa98d76c22 100644
--- a/chrome/browser/profiles/off_the_record_profile_io_data.cc
+++ b/chrome/browser/profiles/off_the_record_profile_io_data.cc
@@ -70,16 +70,7 @@ OffTheRecordProfileIOData::Handle::GetResourceContextNoInit() const {
scoped_refptr<ChromeURLRequestContextGetter>
OffTheRecordProfileIOData::Handle::CreateMainRequestContextGetter(
- scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
- blob_protocol_handler,
- scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
- file_system_protocol_handler,
- scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
- developer_protocol_handler,
- scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
- chrome_protocol_handler,
- scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
- chrome_devtools_protocol_handler) const {
+ content::ProtocolHandlerMap* protocol_handlers) const {
// TODO(oshima): Re-enable when ChromeOS only accesses the profile on the UI
// thread.
#if !defined(OS_CHROMEOS)
@@ -89,10 +80,7 @@ OffTheRecordProfileIOData::Handle::CreateMainRequestContextGetter(
DCHECK(!main_request_context_getter_);
main_request_context_getter_ =
ChromeURLRequestContextGetter::CreateOffTheRecord(
- profile_, io_data_, blob_protocol_handler.Pass(),
- file_system_protocol_handler.Pass(),
- developer_protocol_handler.Pass(), chrome_protocol_handler.Pass(),
- chrome_devtools_protocol_handler.Pass());
+ profile_, io_data_, protocol_handlers);
return main_request_context_getter_;
}
@@ -128,16 +116,7 @@ scoped_refptr<ChromeURLRequestContextGetter>
OffTheRecordProfileIOData::Handle::CreateIsolatedAppRequestContextGetter(
const base::FilePath& partition_path,
bool in_memory,
- scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
- blob_protocol_handler,
- scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
- file_system_protocol_handler,
- scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
- developer_protocol_handler,
- scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
- chrome_protocol_handler,
- scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
- chrome_devtools_protocol_handler) const {
+ content::ProtocolHandlerMap* protocol_handlers) const {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(!partition_path.empty());
LazyInitialize();
@@ -153,9 +132,7 @@ OffTheRecordProfileIOData::Handle::CreateIsolatedAppRequestContextGetter(
ChromeURLRequestContextGetter* context =
ChromeURLRequestContextGetter::CreateOffTheRecordForIsolatedApp(
profile_, io_data_, descriptor, protocol_handler_interceptor.Pass(),
- blob_protocol_handler.Pass(), file_system_protocol_handler.Pass(),
- developer_protocol_handler.Pass(), chrome_protocol_handler.Pass(),
- chrome_devtools_protocol_handler.Pass());
+ protocol_handlers);
app_request_context_getter_map_[descriptor] = context;
return context;
@@ -185,16 +162,7 @@ OffTheRecordProfileIOData::~OffTheRecordProfileIOData() {
void OffTheRecordProfileIOData::InitializeInternal(
ProfileParams* profile_params,
- scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
- blob_protocol_handler,
- scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
- file_system_protocol_handler,
- scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
- developer_protocol_handler,
- scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
- chrome_protocol_handler,
- scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
- chrome_devtools_protocol_handler) const {
+ content::ProtocolHandlerMap* protocol_handlers) const {
ChromeURLRequestContext* main_context = main_request_context();
IOThread* const io_thread = profile_params->io_thread;
@@ -254,27 +222,13 @@ void OffTheRecordProfileIOData::InitializeInternal(
scoped_ptr<net::URLRequestJobFactoryImpl> main_job_factory(
new net::URLRequestJobFactoryImpl());
- bool set_protocol = main_job_factory->SetProtocolHandler(
- chrome::kBlobScheme, blob_protocol_handler.release());
- DCHECK(set_protocol);
- set_protocol = main_job_factory->SetProtocolHandler(
- chrome::kFileSystemScheme, file_system_protocol_handler.release());
- DCHECK(set_protocol);
- set_protocol = main_job_factory->SetProtocolHandler(
- chrome::kChromeUIScheme, chrome_protocol_handler.release());
- DCHECK(set_protocol);
- set_protocol = main_job_factory->SetProtocolHandler(
- chrome::kChromeDevToolsScheme,
- chrome_devtools_protocol_handler.release());
- DCHECK(set_protocol);
+ InstallProtocolHandlers(main_job_factory.get(), protocol_handlers);
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_.reset(new net::ProtocolInterceptJobFactory(
- main_job_factory_.Pass(), developer_protocol_handler.Pass()));
main_context->set_job_factory(main_job_factory_.get());
#if defined(ENABLE_EXTENSIONS)
@@ -336,16 +290,7 @@ OffTheRecordProfileIOData::InitializeAppRequestContext(
const StoragePartitionDescriptor& partition_descriptor,
scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
protocol_handler_interceptor,
- scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
- blob_protocol_handler,
- scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
- file_system_protocol_handler,
- scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
- developer_protocol_handler,
- scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
- chrome_protocol_handler,
- scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
- chrome_devtools_protocol_handler) const {
+ content::ProtocolHandlerMap* protocol_handlers) const {
AppRequestContext* context = new AppRequestContext(load_time_stats());
// Copy most state from the main context.
@@ -368,27 +313,13 @@ OffTheRecordProfileIOData::InitializeAppRequestContext(
scoped_ptr<net::URLRequestJobFactoryImpl> job_factory(
new net::URLRequestJobFactoryImpl());
- bool set_protocol = job_factory->SetProtocolHandler(
- chrome::kBlobScheme, blob_protocol_handler.release());
- DCHECK(set_protocol);
- set_protocol = job_factory->SetProtocolHandler(
- chrome::kFileSystemScheme, file_system_protocol_handler.release());
- DCHECK(set_protocol);
- set_protocol = job_factory->SetProtocolHandler(
- chrome::kChromeUIScheme, chrome_protocol_handler.release());
- DCHECK(set_protocol);
- set_protocol = job_factory->SetProtocolHandler(
- chrome::kChromeDevToolsScheme,
- chrome_devtools_protocol_handler.release());
- DCHECK(set_protocol);
+ InstallProtocolHandlers(job_factory.get(), protocol_handlers);
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());
- top_job_factory.reset(new net::ProtocolInterceptJobFactory(
- top_job_factory.Pass(), developer_protocol_handler.Pass()));
context->SetJobFactory(top_job_factory.Pass());
return context;
}
@@ -413,25 +344,12 @@ OffTheRecordProfileIOData::AcquireIsolatedAppRequestContext(
const StoragePartitionDescriptor& partition_descriptor,
scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
protocol_handler_interceptor,
- scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
- blob_protocol_handler,
- scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
- file_system_protocol_handler,
- scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
- developer_protocol_handler,
- scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
- chrome_protocol_handler,
- scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
- chrome_devtools_protocol_handler) const {
+ content::ProtocolHandlerMap* protocol_handlers) const {
// We create per-app contexts on demand, unlike the others above.
ChromeURLRequestContext* app_request_context =
InitializeAppRequestContext(main_context, partition_descriptor,
protocol_handler_interceptor.Pass(),
- blob_protocol_handler.Pass(),
- file_system_protocol_handler.Pass(),
- developer_protocol_handler.Pass(),
- chrome_protocol_handler.Pass(),
- chrome_devtools_protocol_handler.Pass());
+ protocol_handlers);
DCHECK(app_request_context);
return app_request_context;
}
« no previous file with comments | « chrome/browser/profiles/off_the_record_profile_io_data.h ('k') | chrome/browser/profiles/profile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698