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

Side by Side Diff: components/user_prefs/tracked/dictionary_hash_store_contents.cc

Issue 1908143002: Convert //components/user_prefs from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restore the rightful glory of <windows.h> 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
OLDNEW
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/user_prefs/tracked/dictionary_hash_store_contents.h" 5 #include "components/user_prefs/tracked/dictionary_hash_store_contents.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 bool DictionaryHashStoreContents::IsInitialized() const { 71 bool DictionaryHashStoreContents::IsInitialized() const {
72 return storage_->GetDictionary(kPreferenceMACs, NULL); 72 return storage_->GetDictionary(kPreferenceMACs, NULL);
73 } 73 }
74 74
75 const base::DictionaryValue* DictionaryHashStoreContents::GetContents() const { 75 const base::DictionaryValue* DictionaryHashStoreContents::GetContents() const {
76 const base::DictionaryValue* mac_dictionary = NULL; 76 const base::DictionaryValue* mac_dictionary = NULL;
77 storage_->GetDictionary(kPreferenceMACs, &mac_dictionary); 77 storage_->GetDictionary(kPreferenceMACs, &mac_dictionary);
78 return mac_dictionary; 78 return mac_dictionary;
79 } 79 }
80 80
81 scoped_ptr<HashStoreContents::MutableDictionary> 81 std::unique_ptr<HashStoreContents::MutableDictionary>
82 DictionaryHashStoreContents::GetMutableContents() { 82 DictionaryHashStoreContents::GetMutableContents() {
83 return scoped_ptr<MutableDictionary>( 83 return std::unique_ptr<MutableDictionary>(
84 new MutablePreferenceMacDictionary(storage_)); 84 new MutablePreferenceMacDictionary(storage_));
85 } 85 }
86 86
87 std::string DictionaryHashStoreContents::GetSuperMac() const { 87 std::string DictionaryHashStoreContents::GetSuperMac() const {
88 std::string super_mac_string; 88 std::string super_mac_string;
89 storage_->GetString(kSuperMACPref, &super_mac_string); 89 storage_->GetString(kSuperMACPref, &super_mac_string);
90 return super_mac_string; 90 return super_mac_string;
91 } 91 }
92 92
93 void DictionaryHashStoreContents::SetSuperMac(const std::string& super_mac) { 93 void DictionaryHashStoreContents::SetSuperMac(const std::string& super_mac) {
94 storage_->SetString(kSuperMACPref, super_mac); 94 storage_->SetString(kSuperMACPref, super_mac);
95 } 95 }
OLDNEW
« no previous file with comments | « components/user_prefs/tracked/dictionary_hash_store_contents.h ('k') | components/user_prefs/tracked/hash_store_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698