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

Unified Diff: components/user_prefs/tracked/pref_hash_calculator.cc

Issue 1227973003: Componentize //chrome/browser/prefs/tracked. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: components/user_prefs/tracked/pref_hash_calculator.cc
diff --git a/chrome/browser/prefs/tracked/pref_hash_calculator.cc b/components/user_prefs/tracked/pref_hash_calculator.cc
similarity index 92%
rename from chrome/browser/prefs/tracked/pref_hash_calculator.cc
rename to components/user_prefs/tracked/pref_hash_calculator.cc
index 323eb8832f0e8463feb8aa398a2a802ef3641f08..603426268d342c693881534e5a53753a03fb1da7 100644
--- a/chrome/browser/prefs/tracked/pref_hash_calculator.cc
+++ b/components/user_prefs/tracked/pref_hash_calculator.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/prefs/tracked/pref_hash_calculator.h"
+#include "components/user_prefs/tracked/pref_hash_calculator.h"
#include <vector>
@@ -35,11 +35,10 @@ bool VerifyDigestString(const std::string& key,
const std::string& digest_string) {
crypto::HMAC hmac(crypto::HMAC::SHA256);
std::vector<uint8> digest;
- return base::HexStringToBytes(digest_string, &digest) &&
- hmac.Init(key) &&
- hmac.Verify(message,
- base::StringPiece(reinterpret_cast<char*>(&digest[0]),
- digest.size()));
+ return base::HexStringToBytes(digest_string, &digest) && hmac.Init(key) &&
+ hmac.Verify(message,
+ base::StringPiece(reinterpret_cast<char*>(&digest[0]),
+ digest.size()));
}
// Renders |value| as a string. |value| may be NULL, in which case the result
@@ -96,9 +95,11 @@ PrefHashCalculator::PrefHashCalculator(const std::string& seed,
const std::string& device_id)
: seed_(seed),
device_id_(device_id),
- legacy_device_id_(GenerateDeviceIdLikePrefMetricsServiceDid(device_id)) {}
+ legacy_device_id_(GenerateDeviceIdLikePrefMetricsServiceDid(device_id)) {
+}
-PrefHashCalculator::~PrefHashCalculator() {}
+PrefHashCalculator::~PrefHashCalculator() {
+}
std::string PrefHashCalculator::Calculate(const std::string& path,
const base::Value* value) const {
« no previous file with comments | « components/user_prefs/tracked/pref_hash_calculator.h ('k') | components/user_prefs/tracked/pref_hash_calculator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698