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

Side by Side Diff: chrome/browser/metrics/chrome_metrics_service_client.cc

Issue 2503243003: Wire up CertificateReportingService to handle report uploads (Closed)
Patch Set: Rebase onto crrev/2543523002 Created 4 years 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/metrics/chrome_metrics_service_client.h" 5 #include "chrome/browser/metrics/chrome_metrics_service_client.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 17 matching lines...) Expand all
28 #include "chrome/browser/browser_process.h" 28 #include "chrome/browser/browser_process.h"
29 #include "chrome/browser/chrome_notification_types.h" 29 #include "chrome/browser/chrome_notification_types.h"
30 #include "chrome/browser/google/google_brand.h" 30 #include "chrome/browser/google/google_brand.h"
31 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" 31 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h"
32 #include "chrome/browser/metrics/chrome_stability_metrics_provider.h" 32 #include "chrome/browser/metrics/chrome_stability_metrics_provider.h"
33 #include "chrome/browser/metrics/https_engagement_metrics_provider.h" 33 #include "chrome/browser/metrics/https_engagement_metrics_provider.h"
34 #include "chrome/browser/metrics/metrics_reporting_state.h" 34 #include "chrome/browser/metrics/metrics_reporting_state.h"
35 #include "chrome/browser/metrics/sampling_metrics_provider.h" 35 #include "chrome/browser/metrics/sampling_metrics_provider.h"
36 #include "chrome/browser/metrics/subprocess_metrics_provider.h" 36 #include "chrome/browser/metrics/subprocess_metrics_provider.h"
37 #include "chrome/browser/metrics/time_ticks_experiment_win.h" 37 #include "chrome/browser/metrics/time_ticks_experiment_win.h"
38 #include "chrome/browser/safe_browsing/certificate_reporting_metrics_provider.h"
38 #include "chrome/browser/sync/chrome_sync_client.h" 39 #include "chrome/browser/sync/chrome_sync_client.h"
39 #include "chrome/browser/ui/browser_otr_state.h" 40 #include "chrome/browser/ui/browser_otr_state.h"
40 #include "chrome/common/channel_info.h" 41 #include "chrome/common/channel_info.h"
41 #include "chrome/common/chrome_paths.h" 42 #include "chrome/common/chrome_paths.h"
42 #include "chrome/common/chrome_paths_internal.h" 43 #include "chrome/common/chrome_paths_internal.h"
43 #include "chrome/common/chrome_switches.h" 44 #include "chrome/common/chrome_switches.h"
44 #include "chrome/common/crash_keys.h" 45 #include "chrome/common/crash_keys.h"
45 #include "chrome/common/features.h" 46 #include "chrome/common/features.h"
46 #include "chrome/common/pref_names.h" 47 #include "chrome/common/pref_names.h"
47 #include "chrome/installer/util/util_constants.h" 48 #include "chrome/installer/util/util_constants.h"
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 #endif // !defined(OS_CHROMEOS) 693 #endif // !defined(OS_CHROMEOS)
693 694
694 metrics_service_->RegisterMetricsProvider( 695 metrics_service_->RegisterMetricsProvider(
695 std::unique_ptr<metrics::MetricsProvider>( 696 std::unique_ptr<metrics::MetricsProvider>(
696 new syncer::DeviceCountMetricsProvider(base::Bind( 697 new syncer::DeviceCountMetricsProvider(base::Bind(
697 &browser_sync::ChromeSyncClient::GetDeviceInfoTrackers)))); 698 &browser_sync::ChromeSyncClient::GetDeviceInfoTrackers))));
698 699
699 metrics_service_->RegisterMetricsProvider( 700 metrics_service_->RegisterMetricsProvider(
700 std::unique_ptr<metrics::MetricsProvider>( 701 std::unique_ptr<metrics::MetricsProvider>(
701 new HttpsEngagementMetricsProvider())); 702 new HttpsEngagementMetricsProvider()));
703
704 metrics_service_->RegisterMetricsProvider(
705 std::unique_ptr<metrics::MetricsProvider>(
706 new CertificateReportingMetricsProvider()));
702 } 707 }
703 708
704 bool ChromeMetricsServiceClient::ShouldIncludeProfilerDataInLog() { 709 bool ChromeMetricsServiceClient::ShouldIncludeProfilerDataInLog() {
705 // Upload profiler data at most once per session. 710 // Upload profiler data at most once per session.
706 if (has_uploaded_profiler_data_) 711 if (has_uploaded_profiler_data_)
707 return false; 712 return false;
708 713
709 // For each log, flip a fair coin. Thus, profiler data is sent with the first 714 // For each log, flip a fair coin. Thus, profiler data is sent with the first
710 // log with probability 50%, with the second log with probability 25%, and so 715 // log with probability 50%, with the second log with probability 25%, and so
711 // on. As a result, uploaded data is biased toward earlier logs. 716 // on. As a result, uploaded data is biased toward earlier logs.
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 } 897 }
893 } 898 }
894 899
895 void ChromeMetricsServiceClient::OnURLOpenedFromOmnibox(OmniboxLog* log) { 900 void ChromeMetricsServiceClient::OnURLOpenedFromOmnibox(OmniboxLog* log) {
896 metrics_service_->OnApplicationNotIdle(); 901 metrics_service_->OnApplicationNotIdle();
897 } 902 }
898 903
899 bool ChromeMetricsServiceClient::IsUMACellularUploadLogicEnabled() { 904 bool ChromeMetricsServiceClient::IsUMACellularUploadLogicEnabled() {
900 return metrics::IsCellularLogicEnabled(); 905 return metrics::IsCellularLogicEnabled();
901 } 906 }
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698