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

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

Issue 448853002: Move StringToLowerASCII to base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
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 #include "chrome/browser/prefs/pref_hash_calculator.h" 5 #include "chrome/browser/prefs/pref_hash_calculator.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/json/json_string_value_serializer.h" 10 #include "base/json/json_string_value_serializer.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 79
80 // Generates a device ID based on the input device ID. The derived device ID has 80 // Generates a device ID based on the input device ID. The derived device ID has
81 // no useful properties beyond those of the input device ID except that it is 81 // no useful properties beyond those of the input device ID except that it is
82 // consistent with previous implementations. 82 // consistent with previous implementations.
83 // TODO(gab): Remove this once UMA reports for 83 // TODO(gab): Remove this once UMA reports for
84 // Settings.TrackedPreferenceMigratedLegacyDeviceId become insignificant. 84 // Settings.TrackedPreferenceMigratedLegacyDeviceId become insignificant.
85 std::string GenerateDeviceIdLikePrefMetricsServiceDid( 85 std::string GenerateDeviceIdLikePrefMetricsServiceDid(
86 const std::string& original_device_id) { 86 const std::string& original_device_id) {
87 if (original_device_id.empty()) 87 if (original_device_id.empty())
88 return std::string(); 88 return std::string();
89 return StringToLowerASCII( 89 return base::StringToLowerASCII(
90 GetDigestString(original_device_id, "PrefMetricsService")); 90 GetDigestString(original_device_id, "PrefMetricsService"));
91 } 91 }
92 92
93 } // namespace 93 } // namespace
94 94
95 PrefHashCalculator::PrefHashCalculator(const std::string& seed, 95 PrefHashCalculator::PrefHashCalculator(const std::string& seed,
96 const std::string& device_id) 96 const std::string& device_id)
97 : seed_(seed), 97 : seed_(seed),
98 device_id_(device_id), 98 device_id_(device_id),
99 legacy_device_id_(GenerateDeviceIdLikePrefMetricsServiceDid(device_id)) {} 99 legacy_device_id_(GenerateDeviceIdLikePrefMetricsServiceDid(device_id)) {}
(...skipping 15 matching lines...) Expand all
115 digest_string)) { 115 digest_string)) {
116 return VALID; 116 return VALID;
117 } 117 }
118 if (VerifyDigestString(seed_, 118 if (VerifyDigestString(seed_,
119 GetMessage(legacy_device_id_, path, value_as_string), 119 GetMessage(legacy_device_id_, path, value_as_string),
120 digest_string)) { 120 digest_string)) {
121 return VALID_SECURE_LEGACY; 121 return VALID_SECURE_LEGACY;
122 } 122 }
123 return INVALID; 123 return INVALID;
124 } 124 }
OLDNEW
« no previous file with comments | « chrome/browser/media_galleries/fileapi/media_path_filter.cc ('k') | chrome/browser/profiles/profile_io_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698