| 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;
|
|
|