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

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

Issue 1584483004: Fix race condition-y Finalize w/ extreme predjudice (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 // anonymously identify logs. Every WebView-using app on every device 260 // anonymously identify logs. Every WebView-using app on every device
261 // is given a GUID, stored in this file in the app's data directory. 261 // is given a GUID, stored in this file in the app's data directory.
262 const FilePath guid_file_path = 262 const FilePath guid_file_path =
263 GetPath().Append(FILE_PATH_LITERAL("metrics_guid")); 263 GetPath().Append(FILE_PATH_LITERAL("metrics_guid"));
264 264
265 AwMetricsServiceClient::GetInstance()->Initialize(user_pref_service_.get(), 265 AwMetricsServiceClient::GetInstance()->Initialize(user_pref_service_.get(),
266 GetRequestContext(), 266 GetRequestContext(),
267 guid_file_path); 267 guid_file_path);
268 } 268 }
269 269
270 void AwBrowserContext::PostMainMessageLoopRun() {
271 AwMetricsServiceClient::GetInstance()->Finalize();
272 }
273
274 void AwBrowserContext::AddVisitedURLs(const std::vector<GURL>& urls) { 270 void AwBrowserContext::AddVisitedURLs(const std::vector<GURL>& urls) {
275 DCHECK(visitedlink_master_); 271 DCHECK(visitedlink_master_);
276 visitedlink_master_->AddURLs(urls); 272 visitedlink_master_->AddURLs(urls);
277 } 273 }
278 274
279 net::URLRequestContextGetter* AwBrowserContext::CreateRequestContext( 275 net::URLRequestContextGetter* AwBrowserContext::CreateRequestContext(
280 content::ProtocolHandlerMap* protocol_handlers, 276 content::ProtocolHandlerMap* protocol_handlers,
281 content::URLRequestInterceptorScopedVector request_interceptors) { 277 content::URLRequestInterceptorScopedVector request_interceptors) {
282 // This function cannot actually create the request context because 278 // This function cannot actually create the request context because
283 // there is a reentrant dependency on GetResourceContext() via 279 // there is a reentrant dependency on GetResourceContext() via
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 return; 474 return;
479 // We don't care about commit_delay for now. It is just a dummy value. 475 // We don't care about commit_delay for now. It is just a dummy value.
480 base::TimeDelta commit_delay = base::TimeDelta::FromMinutes(60); 476 base::TimeDelta commit_delay = base::TimeDelta::FromMinutes(60);
481 data_reduction_proxy_service->EnableCompressionStatisticsLogging( 477 data_reduction_proxy_service->EnableCompressionStatisticsLogging(
482 user_pref_service_.get(), 478 user_pref_service_.get(),
483 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), 479 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI),
484 commit_delay); 480 commit_delay);
485 } 481 }
486 482
487 } // namespace android_webview 483 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/browser/aw_browser_context.h ('k') | android_webview/browser/aw_browser_main_parts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698