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

Unified Diff: chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc

Issue 2812953002: Stop passing raw pointers to base::Value API in c/b/ui (Closed)
Patch Set: Rebased 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/webui/settings/chromeos/cups_printers_handler.cc
diff --git a/chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc b/chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc
index 8a8b009155a903623419459db0c7c24f9b3d7dd0..d6831145d4ecf4e7eba37662c21da333b07094d0 100644
--- a/chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc
+++ b/chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc
@@ -138,7 +138,7 @@ void CupsPrintersHandler::HandleGetCupsPrintersList(
std::vector<std::unique_ptr<Printer>> printers =
PrintersManagerFactory::GetForBrowserContext(profile_)->GetPrinters();
- base::ListValue* printers_list = new base::ListValue;
+ auto printers_list = base::MakeUnique<base::ListValue>();
for (const std::unique_ptr<Printer>& printer : printers) {
std::unique_ptr<base::DictionaryValue> printer_info =
GetPrinterInfo(*printer.get());
@@ -147,7 +147,7 @@ void CupsPrintersHandler::HandleGetCupsPrintersList(
std::unique_ptr<base::DictionaryValue> response =
jdoerrie 2017/04/13 09:08:52 auto
vabr (Chromium) 2017/04/13 12:03:14 Done.
base::MakeUnique<base::DictionaryValue>();
- response->Set("printerList", printers_list);
+ response->Set("printerList", std::move(printers_list));
ResolveJavascriptCallback(base::Value(callback_id), *response);
}

Powered by Google App Engine
This is Rietveld 408576698