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

Unified Diff: chrome/browser/ui/webui/options/import_data_handler.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/ui/webui/options/import_data_handler.cc
diff --git a/chrome/browser/ui/webui/options/import_data_handler.cc b/chrome/browser/ui/webui/options/import_data_handler.cc
index 72127cea65c6963ab9297ce6b101407511f6f307..bef03700bb5ce0b2c705599def10f1956f930782 100644
--- a/chrome/browser/ui/webui/options/import_data_handler.cc
+++ b/chrome/browser/ui/webui/options/import_data_handler.cc
@@ -6,8 +6,8 @@
#include <stddef.h>
-#include <memory>
#include <string>
+#include <utility>
#include "base/bind.h"
#include "base/bind_helpers.h"
@@ -178,7 +178,8 @@ void ImportDataHandler::InitializePage() {
importer_list_->GetSourceProfileAt(i);
uint16_t browser_services = source_profile.services_supported;
- base::DictionaryValue* browser_profile = new base::DictionaryValue();
+ std::unique_ptr<base::DictionaryValue> browser_profile(
+ new base::DictionaryValue());
browser_profile->SetString("name", source_profile.importer_name);
browser_profile->SetInteger("index", i);
browser_profile->SetBoolean("history",
@@ -192,7 +193,7 @@ void ImportDataHandler::InitializePage() {
browser_profile->SetBoolean("autofill-form-data",
(browser_services & importer::AUTOFILL_FORM_DATA) != 0);
- browser_profiles.Append(browser_profile);
+ browser_profiles.Append(std::move(browser_profile));
}
web_ui()->CallJavascriptFunctionUnsafe(

Powered by Google App Engine
This is Rietveld 408576698