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

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

Issue 1862203005: Remove ContentBrowserClient::CreateRequestContext & CreateRequestContextForStoragePartition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
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_browser_context.h" 5 #include "android_webview/browser/aw_browser_context.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "android_webview/browser/aw_browser_policy_connector.h" 9 #include "android_webview/browser/aw_browser_policy_connector.h"
10 #include "android_webview/browser/aw_form_database_service.h" 10 #include "android_webview/browser/aw_form_database_service.h"
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 AwMetricsServiceClient::GetInstance()->Initialize(user_pref_service_.get(), 262 AwMetricsServiceClient::GetInstance()->Initialize(user_pref_service_.get(),
263 GetRequestContext(), 263 GetRequestContext(),
264 guid_file_path); 264 guid_file_path);
265 } 265 }
266 266
267 void AwBrowserContext::AddVisitedURLs(const std::vector<GURL>& urls) { 267 void AwBrowserContext::AddVisitedURLs(const std::vector<GURL>& urls) {
268 DCHECK(visitedlink_master_); 268 DCHECK(visitedlink_master_);
269 visitedlink_master_->AddURLs(urls); 269 visitedlink_master_->AddURLs(urls);
270 } 270 }
271 271
272 net::URLRequestContextGetter* AwBrowserContext::CreateRequestContext(
273 content::ProtocolHandlerMap* protocol_handlers,
274 content::URLRequestInterceptorScopedVector request_interceptors) {
275 // This function cannot actually create the request context because
276 // there is a reentrant dependency on GetResourceContext() via
277 // content::StoragePartitionImplMap::Create(). This is not fixable
278 // until http://crbug.com/159193. Until then, assert that the context
279 // has already been allocated and just handle setting the protocol_handlers.
280 DCHECK(url_request_context_getter_.get());
281 url_request_context_getter_->SetHandlersAndInterceptors(
282 protocol_handlers, std::move(request_interceptors));
283 return url_request_context_getter_.get();
284 }
285
286 net::URLRequestContextGetter*
287 AwBrowserContext::CreateRequestContextForStoragePartition(
288 const base::FilePath& partition_path,
289 bool in_memory,
290 content::ProtocolHandlerMap* protocol_handlers,
291 content::URLRequestInterceptorScopedVector request_interceptors) {
292 NOTREACHED();
293 return NULL;
294 }
295
296 AwQuotaManagerBridge* AwBrowserContext::GetQuotaManagerBridge() { 272 AwQuotaManagerBridge* AwBrowserContext::GetQuotaManagerBridge() {
297 if (!quota_manager_bridge_.get()) { 273 if (!quota_manager_bridge_.get()) {
298 quota_manager_bridge_ = native_factory_->CreateAwQuotaManagerBridge(this); 274 quota_manager_bridge_ = native_factory_->CreateAwQuotaManagerBridge(this);
299 } 275 }
300 return quota_manager_bridge_.get(); 276 return quota_manager_bridge_.get();
301 } 277 }
302 278
303 AwFormDatabaseService* AwBrowserContext::GetFormDatabaseService() { 279 AwFormDatabaseService* AwBrowserContext::GetFormDatabaseService() {
304 return form_database_service_.get(); 280 return form_database_service_.get();
305 } 281 }
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 if (!permission_manager_.get()) 408 if (!permission_manager_.get())
433 permission_manager_.reset(new AwPermissionManager()); 409 permission_manager_.reset(new AwPermissionManager());
434 return permission_manager_.get(); 410 return permission_manager_.get();
435 } 411 }
436 412
437 content::BackgroundSyncController* 413 content::BackgroundSyncController*
438 AwBrowserContext::GetBackgroundSyncController() { 414 AwBrowserContext::GetBackgroundSyncController() {
439 return nullptr; 415 return nullptr;
440 } 416 }
441 417
418 net::URLRequestContextGetter* AwBrowserContext::CreateRequestContext(
419 content::ProtocolHandlerMap* protocol_handlers,
420 content::URLRequestInterceptorScopedVector request_interceptors) {
421 // This function cannot actually create the request context because
422 // there is a reentrant dependency on GetResourceContext() via
423 // content::StoragePartitionImplMap::Create(). This is not fixable
424 // until http://crbug.com/159193. Until then, assert that the context
425 // has already been allocated and just handle setting the protocol_handlers.
426 DCHECK(url_request_context_getter_.get());
427 url_request_context_getter_->SetHandlersAndInterceptors(
428 protocol_handlers, std::move(request_interceptors));
429 return url_request_context_getter_.get();
430 }
431
432 net::URLRequestContextGetter*
433 AwBrowserContext::CreateRequestContextForStoragePartition(
434 const base::FilePath& partition_path,
435 bool in_memory,
436 content::ProtocolHandlerMap* protocol_handlers,
437 content::URLRequestInterceptorScopedVector request_interceptors) {
438 NOTREACHED();
439 return NULL;
440 }
441
442 policy::URLBlacklistManager* AwBrowserContext::GetURLBlacklistManager() { 442 policy::URLBlacklistManager* AwBrowserContext::GetURLBlacklistManager() {
443 // Should not be called until the end of PreMainMessageLoopRun, where 443 // Should not be called until the end of PreMainMessageLoopRun, where
444 // blacklist_manager_ is initialized. 444 // blacklist_manager_ is initialized.
445 DCHECK(blacklist_manager_); 445 DCHECK(blacklist_manager_);
446 return blacklist_manager_.get(); 446 return blacklist_manager_.get();
447 } 447 }
448 448
449 void AwBrowserContext::RebuildTable( 449 void AwBrowserContext::RebuildTable(
450 const scoped_refptr<URLEnumerator>& enumerator) { 450 const scoped_refptr<URLEnumerator>& enumerator) {
451 // Android WebView rebuilds from WebChromeClient.getVisitedHistory. The client 451 // Android WebView rebuilds from WebChromeClient.getVisitedHistory. The client
(...skipping 13 matching lines...) Expand all
465 return; 465 return;
466 // We don't care about commit_delay for now. It is just a dummy value. 466 // We don't care about commit_delay for now. It is just a dummy value.
467 base::TimeDelta commit_delay = base::TimeDelta::FromMinutes(60); 467 base::TimeDelta commit_delay = base::TimeDelta::FromMinutes(60);
468 data_reduction_proxy_service->EnableCompressionStatisticsLogging( 468 data_reduction_proxy_service->EnableCompressionStatisticsLogging(
469 user_pref_service_.get(), 469 user_pref_service_.get(),
470 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), 470 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI),
471 commit_delay); 471 commit_delay);
472 } 472 }
473 473
474 } // namespace android_webview 474 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698