Chromium Code Reviews

Side by Side Diff: android_webview/browser/aw_content_browser_client.cc

Issue 185593004: Allow content layer to pass ProtocolInterceptors when we create URLRequestContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | 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_context.h" 7 #include "android_webview/browser/aw_browser_context.h"
8 #include "android_webview/browser/aw_browser_main_parts.h" 8 #include "android_webview/browser/aw_browser_main_parts.h"
9 #include "android_webview/browser/aw_contents_client_bridge_base.h" 9 #include "android_webview/browser/aw_contents_client_bridge_base.h"
10 #include "android_webview/browser/aw_contents_io_thread_client.h" 10 #include "android_webview/browser/aw_contents_io_thread_client.h"
(...skipping 194 matching lines...)
205 host->GetID(), android_webview::kContentScheme); 205 host->GetID(), android_webview::kContentScheme);
206 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme( 206 content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme(
207 host->GetID(), content::kFileScheme); 207 host->GetID(), content::kFileScheme);
208 208
209 host->AddFilter(new AwContentsMessageFilter(host->GetID())); 209 host->AddFilter(new AwContentsMessageFilter(host->GetID()));
210 } 210 }
211 211
212 net::URLRequestContextGetter* 212 net::URLRequestContextGetter*
213 AwContentBrowserClient::CreateRequestContext( 213 AwContentBrowserClient::CreateRequestContext(
214 content::BrowserContext* browser_context, 214 content::BrowserContext* browser_context,
215 content::ProtocolHandlerMap* protocol_handlers) { 215 content::ProtocolHandlerMap* protocol_handlers,
216 content::ProtocolHandlerScopedVector protocol_interceptors) {
216 DCHECK(browser_context_.get() == browser_context); 217 DCHECK(browser_context_.get() == browser_context);
217 return browser_context_->CreateRequestContext(protocol_handlers); 218 return browser_context_->CreateRequestContext(protocol_handlers,
219 protocol_interceptors.Pass());
218 } 220 }
219 221
220 net::URLRequestContextGetter* 222 net::URLRequestContextGetter*
221 AwContentBrowserClient::CreateRequestContextForStoragePartition( 223 AwContentBrowserClient::CreateRequestContextForStoragePartition(
222 content::BrowserContext* browser_context, 224 content::BrowserContext* browser_context,
223 const base::FilePath& partition_path, 225 const base::FilePath& partition_path,
224 bool in_memory, 226 bool in_memory,
225 content::ProtocolHandlerMap* protocol_handlers) { 227 content::ProtocolHandlerMap* protocol_handlers,
228 content::ProtocolHandlerScopedVector protocol_interceptors) {
226 DCHECK(browser_context_.get() == browser_context); 229 DCHECK(browser_context_.get() == browser_context);
227 return browser_context_->CreateRequestContextForStoragePartition( 230 return browser_context_->CreateRequestContextForStoragePartition(
228 partition_path, in_memory, protocol_handlers); 231 partition_path, in_memory,
232 protocol_handlers,
233 protocol_interceptors.Pass());
229 } 234 }
230 235
231 std::string AwContentBrowserClient::GetCanonicalEncodingNameByAliasName( 236 std::string AwContentBrowserClient::GetCanonicalEncodingNameByAliasName(
232 const std::string& alias_name) { 237 const std::string& alias_name) {
233 return alias_name; 238 return alias_name;
234 } 239 }
235 240
236 void AwContentBrowserClient::AppendExtraCommandLineSwitches( 241 void AwContentBrowserClient::AppendExtraCommandLineSwitches(
237 CommandLine* command_line, 242 CommandLine* command_line,
238 int child_process_id) { 243 int child_process_id) {
(...skipping 253 matching lines...)
492 WebPreferences* web_prefs) { 497 WebPreferences* web_prefs) {
493 if (!preferences_populater_.get()) { 498 if (!preferences_populater_.get()) {
494 preferences_populater_ = make_scoped_ptr(native_factory_-> 499 preferences_populater_ = make_scoped_ptr(native_factory_->
495 CreateWebPreferencesPopulater()); 500 CreateWebPreferencesPopulater());
496 } 501 }
497 preferences_populater_->PopulateFor( 502 preferences_populater_->PopulateFor(
498 content::WebContents::FromRenderViewHost(rvh), web_prefs); 503 content::WebContents::FromRenderViewHost(rvh), web_prefs);
499 } 504 }
500 505
501 } // namespace android_webview 506 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/browser/aw_content_browser_client.h ('k') | chrome/browser/chrome_content_browser_client.h » ('j') | no next file with comments »

Powered by Google App Engine