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

Unified Diff: content/browser/storage_partition_impl_map.cc

Issue 11896113: Add chrome-search: access from Instant overlay (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Charlie's comments. Created 7 years, 10 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: content/browser/storage_partition_impl_map.cc
diff --git a/content/browser/storage_partition_impl_map.cc b/content/browser/storage_partition_impl_map.cc
index dedb5a0ca6ab95bb655776ac158ad86f89b3d007..683d77c0973893ba9ba89072c08cfce30ae4e6ef 100644
--- a/content/browser/storage_partition_impl_map.cc
+++ b/content/browser/storage_partition_impl_map.cc
@@ -447,23 +447,38 @@ StoragePartitionImpl* StoragePartitionImplMap::Get(
ChromeBlobStorageContext* blob_storage_context =
ChromeBlobStorageContext::GetFor(browser_context_);
- scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> blob_protocol_handler(
- new BlobProtocolHandler(blob_storage_context,
- partition->GetFileSystemContext()));
- scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
- file_system_protocol_handler(
- CreateFileSystemProtocolHandler(partition->GetFileSystemContext()));
scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
developer_protocol_handler(
new DeveloperProtocolHandler(partition->GetAppCacheService(),
blob_storage_context));
- scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
- chrome_protocol_handler(
+
+ ProtocolHandlerMap protocol_handlers;
+ protocol_handlers[chrome::kBlobScheme] =
+ linked_ptr<net::URLRequestJobFactory::ProtocolHandler>(
+ new BlobProtocolHandler(blob_storage_context,
+ partition->GetFileSystemContext()));
+ protocol_handlers[chrome::kFileSystemScheme] =
+ linked_ptr<net::URLRequestJobFactory::ProtocolHandler>(
+ CreateFileSystemProtocolHandler(partition->GetFileSystemContext()));
+ protocol_handlers[chrome::kChromeUIScheme] =
+ linked_ptr<net::URLRequestJobFactory::ProtocolHandler>(
URLDataManagerBackend::CreateProtocolHandler(
browser_context_->GetResourceContext(),
browser_context_->IsOffTheRecord()));
- scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
- chrome_devtools_protocol_handler(
+ std::vector<std::string> additional_webui_schemes =
+ GetContentClient()->browser()->GetAdditionalWebUISchemes();
+ for (std::vector<std::string>::const_iterator it =
+ additional_webui_schemes.begin();
+ it != additional_webui_schemes.end();
+ ++it) {
+ protocol_handlers[*it] =
+ linked_ptr<net::URLRequestJobFactory::ProtocolHandler>(
+ URLDataManagerBackend::CreateProtocolHandler(
+ browser_context_->GetResourceContext(),
+ browser_context_->IsOffTheRecord()));
+ }
+ protocol_handlers[chrome::kChromeDevToolsScheme] =
+ linked_ptr<net::URLRequestJobFactory::ProtocolHandler>(
CreateDevToolsProtocolHandler(browser_context_->GetResourceContext(),
browser_context_->IsOffTheRecord()));
@@ -471,16 +486,12 @@ StoragePartitionImpl* StoragePartitionImplMap::Get(
if (partition_domain.empty()) {
partition->SetURLRequestContext(
GetContentClient()->browser()->CreateRequestContext(browser_context_,
- blob_protocol_handler.Pass(), file_system_protocol_handler.Pass(),
- developer_protocol_handler.Pass(), chrome_protocol_handler.Pass(),
- chrome_devtools_protocol_handler.Pass()));
+ developer_protocol_handler.Pass(), &protocol_handlers));
} else {
partition->SetURLRequestContext(
GetContentClient()->browser()->CreateRequestContextForStoragePartition(
browser_context_, partition->GetPath(), in_memory,
- blob_protocol_handler.Pass(), file_system_protocol_handler.Pass(),
- developer_protocol_handler.Pass(), chrome_protocol_handler.Pass(),
- chrome_devtools_protocol_handler.Pass()));
+ developer_protocol_handler.Pass(), &protocol_handlers));
}
partition->SetMediaURLRequestContext(
partition_domain.empty() ?

Powered by Google App Engine
This is Rietveld 408576698