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

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

Issue 1864583006: Simplify BrowserContext by removing redundant methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix 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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 data_reduction_proxy_settings_->MaybeActivateDataReductionProxy(true); 252 data_reduction_proxy_settings_->MaybeActivateDataReductionProxy(true);
253 253
254 blacklist_manager_.reset(CreateURLBlackListManager(user_pref_service_.get())); 254 blacklist_manager_.reset(CreateURLBlackListManager(user_pref_service_.get()));
255 255
256 // UMA uses randomly-generated GUIDs (globally unique identifiers) to 256 // UMA uses randomly-generated GUIDs (globally unique identifiers) to
257 // anonymously identify logs. Every WebView-using app on every device 257 // anonymously identify logs. Every WebView-using app on every device
258 // is given a GUID, stored in this file in the app's data directory. 258 // is given a GUID, stored in this file in the app's data directory.
259 const FilePath guid_file_path = 259 const FilePath guid_file_path =
260 GetPath().Append(FILE_PATH_LITERAL("metrics_guid")); 260 GetPath().Append(FILE_PATH_LITERAL("metrics_guid"));
261 261
262 AwMetricsServiceClient::GetInstance()->Initialize(user_pref_service_.get(), 262 AwMetricsServiceClient::GetInstance()->Initialize(
263 GetRequestContext(), 263 user_pref_service_.get(),
264 guid_file_path); 264 content::BrowserContext::GetDefaultStoragePartition(this)->
265 GetURLRequestContext(),
266 guid_file_path);
265 } 267 }
266 268
267 void AwBrowserContext::AddVisitedURLs(const std::vector<GURL>& urls) { 269 void AwBrowserContext::AddVisitedURLs(const std::vector<GURL>& urls) {
268 DCHECK(visitedlink_master_); 270 DCHECK(visitedlink_master_);
269 visitedlink_master_->AddURLs(urls); 271 visitedlink_master_->AddURLs(urls);
270 } 272 }
271 273
272 AwQuotaManagerBridge* AwBrowserContext::GetQuotaManagerBridge() { 274 AwQuotaManagerBridge* AwBrowserContext::GetQuotaManagerBridge() {
273 if (!quota_manager_bridge_.get()) { 275 if (!quota_manager_bridge_.get()) {
274 quota_manager_bridge_ = native_factory_->CreateAwQuotaManagerBridge(this); 276 quota_manager_bridge_ = native_factory_->CreateAwQuotaManagerBridge(this);
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 343
342 base::FilePath AwBrowserContext::GetPath() const { 344 base::FilePath AwBrowserContext::GetPath() const {
343 return context_storage_path_; 345 return context_storage_path_;
344 } 346 }
345 347
346 bool AwBrowserContext::IsOffTheRecord() const { 348 bool AwBrowserContext::IsOffTheRecord() const {
347 // Android WebView does not support off the record profile yet. 349 // Android WebView does not support off the record profile yet.
348 return false; 350 return false;
349 } 351 }
350 352
351 net::URLRequestContextGetter* AwBrowserContext::GetRequestContext() {
352 return GetDefaultStoragePartition(this)->GetURLRequestContext();
353 }
354
355 net::URLRequestContextGetter* AwBrowserContext::GetMediaRequestContext() { 353 net::URLRequestContextGetter* AwBrowserContext::GetMediaRequestContext() {
356 return GetRequestContext(); 354 return content::BrowserContext::GetDefaultStoragePartition(this)->
355 GetURLRequestContext();
357 } 356 }
358 357
359 net::URLRequestContextGetter* 358 net::URLRequestContextGetter*
360 AwBrowserContext::GetMediaRequestContextForRenderProcess( 359 AwBrowserContext::GetMediaRequestContextForRenderProcess(
361 int renderer_child_id) { 360 int renderer_child_id) {
362 return GetRequestContext(); 361 return content::BrowserContext::GetDefaultStoragePartition(this)->
362 GetURLRequestContext();
363 } 363 }
364 364
365 net::URLRequestContextGetter* 365 net::URLRequestContextGetter*
366 AwBrowserContext::GetMediaRequestContextForStoragePartition( 366 AwBrowserContext::GetMediaRequestContextForStoragePartition(
367 const base::FilePath& partition_path, 367 const base::FilePath& partition_path,
368 bool in_memory) { 368 bool in_memory) {
369 NOTREACHED(); 369 NOTREACHED();
370 return NULL; 370 return NULL;
371 } 371 }
372 372
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
« no previous file with comments | « android_webview/browser/aw_browser_context.h ('k') | android_webview/browser/net/token_binding_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698