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

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

Issue 2503243003: Wire up CertificateReportingService to handle report uploads (Closed)
Patch Set: jialiul, estark comments 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 16 matching lines...) Expand all
27 #include "build/build_config.h" 27 #include "build/build_config.h"
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/metrics_reporting_state.h" 33 #include "chrome/browser/metrics/metrics_reporting_state.h"
34 #include "chrome/browser/metrics/sampling_metrics_provider.h" 34 #include "chrome/browser/metrics/sampling_metrics_provider.h"
35 #include "chrome/browser/metrics/subprocess_metrics_provider.h" 35 #include "chrome/browser/metrics/subprocess_metrics_provider.h"
36 #include "chrome/browser/metrics/time_ticks_experiment_win.h" 36 #include "chrome/browser/metrics/time_ticks_experiment_win.h"
37 #include "chrome/browser/safe_browsing/certificate_reporting_metrics_provider.h"
37 #include "chrome/browser/sync/chrome_sync_client.h" 38 #include "chrome/browser/sync/chrome_sync_client.h"
38 #include "chrome/browser/ui/browser_otr_state.h" 39 #include "chrome/browser/ui/browser_otr_state.h"
39 #include "chrome/common/channel_info.h" 40 #include "chrome/common/channel_info.h"
40 #include "chrome/common/chrome_paths.h" 41 #include "chrome/common/chrome_paths.h"
41 #include "chrome/common/chrome_paths_internal.h" 42 #include "chrome/common/chrome_paths_internal.h"
42 #include "chrome/common/chrome_switches.h" 43 #include "chrome/common/chrome_switches.h"
43 #include "chrome/common/crash_keys.h" 44 #include "chrome/common/crash_keys.h"
44 #include "chrome/common/features.h" 45 #include "chrome/common/features.h"
45 #include "chrome/common/pref_names.h" 46 #include "chrome/common/pref_names.h"
46 #include "chrome/installer/util/util_constants.h" 47 #include "chrome/installer/util/util_constants.h"
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 metrics_service_->RegisterMetricsProvider( 685 metrics_service_->RegisterMetricsProvider(
685 std::unique_ptr<metrics::MetricsProvider>( 686 std::unique_ptr<metrics::MetricsProvider>(
686 SigninStatusMetricsProvider::CreateInstance(base::WrapUnique( 687 SigninStatusMetricsProvider::CreateInstance(base::WrapUnique(
687 new ChromeSigninStatusMetricsProviderDelegate)))); 688 new ChromeSigninStatusMetricsProviderDelegate))));
688 #endif // !defined(OS_CHROMEOS) 689 #endif // !defined(OS_CHROMEOS)
689 690
690 metrics_service_->RegisterMetricsProvider( 691 metrics_service_->RegisterMetricsProvider(
691 std::unique_ptr<metrics::MetricsProvider>( 692 std::unique_ptr<metrics::MetricsProvider>(
692 new syncer::DeviceCountMetricsProvider(base::Bind( 693 new syncer::DeviceCountMetricsProvider(base::Bind(
693 &browser_sync::ChromeSyncClient::GetDeviceInfoTrackers)))); 694 &browser_sync::ChromeSyncClient::GetDeviceInfoTrackers))));
695
696 metrics_service_->RegisterMetricsProvider(
697 std::unique_ptr<metrics::MetricsProvider>(
698 new CertificateReportingMetricsProvider()));
694 } 699 }
695 700
696 bool ChromeMetricsServiceClient::ShouldIncludeProfilerDataInLog() { 701 bool ChromeMetricsServiceClient::ShouldIncludeProfilerDataInLog() {
697 // Upload profiler data at most once per session. 702 // Upload profiler data at most once per session.
698 if (has_uploaded_profiler_data_) 703 if (has_uploaded_profiler_data_)
699 return false; 704 return false;
700 705
701 // For each log, flip a fair coin. Thus, profiler data is sent with the first 706 // For each log, flip a fair coin. Thus, profiler data is sent with the first
702 // log with probability 50%, with the second log with probability 25%, and so 707 // log with probability 50%, with the second log with probability 25%, and so
703 // on. As a result, uploaded data is biased toward earlier logs. 708 // on. As a result, uploaded data is biased toward earlier logs.
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 } 889 }
885 } 890 }
886 891
887 void ChromeMetricsServiceClient::OnURLOpenedFromOmnibox(OmniboxLog* log) { 892 void ChromeMetricsServiceClient::OnURLOpenedFromOmnibox(OmniboxLog* log) {
888 metrics_service_->OnApplicationNotIdle(); 893 metrics_service_->OnApplicationNotIdle();
889 } 894 }
890 895
891 bool ChromeMetricsServiceClient::IsUMACellularUploadLogicEnabled() { 896 bool ChromeMetricsServiceClient::IsUMACellularUploadLogicEnabled() {
892 return metrics::IsCellularLogicEnabled(); 897 return metrics::IsCellularLogicEnabled();
893 } 898 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698