| OLD | NEW |
| 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 "components/bookmarks/core/browser/bookmark_codec.h" | 5 #include "components/bookmarks/core/browser/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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 | 344 |
| 345 UpdateChecksumWithFolderNode(id_string, title); | 345 UpdateChecksumWithFolderNode(id_string, title); |
| 346 | 346 |
| 347 if (!DecodeChildren(*static_cast<const base::ListValue*>(child_values), | 347 if (!DecodeChildren(*static_cast<const base::ListValue*>(child_values), |
| 348 node)) { | 348 node)) { |
| 349 return false; | 349 return false; |
| 350 } | 350 } |
| 351 } | 351 } |
| 352 | 352 |
| 353 node->SetTitle(title); | 353 node->SetTitle(title); |
| 354 node->set_date_added(base::Time::FromInternalValue(internal_time)); | 354 node->set_date_added(Time::FromInternalValue(internal_time)); |
| 355 | 355 |
| 356 int64 sync_transaction_version = node->sync_transaction_version(); | 356 int64 sync_transaction_version = node->sync_transaction_version(); |
| 357 BookmarkNode::MetaInfoMap meta_info_map; | 357 BookmarkNode::MetaInfoMap meta_info_map; |
| 358 if (!DecodeMetaInfo(value, &meta_info_map, &sync_transaction_version)) | 358 if (!DecodeMetaInfo(value, &meta_info_map, &sync_transaction_version)) |
| 359 return false; | 359 return false; |
| 360 node->SetMetaInfoMap(meta_info_map); | 360 node->SetMetaInfoMap(meta_info_map); |
| 361 | 361 |
| 362 std::string sync_transaction_version_str; | 362 std::string sync_transaction_version_str; |
| 363 if (value.GetString(kSyncTransactionVersion, &sync_transaction_version_str) && | 363 if (value.GetString(kSyncTransactionVersion, &sync_transaction_version_str) && |
| 364 !base::StringToInt64(sync_transaction_version_str, | 364 !base::StringToInt64(sync_transaction_version_str, |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 } |
| OLD | NEW |