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

Unified Diff: chrome/browser/chromeos/app_mode/kiosk_app_manager.cc

Issue 2765363004: Stop passing raw pointers to DictionaryValue::Set, part 2 (Closed)
Patch Set: Fix comments Created 3 years, 9 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/chromeos/app_mode/kiosk_app_manager.cc
diff --git a/chrome/browser/chromeos/app_mode/kiosk_app_manager.cc b/chrome/browser/chromeos/app_mode/kiosk_app_manager.cc
index 2c11928eeb7570fb4cea889a61905e874794ec43..a4bba2a774053bc019e57369b114edfb86c14a5b 100644
--- a/chrome/browser/chromeos/app_mode/kiosk_app_manager.cc
+++ b/chrome/browser/chromeos/app_mode/kiosk_app_manager.cc
@@ -639,8 +639,7 @@ void KioskAppManager::InstallFromCache(const std::string& id) {
const base::DictionaryValue* extension = nullptr;
if (external_cache_->cached_extensions()->GetDictionary(id, &extension)) {
std::unique_ptr<base::DictionaryValue> prefs(new base::DictionaryValue);
- base::DictionaryValue* extension_copy = extension->DeepCopy();
- prefs->Set(id, extension_copy);
+ prefs->Set(id, extension->CreateDeepCopy());
external_loader_->SetCurrentAppExtensions(std::move(prefs));
} else {
LOG(ERROR) << "Can't find app in the cached externsions"
@@ -887,7 +886,7 @@ void KioskAppManager::UpdateExternalCachePrefs() {
extension_urls::GetWebstoreUpdateUrl().spec());
}
- prefs->Set(apps_[i]->app_id(), entry.release());
+ prefs->Set(apps_[i]->app_id(), std::move(entry));
}
external_cache_->UpdateExtensionsList(std::move(prefs));
}

Powered by Google App Engine
This is Rietveld 408576698