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

Side by Side Diff: chrome/browser/prefs/pref_hash_calculator.h

Issue 110523006: Fix the hash generation algorithm to be consistent with prior implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile on Android. Created 6 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/prefs/pref_hash_calculator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 CHROME_BROWSER_PREFS_PREF_HASH_CALCULATOR_H_ 5 #ifndef CHROME_BROWSER_PREFS_PREF_HASH_CALCULATOR_H_
6 #define CHROME_BROWSER_PREFS_PREF_HASH_CALCULATOR_H_ 6 #define CHROME_BROWSER_PREFS_PREF_HASH_CALCULATOR_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 21 matching lines...) Expand all
32 std::string Calculate(const std::string& path, const base::Value* value) 32 std::string Calculate(const std::string& path, const base::Value* value)
33 const; 33 const;
34 34
35 // Validates the provided preference hash using current and legacy hashing 35 // Validates the provided preference hash using current and legacy hashing
36 // algorithms. 36 // algorithms.
37 ValidationResult Validate(const std::string& path, 37 ValidationResult Validate(const std::string& path,
38 const base::Value* value, 38 const base::Value* value,
39 const std::string& hash) const; 39 const std::string& hash) const;
40 40
41 private: 41 private:
42 // Calculate a hash using a deprecated hash algorithm. For validating old 42 // Concatenates |device_id_|, |path|, and |value| to give the hash input.
43 // hashes during migration. 43 std::string GetMessage(const std::string& path,
44 std::string CalculateLegacyHash(const std::string& path, 44 const base::Value* value) const;
45 const base::Value* value) const;
46 45
47 std::string seed_; 46 std::string seed_;
48 std::string device_id_; 47 std::string device_id_;
49 48
50 DISALLOW_COPY_AND_ASSIGN(PrefHashCalculator); 49 DISALLOW_COPY_AND_ASSIGN(PrefHashCalculator);
51 }; 50 };
52 51
53 #endif // CHROME_BROWSER_PREFS_PREF_HASH_CALCULATOR_H_ 52 #endif // CHROME_BROWSER_PREFS_PREF_HASH_CALCULATOR_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/prefs/pref_hash_calculator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698