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

Side by Side Diff: chrome/browser/bookmarks/bookmark_codec.cc

Issue 196793010: Move IsStringASCII/UTF8 to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | « chrome/app/chrome_main_delegate.cc ('k') | chrome/browser/bookmarks/bookmark_html_writer.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/bookmarks/bookmark_codec.h" 5 #include "chrome/browser/bookmarks/bookmark_codec.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/json/json_string_value_serializer.h" 9 #include "base/json/json_string_value_serializer.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 void BookmarkCodec::UpdateChecksum(const base::string16& str) { 457 void BookmarkCodec::UpdateChecksum(const base::string16& str) {
458 base::MD5Update(&md5_context_, 458 base::MD5Update(&md5_context_,
459 base::StringPiece( 459 base::StringPiece(
460 reinterpret_cast<const char*>(str.data()), 460 reinterpret_cast<const char*>(str.data()),
461 str.length() * sizeof(str[0]))); 461 str.length() * sizeof(str[0])));
462 } 462 }
463 463
464 void BookmarkCodec::UpdateChecksumWithUrlNode(const std::string& id, 464 void BookmarkCodec::UpdateChecksumWithUrlNode(const std::string& id,
465 const base::string16& title, 465 const base::string16& title,
466 const std::string& url) { 466 const std::string& url) {
467 DCHECK(IsStringUTF8(url)); 467 DCHECK(base::IsStringUTF8(url));
468 UpdateChecksum(id); 468 UpdateChecksum(id);
469 UpdateChecksum(title); 469 UpdateChecksum(title);
470 UpdateChecksum(kTypeURL); 470 UpdateChecksum(kTypeURL);
471 UpdateChecksum(url); 471 UpdateChecksum(url);
472 } 472 }
473 473
474 void BookmarkCodec::UpdateChecksumWithFolderNode(const std::string& id, 474 void BookmarkCodec::UpdateChecksumWithFolderNode(const std::string& id,
475 const base::string16& title) { 475 const base::string16& title) {
476 UpdateChecksum(id); 476 UpdateChecksum(id);
477 UpdateChecksum(title); 477 UpdateChecksum(title);
478 UpdateChecksum(kTypeFolder); 478 UpdateChecksum(kTypeFolder);
479 } 479 }
480 480
481 void BookmarkCodec::InitializeChecksum() { 481 void BookmarkCodec::InitializeChecksum() {
482 base::MD5Init(&md5_context_); 482 base::MD5Init(&md5_context_);
483 } 483 }
484 484
485 void BookmarkCodec::FinalizeChecksum() { 485 void BookmarkCodec::FinalizeChecksum() {
486 base::MD5Digest digest; 486 base::MD5Digest digest;
487 base::MD5Final(&digest, &md5_context_); 487 base::MD5Final(&digest, &md5_context_);
488 computed_checksum_ = base::MD5DigestToBase16(digest); 488 computed_checksum_ = base::MD5DigestToBase16(digest);
489 } 489 }
OLDNEW
« no previous file with comments | « chrome/app/chrome_main_delegate.cc ('k') | chrome/browser/bookmarks/bookmark_html_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698