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

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

Issue 1906973002: Convert //components/bookmarks from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « no previous file | components/bookmarks/browser/bookmark_codec_unittest.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 "components/bookmarks/browser/bookmark_codec.h" 5 #include "components/bookmarks/browser/bookmark_codec.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 BookmarkNode::MetaInfoMap* meta_info_map, 375 BookmarkNode::MetaInfoMap* meta_info_map,
376 int64_t* sync_transaction_version) { 376 int64_t* sync_transaction_version) {
377 DCHECK(meta_info_map); 377 DCHECK(meta_info_map);
378 DCHECK(sync_transaction_version); 378 DCHECK(sync_transaction_version);
379 meta_info_map->clear(); 379 meta_info_map->clear();
380 380
381 const base::Value* meta_info; 381 const base::Value* meta_info;
382 if (!value.Get(kMetaInfo, &meta_info)) 382 if (!value.Get(kMetaInfo, &meta_info))
383 return true; 383 return true;
384 384
385 scoped_ptr<base::Value> deserialized_holder; 385 std::unique_ptr<base::Value> deserialized_holder;
386 386
387 // Meta info used to be stored as a serialized dictionary, so attempt to 387 // Meta info used to be stored as a serialized dictionary, so attempt to
388 // parse the value as one. 388 // parse the value as one.
389 if (meta_info->IsType(base::Value::TYPE_STRING)) { 389 if (meta_info->IsType(base::Value::TYPE_STRING)) {
390 std::string meta_info_str; 390 std::string meta_info_str;
391 meta_info->GetAsString(&meta_info_str); 391 meta_info->GetAsString(&meta_info_str);
392 JSONStringValueDeserializer deserializer(meta_info_str); 392 JSONStringValueDeserializer deserializer(meta_info_str);
393 deserialized_holder = deserializer.Deserialize(nullptr, nullptr); 393 deserialized_holder = deserializer.Deserialize(nullptr, nullptr);
394 if (!deserialized_holder) 394 if (!deserialized_holder)
395 return false; 395 return false;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 base::MD5Init(&md5_context_); 483 base::MD5Init(&md5_context_);
484 } 484 }
485 485
486 void BookmarkCodec::FinalizeChecksum() { 486 void BookmarkCodec::FinalizeChecksum() {
487 base::MD5Digest digest; 487 base::MD5Digest digest;
488 base::MD5Final(&digest, &md5_context_); 488 base::MD5Final(&digest, &md5_context_);
489 computed_checksum_ = base::MD5DigestToBase16(digest); 489 computed_checksum_ = base::MD5DigestToBase16(digest);
490 } 490 }
491 491
492 } // namespace bookmarks 492 } // namespace bookmarks
OLDNEW
« no previous file with comments | « no previous file | components/bookmarks/browser/bookmark_codec_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698