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

Side by Side Diff: android_webview/browser/aw_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 (r181485) 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "android_webview/browser/aw_content_browser_client.h" 5 #include "android_webview/browser/aw_content_browser_client.h"
6 6
7 #include "android_webview/browser/aw_browser_main_parts.h" 7 #include "android_webview/browser/aw_browser_main_parts.h"
8 #include "android_webview/browser/aw_cookie_access_policy.h" 8 #include "android_webview/browser/aw_cookie_access_policy.h"
9 #include "android_webview/browser/aw_quota_permission_context.h" 9 #include "android_webview/browser/aw_quota_permission_context.h"
10 #include "android_webview/browser/net_disk_cache_remover.h" 10 #include "android_webview/browser/net_disk_cache_remover.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 CHECK(content::RenderProcessHost::run_renderer_in_process()); 94 CHECK(content::RenderProcessHost::run_renderer_in_process());
95 95
96 // Grant content: and file: scheme to the whole process, since we impose 96 // Grant content: and file: scheme to the whole process, since we impose
97 // per-view access checks. 97 // per-view access checks.
98 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme( 98 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme(
99 host->GetID(), android_webview::kContentScheme); 99 host->GetID(), android_webview::kContentScheme);
100 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme( 100 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme(
101 host->GetID(), chrome::kFileScheme); 101 host->GetID(), chrome::kFileScheme);
102 } 102 }
103 103
104 net::URLRequestContextGetter*
105 AwContentBrowserClient::CreateRequestContext(
106 content::BrowserContext* browser_context,
107 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
108 blob_protocol_handler,
109 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
110 file_system_protocol_handler,
111 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
112 developer_protocol_handler,
113 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
114 chrome_protocol_handler,
115 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
116 chrome_devtools_protocol_handler) {
117 DCHECK(browser_context_.get() == browser_context);
118 return browser_context_->CreateRequestContext(
119 blob_protocol_handler.Pass(), file_system_protocol_handler.Pass(),
120 developer_protocol_handler.Pass(), chrome_protocol_handler.Pass(),
121 chrome_devtools_protocol_handler.Pass());
122 }
123
124 net::URLRequestContextGetter*
125 AwContentBrowserClient::CreateRequestContextForStoragePartition(
126 content::BrowserContext* browser_context,
127 const FilePath& partition_path,
128 bool in_memory,
129 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
130 blob_protocol_handler,
131 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
132 file_system_protocol_handler,
133 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
134 developer_protocol_handler,
135 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
136 chrome_protocol_handler,
137 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
138 chrome_devtools_protocol_handler) {
139 DCHECK(browser_context_.get() == browser_context);
140 return browser_context_->CreateRequestContextForStoragePartition(
141 partition_path, in_memory, blob_protocol_handler.Pass(),
142 file_system_protocol_handler.Pass(),
143 developer_protocol_handler.Pass(), chrome_protocol_handler.Pass(),
144 chrome_devtools_protocol_handler.Pass());
145 }
146
104 std::string AwContentBrowserClient::GetCanonicalEncodingNameByAliasName( 147 std::string AwContentBrowserClient::GetCanonicalEncodingNameByAliasName(
105 const std::string& alias_name) { 148 const std::string& alias_name) {
106 return alias_name; 149 return alias_name;
107 } 150 }
108 151
109 void AwContentBrowserClient::AppendExtraCommandLineSwitches( 152 void AwContentBrowserClient::AppendExtraCommandLineSwitches(
110 CommandLine* command_line, 153 CommandLine* command_line,
111 int child_process_id) { 154 int child_process_id) {
112 NOTREACHED() << "Android WebView does not support multi-process yet"; 155 NOTREACHED() << "Android WebView does not support multi-process yet";
113 } 156 }
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 381
339 bool AwContentBrowserClient::AllowPepperSocketAPI( 382 bool AwContentBrowserClient::AllowPepperSocketAPI(
340 content::BrowserContext* browser_context, 383 content::BrowserContext* browser_context,
341 const GURL& url, 384 const GURL& url,
342 const content::SocketPermissionRequest& params) { 385 const content::SocketPermissionRequest& params) {
343 NOTREACHED() << "Android WebView does not support plugins"; 386 NOTREACHED() << "Android WebView does not support plugins";
344 return false; 387 return false;
345 } 388 }
346 389
347 } // namespace android_webview 390 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/browser/aw_content_browser_client.h ('k') | android_webview/browser/net/aw_url_request_context_getter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698