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

Side by Side Diff: components/metrics/cloned_install_detector.cc

Issue 1471073007: Reorganize histograms for persistence. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shmem-alloc
Patch Set: added GN changes Created 5 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 "components/metrics/cloned_install_detector.h" 5 #include "components/metrics/cloned_install_detector.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
11 #include "base/metrics/histogram_macros.h" 11 #include "base/metrics/histogram_macros.h"
12 #include "base/metrics/metrics_hashes.h"
12 #include "base/prefs/pref_registry_simple.h" 13 #include "base/prefs/pref_registry_simple.h"
13 #include "base/prefs/pref_service.h" 14 #include "base/prefs/pref_service.h"
14 #include "base/single_thread_task_runner.h" 15 #include "base/single_thread_task_runner.h"
15 #include "base/task_runner_util.h" 16 #include "base/task_runner_util.h"
16 #include "components/metrics/machine_id_provider.h" 17 #include "components/metrics/machine_id_provider.h"
17 #include "components/metrics/metrics_hashes.h"
18 #include "components/metrics/metrics_pref_names.h" 18 #include "components/metrics/metrics_pref_names.h"
19 19
20 namespace metrics { 20 namespace metrics {
21 21
22 namespace { 22 namespace {
23 23
24 uint32 HashRawId(const std::string& value) { 24 uint32 HashRawId(const std::string& value) {
25 uint64 hash = HashMetricName(value); 25 uint64 hash = HashMetricName(value);
26 26
27 // Only use 24 bits from the 64-bit hash. 27 // Only use 24 bits from the 64-bit hash.
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 90
91 local_state->SetInteger(prefs::kMetricsMachineId, hashed_id); 91 local_state->SetInteger(prefs::kMetricsMachineId, hashed_id);
92 } 92 }
93 93
94 // static 94 // static
95 void ClonedInstallDetector::RegisterPrefs(PrefRegistrySimple* registry) { 95 void ClonedInstallDetector::RegisterPrefs(PrefRegistrySimple* registry) {
96 registry->RegisterIntegerPref(prefs::kMetricsMachineId, 0); 96 registry->RegisterIntegerPref(prefs::kMetricsMachineId, 0);
97 } 97 }
98 98
99 } // namespace metrics 99 } // namespace metrics
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698