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); |
} |