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

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

Issue 1859213002: Move the thread hop for UMA user actions from content:: to base::. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Answered thestig@ and sgurun@ 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
« no previous file with comments | « no previous file | base/metrics/user_metrics.h » ('j') | base/metrics/user_metrics.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
11 #include "android_webview/browser/aw_metrics_service_client.h" 11 #include "android_webview/browser/aw_metrics_service_client.h"
12 #include "android_webview/browser/aw_permission_manager.h" 12 #include "android_webview/browser/aw_permission_manager.h"
13 #include "android_webview/browser/aw_pref_store.h" 13 #include "android_webview/browser/aw_pref_store.h"
14 #include "android_webview/browser/aw_quota_manager_bridge.h" 14 #include "android_webview/browser/aw_quota_manager_bridge.h"
15 #include "android_webview/browser/aw_resource_context.h" 15 #include "android_webview/browser/aw_resource_context.h"
16 #include "android_webview/browser/jni_dependency_factory.h" 16 #include "android_webview/browser/jni_dependency_factory.h"
17 #include "android_webview/browser/net/aw_url_request_context_getter.h" 17 #include "android_webview/browser/net/aw_url_request_context_getter.h"
18 #include "android_webview/common/aw_content_client.h" 18 #include "android_webview/common/aw_content_client.h"
19 #include "base/base_paths_android.h" 19 #include "base/base_paths_android.h"
20 #include "base/bind.h" 20 #include "base/bind.h"
21 #include "base/metrics/user_metrics.h"
21 #include "base/path_service.h" 22 #include "base/path_service.h"
22 #include "components/autofill/core/common/autofill_pref_names.h" 23 #include "components/autofill/core/common/autofill_pref_names.h"
23 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_comp ression_stats.h" 24 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_comp ression_stats.h"
24 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d ata.h" 25 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d ata.h"
25 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_pref s.h" 26 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_pref s.h"
26 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_serv ice.h" 27 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_serv ice.h"
27 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett ings.h" 28 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett ings.h"
28 #include "components/data_reduction_proxy/core/browser/data_store.h" 29 #include "components/data_reduction_proxy/core/browser/data_store.h"
29 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param s.h" 30 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param s.h"
30 #include "components/metrics/metrics_service.h" 31 #include "components/metrics/metrics_service.h"
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 data_reduction_proxy_settings_->MaybeActivateDataReductionProxy(true); 253 data_reduction_proxy_settings_->MaybeActivateDataReductionProxy(true);
253 254
254 blacklist_manager_.reset(CreateURLBlackListManager(user_pref_service_.get())); 255 blacklist_manager_.reset(CreateURLBlackListManager(user_pref_service_.get()));
255 256
256 // UMA uses randomly-generated GUIDs (globally unique identifiers) to 257 // UMA uses randomly-generated GUIDs (globally unique identifiers) to
257 // anonymously identify logs. Every WebView-using app on every device 258 // 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. 259 // is given a GUID, stored in this file in the app's data directory.
259 const FilePath guid_file_path = 260 const FilePath guid_file_path =
260 GetPath().Append(FILE_PATH_LITERAL("metrics_guid")); 261 GetPath().Append(FILE_PATH_LITERAL("metrics_guid"));
261 262
263 base::SetRecordActionTaskRunner(
264 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI));
262 AwMetricsServiceClient::GetInstance()->Initialize( 265 AwMetricsServiceClient::GetInstance()->Initialize(
263 user_pref_service_.get(), 266 user_pref_service_.get(),
264 content::BrowserContext::GetDefaultStoragePartition(this)-> 267 content::BrowserContext::GetDefaultStoragePartition(this)->
265 GetURLRequestContext(), 268 GetURLRequestContext(),
266 guid_file_path); 269 guid_file_path);
267 } 270 }
268 271
269 void AwBrowserContext::AddVisitedURLs(const std::vector<GURL>& urls) { 272 void AwBrowserContext::AddVisitedURLs(const std::vector<GURL>& urls) {
270 DCHECK(visitedlink_master_); 273 DCHECK(visitedlink_master_);
271 visitedlink_master_->AddURLs(urls); 274 visitedlink_master_->AddURLs(urls);
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 return; 460 return;
458 // We don't care about commit_delay for now. It is just a dummy value. 461 // We don't care about commit_delay for now. It is just a dummy value.
459 base::TimeDelta commit_delay = base::TimeDelta::FromMinutes(60); 462 base::TimeDelta commit_delay = base::TimeDelta::FromMinutes(60);
460 data_reduction_proxy_service->EnableCompressionStatisticsLogging( 463 data_reduction_proxy_service->EnableCompressionStatisticsLogging(
461 user_pref_service_.get(), 464 user_pref_service_.get(),
462 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), 465 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI),
463 commit_delay); 466 commit_delay);
464 } 467 }
465 468
466 } // namespace android_webview 469 } // namespace android_webview
OLDNEW
« no previous file with comments | « no previous file | base/metrics/user_metrics.h » ('j') | base/metrics/user_metrics.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698