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

Side by Side Diff: google_apis/gcm/engine/gservices_settings.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
« no previous file with comments | « google_apis/gaia/gaia_auth_util.cc ('k') | gpu/command_buffer/service/feature_info.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 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 "google_apis/gcm/engine/gservices_settings.h" 5 #include "google_apis/gcm/engine/gservices_settings.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/sha1.h" 8 #include "base/sha1.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 ++iter) { 189 ++iter) {
190 data += iter->first; 190 data += iter->first;
191 data += '\0'; 191 data += '\0';
192 data += iter->second; 192 data += iter->second;
193 data += '\0'; 193 data += '\0';
194 } 194 }
195 base::SHA1HashBytes( 195 base::SHA1HashBytes(
196 reinterpret_cast<const unsigned char*>(&data[0]), data.size(), hash); 196 reinterpret_cast<const unsigned char*>(&data[0]), data.size(), hash);
197 std::string digest = 197 std::string digest =
198 kDigestVersionPrefix + base::HexEncode(hash, base::kSHA1Length); 198 kDigestVersionPrefix + base::HexEncode(hash, base::kSHA1Length);
199 digest = StringToLowerASCII(digest); 199 digest = base::StringToLowerASCII(digest);
200 return digest; 200 return digest;
201 } 201 }
202 202
203 GServicesSettings::GServicesSettings() : weak_ptr_factory_(this) { 203 GServicesSettings::GServicesSettings() : weak_ptr_factory_(this) {
204 digest_ = CalculateDigest(settings_); 204 digest_ = CalculateDigest(settings_);
205 } 205 }
206 206
207 GServicesSettings::~GServicesSettings() { 207 GServicesSettings::~GServicesSettings() {
208 } 208 }
209 209
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 } 333 }
334 334
335 GURL GServicesSettings::GetRegistrationURL() const { 335 GURL GServicesSettings::GetRegistrationURL() const {
336 SettingsMap::const_iterator iter = settings_.find(kRegistrationURLKey); 336 SettingsMap::const_iterator iter = settings_.find(kRegistrationURLKey);
337 if (iter == settings_.end() || iter->second.empty()) 337 if (iter == settings_.end() || iter->second.empty())
338 return GURL(kDefaultRegistrationURL); 338 return GURL(kDefaultRegistrationURL);
339 return GURL(iter->second); 339 return GURL(iter->second);
340 } 340 }
341 341
342 } // namespace gcm 342 } // namespace gcm
OLDNEW
« no previous file with comments | « google_apis/gaia/gaia_auth_util.cc ('k') | gpu/command_buffer/service/feature_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698