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

Side by Side Diff: ui/app_list/search/history_data_store.cc

Issue 2911033002: Remove raw base::DictionaryValue::Set (Closed)
Patch Set: Proper Windows Fix Created 3 years, 6 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 | « tools/json_schema_compiler/test/objects_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ui/app_list/search/history_data_store.h" 5 #include "ui/app_list/search/history_data_store.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <utility> 10 #include <utility>
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 : data_store_(data_store) { 121 : data_store_(data_store) {
122 Init(data_store_->cached_dict()); 122 Init(data_store_->cached_dict());
123 } 123 }
124 124
125 HistoryDataStore::~HistoryDataStore() { 125 HistoryDataStore::~HistoryDataStore() {
126 } 126 }
127 127
128 void HistoryDataStore::Init(base::DictionaryValue* cached_dict) { 128 void HistoryDataStore::Init(base::DictionaryValue* cached_dict) {
129 DCHECK(cached_dict); 129 DCHECK(cached_dict);
130 cached_dict->SetString(kKeyVersion, kCurrentVersion); 130 cached_dict->SetString(kKeyVersion, kCurrentVersion);
131 cached_dict->Set(kKeyAssociations, new base::DictionaryValue); 131 cached_dict->Set(kKeyAssociations, base::MakeUnique<base::DictionaryValue>());
132 } 132 }
133 133
134 void HistoryDataStore::Flush( 134 void HistoryDataStore::Flush(
135 DictionaryDataStore::OnFlushedCallback on_flushed) { 135 DictionaryDataStore::OnFlushedCallback on_flushed) {
136 if (data_store_) 136 if (data_store_)
137 data_store_->Flush(std::move(on_flushed)); 137 data_store_->Flush(std::move(on_flushed));
138 else 138 else
139 std::move(on_flushed).Run(); 139 std::move(on_flushed).Run();
140 } 140 }
141 141
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 OnLoadedCallback callback, 216 OnLoadedCallback callback,
217 std::unique_ptr<base::DictionaryValue> dict) { 217 std::unique_ptr<base::DictionaryValue> dict) {
218 if (!dict) { 218 if (!dict) {
219 callback.Run(nullptr); 219 callback.Run(nullptr);
220 } else { 220 } else {
221 callback.Run(Parse(std::move(dict))); 221 callback.Run(Parse(std::move(dict)));
222 } 222 }
223 } 223 }
224 224
225 } // namespace app_list 225 } // namespace app_list
OLDNEW
« no previous file with comments | « tools/json_schema_compiler/test/objects_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698