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 22e594960e7872c21a6b2b00546ce1e4c2981a19..13f21098946c9a9eb724d25d3f2fed227846e76d 100644 |
--- a/content/shell/shell_content_browser_client.cc |
+++ b/content/shell/shell_content_browser_client.cc |
@@ -79,6 +79,42 @@ void ShellContentBrowserClient::RenderProcessHostCreated( |
host->Send(new ShellViewMsg_SetWebKitSourceDir(webkit_source_dir_)); |
} |
+net::URLRequestContextGetter* ShellContentBrowserClient::CreateRequestContext( |
+ content::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::Interceptor> |
+ developer_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()); |
+} |
+ |
+net::URLRequestContextGetter* |
+ShellContentBrowserClient::CreateRequestContextForStoragePartition( |
+ content::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::Interceptor> |
+ developer_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()); |
+} |
+ |
void ShellContentBrowserClient::AppendExtraCommandLineSwitches( |
CommandLine* command_line, int child_process_id) { |
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) |
@@ -164,4 +200,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 |