| OLD | NEW |
| 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 #ifndef COMPONENTS_METRICS_CLONED_INSTALL_DETECTOR_H_ | 5 #ifndef COMPONENTS_METRICS_CLONED_INSTALL_DETECTOR_H_ |
| 6 #define COMPONENTS_METRICS_CLONED_INSTALL_DETECTOR_H_ | 6 #define COMPONENTS_METRICS_CLONED_INSTALL_DETECTOR_H_ |
| 7 | 7 |
| 8 #include "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 static void RegisterPrefs(PrefRegistrySimple* registry); | 40 static void RegisterPrefs(PrefRegistrySimple* registry); |
| 41 | 41 |
| 42 private: | 42 private: |
| 43 FRIEND_TEST_ALL_PREFIXES(ClonedInstallDetectorTest, SaveId); | 43 FRIEND_TEST_ALL_PREFIXES(ClonedInstallDetectorTest, SaveId); |
| 44 FRIEND_TEST_ALL_PREFIXES(ClonedInstallDetectorTest, DetectClone); | 44 FRIEND_TEST_ALL_PREFIXES(ClonedInstallDetectorTest, DetectClone); |
| 45 | 45 |
| 46 // Converts raw_id into a 24-bit hash and stores the hash in |local_state|. | 46 // Converts raw_id into a 24-bit hash and stores the hash in |local_state|. |
| 47 // |raw_id| is not a const ref because it's passed from a cross-thread post | 47 // |raw_id| is not a const ref because it's passed from a cross-thread post |
| 48 // task. | 48 // task. |
| 49 void SaveMachineId(PrefService* local_state, std::string raw_id); | 49 void SaveMachineId(PrefService* local_state, const std::string& raw_id); |
| 50 | 50 |
| 51 scoped_refptr<MachineIdProvider> raw_id_provider_; | 51 scoped_refptr<MachineIdProvider> raw_id_provider_; |
| 52 base::WeakPtrFactory<ClonedInstallDetector> weak_ptr_factory_; | 52 base::WeakPtrFactory<ClonedInstallDetector> weak_ptr_factory_; |
| 53 | 53 |
| 54 DISALLOW_COPY_AND_ASSIGN(ClonedInstallDetector); | 54 DISALLOW_COPY_AND_ASSIGN(ClonedInstallDetector); |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 } // namespace metrics | 57 } // namespace metrics |
| 58 | 58 |
| 59 #endif // COMPONENTS_METRICS_CLONED_INSTALL_DETECTOR_H_ | 59 #endif // COMPONENTS_METRICS_CLONED_INSTALL_DETECTOR_H_ |
| OLD | NEW |