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

Unified Diff: ui/app_list/search/history_data_store.cc

Issue 1924743005: Move away from deprecated base::Value methods in //ui (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/app_list/search/dictionary_data_store.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/search/history_data_store.cc
diff --git a/ui/app_list/search/history_data_store.cc b/ui/app_list/search/history_data_store.cc
index de0a57262b56014c479db259aa1b6f355cf879e7..1eb92b0d207a8d9871a4c4ae752ecc789b5908cc 100644
--- a/ui/app_list/search/history_data_store.cc
+++ b/ui/app_list/search/history_data_store.cc
@@ -145,16 +145,14 @@ void HistoryDataStore::Load(
data_store_->Load(base::Bind(
&HistoryDataStore::OnDictionaryLoadedCallback, this, on_loaded));
} else {
- OnDictionaryLoadedCallback(on_loaded,
- base::WrapUnique(cached_dict_->DeepCopy()));
+ OnDictionaryLoadedCallback(on_loaded, cached_dict_->CreateDeepCopy());
}
}
void HistoryDataStore::SetPrimary(const std::string& query,
const std::string& result) {
base::DictionaryValue* entry_dict = GetEntryDict(query);
- entry_dict->SetWithoutPathExpansion(kKeyPrimary,
- new base::StringValue(result));
+ entry_dict->SetStringWithoutPathExpansion(kKeyPrimary, result);
if (data_store_.get())
data_store_->ScheduleWrite();
}
@@ -175,9 +173,8 @@ void HistoryDataStore::SetSecondary(
void HistoryDataStore::SetUpdateTime(const std::string& query,
const base::Time& update_time) {
base::DictionaryValue* entry_dict = GetEntryDict(query);
- entry_dict->SetWithoutPathExpansion(kKeyUpdateTime,
- new base::StringValue(base::Int64ToString(
- update_time.ToInternalValue())));
+ entry_dict->SetStringWithoutPathExpansion(
+ kKeyUpdateTime, base::Int64ToString(update_time.ToInternalValue()));
if (data_store_.get())
data_store_->ScheduleWrite();
}
@@ -205,11 +202,11 @@ base::DictionaryValue* HistoryDataStore::GetEntryDict(
const std::string& query) {
base::DictionaryValue* assoc_dict = GetAssociationDict();
- base::DictionaryValue* entry_dict = NULL;
+ base::DictionaryValue* entry_dict = nullptr;
if (!assoc_dict->GetDictionaryWithoutPathExpansion(query, &entry_dict)) {
// Creates one if none exists. Ownership is taken in the set call after.
entry_dict = new base::DictionaryValue;
- assoc_dict->SetWithoutPathExpansion(query, entry_dict);
+ assoc_dict->SetWithoutPathExpansion(query, base::WrapUnique(entry_dict));
}
return entry_dict;
« no previous file with comments | « ui/app_list/search/dictionary_data_store.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698