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

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

Issue 7649006: more changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix another typo Created 9 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 roots->Set(kRootFolderNameKey, EncodeNode(bookmark_bar_node)); 58 roots->Set(kRootFolderNameKey, EncodeNode(bookmark_bar_node));
59 roots->Set(kOtherBookmarkFolderNameKey, EncodeNode(other_folder_node)); 59 roots->Set(kOtherBookmarkFolderNameKey, EncodeNode(other_folder_node));
60 roots->Set(kSyncedBookmarkFolderNameKey, EncodeNode(synced_folder_node)); 60 roots->Set(kSyncedBookmarkFolderNameKey, EncodeNode(synced_folder_node));
61 61
62 DictionaryValue* main = new DictionaryValue(); 62 DictionaryValue* main = new DictionaryValue();
63 main->SetInteger(kVersionKey, kCurrentVersion); 63 main->SetInteger(kVersionKey, kCurrentVersion);
64 FinalizeChecksum(); 64 FinalizeChecksum();
65 // We are going to store the computed checksum. So set stored checksum to be 65 // We are going to store the computed checksum. So set stored checksum to be
66 // the same as computed checksum. 66 // the same as computed checksum.
67 stored_checksum_ = computed_checksum_; 67 stored_checksum_ = computed_checksum_;
68 main->Set(kChecksumKey, Value::CreateStringValue(computed_checksum_)); 68 main->Set(kChecksumKey, base::StringValue::New(computed_checksum_));
69 main->Set(kRootsKey, roots); 69 main->Set(kRootsKey, roots);
70 return main; 70 return main;
71 } 71 }
72 72
73 bool BookmarkCodec::Decode(BookmarkNode* bb_node, 73 bool BookmarkCodec::Decode(BookmarkNode* bb_node,
74 BookmarkNode* other_folder_node, 74 BookmarkNode* other_folder_node,
75 BookmarkNode* synced_folder_node, 75 BookmarkNode* synced_folder_node,
76 int64* max_id, 76 int64* max_id,
77 const Value& value) { 77 const Value& value) {
78 ids_.clear(); 78 ids_.clear();
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 367
368 void BookmarkCodec::InitializeChecksum() { 368 void BookmarkCodec::InitializeChecksum() {
369 base::MD5Init(&md5_context_); 369 base::MD5Init(&md5_context_);
370 } 370 }
371 371
372 void BookmarkCodec::FinalizeChecksum() { 372 void BookmarkCodec::FinalizeChecksum() {
373 base::MD5Digest digest; 373 base::MD5Digest digest;
374 base::MD5Final(&digest, &md5_context_); 374 base::MD5Final(&digest, &md5_context_);
375 computed_checksum_ = base::MD5DigestToBase16(digest); 375 computed_checksum_ = base::MD5DigestToBase16(digest);
376 } 376 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698