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

Unified Diff: content/shell/shell_content_browser_client.cc

Issue 11308362: Add StoragePartition's ProtocolHandlers at URLRequestContext construction time. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync (r179907) 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: content/shell/shell_content_browser_client.cc
diff --git a/content/shell/shell_content_browser_client.cc b/content/shell/shell_content_browser_client.cc
index ebed7514954e607a42952337aa65c2eed6701ac7..b3fed780994c2e7d519c4d945ceafcd77bee0ed9 100644
--- a/content/shell/shell_content_browser_client.cc
+++ b/content/shell/shell_content_browser_client.cc
@@ -81,6 +81,50 @@ void ShellContentBrowserClient::RenderProcessHostCreated(
host->Send(new ShellViewMsg_SetWebKitSourceDir(webkit_source_dir_));
}
+net::URLRequestContextGetter* ShellContentBrowserClient::CreateRequestContext(
+ BrowserContext* content_browser_context,
+ 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) {
+ ShellBrowserContext* shell_browser_context =
+ ShellBrowserContextForBrowserContext(content_browser_context);
+ return shell_browser_context->CreateRequestContext(
+ blob_protocol_handler.Pass(), file_system_protocol_handler.Pass(),
+ developer_protocol_handler.Pass(), chrome_protocol_handler.Pass(),
+ chrome_devtools_protocol_handler.Pass());
+}
+
+net::URLRequestContextGetter*
+ShellContentBrowserClient::CreateRequestContextForStoragePartition(
+ BrowserContext* content_browser_context,
+ const 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) {
+ ShellBrowserContext* shell_browser_context =
+ ShellBrowserContextForBrowserContext(content_browser_context);
+ return shell_browser_context->CreateRequestContextForStoragePartition(
+ partition_path, in_memory, blob_protocol_handler.Pass(),
+ file_system_protocol_handler.Pass(),
+ developer_protocol_handler.Pass(), chrome_protocol_handler.Pass(),
+ chrome_devtools_protocol_handler.Pass());
+}
+
void ShellContentBrowserClient::AppendExtraCommandLineSwitches(
CommandLine* command_line, int child_process_id) {
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree))
@@ -166,4 +210,13 @@ AccessTokenStore* ShellContentBrowserClient::CreateAccessTokenStore() {
return new ShellAccessTokenStore(browser_context()->GetRequestContext());
}
+ShellBrowserContext*
+ShellContentBrowserClient::ShellBrowserContextForBrowserContext(
+ BrowserContext* content_browser_context) {
+ if (content_browser_context == browser_context())
+ return browser_context();
+ DCHECK_EQ(content_browser_context, off_the_record_browser_context());
+ return off_the_record_browser_context();
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698