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

Unified Diff: chrome/browser/ui/app_list/search/common/webservice_cache.cc

Issue 2812953002: Stop passing raw pointers to base::Value API in c/b/ui (Closed)
Patch Set: No ListValue::SetDouble Created 3 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
Index: chrome/browser/ui/app_list/search/common/webservice_cache.cc
diff --git a/chrome/browser/ui/app_list/search/common/webservice_cache.cc b/chrome/browser/ui/app_list/search/common/webservice_cache.cc
index 40b116ac4613152145b96a6a2636ab3e119884f8..b1f103c74454d90ac6dbd10bc59df22a5df2be45 100644
--- a/chrome/browser/ui/app_list/search/common/webservice_cache.cc
+++ b/chrome/browser/ui/app_list/search/common/webservice_cache.cc
@@ -128,15 +128,15 @@ bool WebserviceCache::PayloadFromDict(const base::DictionaryValue* dict,
return true;
}
-base::DictionaryValue* WebserviceCache::DictFromPayload(
+std::unique_ptr<base::DictionaryValue> WebserviceCache::DictFromPayload(
const Payload& payload) {
- base::DictionaryValue* dict = new base::DictionaryValue();
+ auto dict = base::MakeUnique<base::DictionaryValue>();
dict->SetString(kKeyResultTime, base::Int64ToString(
payload.time.ToInternalValue()));
// The payload will still keep ownership of it's result dict, hence put a
// a copy of the result dictionary here. This dictionary will be owned by
// data_store_->cached_dict().
- dict->Set(kKeyResult, payload.result->DeepCopy());
+ dict->Set(kKeyResult, base::MakeUnique<base::Value>(*payload.result));
return dict;
}
« no previous file with comments | « chrome/browser/ui/app_list/search/common/webservice_cache.h ('k') | chrome/browser/ui/ash/chrome_launcher_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698