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

Unified Diff: chrome/browser/media_galleries/media_galleries_preferences.cc

Issue 2058233002: Rewrite simple uses of base::ListValue::Append() taking a raw pointer var. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: less comments more ownership Created 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/media_galleries/media_galleries_preferences.cc
diff --git a/chrome/browser/media_galleries/media_galleries_preferences.cc b/chrome/browser/media_galleries/media_galleries_preferences.cc
index 2a4d8d0f5171d04cb6419134e0061b41eb9992a4..ad8c7aaa11b31dac016749b69edf99436a83a711 100644
--- a/chrome/browser/media_galleries/media_galleries_preferences.cc
+++ b/chrome/browser/media_galleries/media_galleries_preferences.cc
@@ -6,6 +6,9 @@
#include <stddef.h>
+#include <memory>
+#include <utility>
+
#include "base/base_paths_posix.h"
#include "base/callback.h"
#include "base/i18n/time_formatting.h"
@@ -1350,10 +1353,10 @@ bool MediaGalleriesPreferences::SetGalleryPermissionInPrefs(
}
}
// ...Otherwise, add a new entry for the gallery.
- base::DictionaryValue* dict = new base::DictionaryValue;
+ std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue);
dict->SetString(kMediaGalleryIdKey, base::Uint64ToString(gallery_id));
dict->SetBoolean(kMediaGalleryHasPermissionKey, has_access);
- permissions->Append(dict);
+ permissions->Append(std::move(dict));
return true;
}

Powered by Google App Engine
This is Rietveld 408576698