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

Unified Diff: chrome/browser/ui/webui/settings/protocol_handlers_handler.cc

Issue 2812953002: Stop passing raw pointers to base::Value API in c/b/ui (Closed)
Patch Set: No ListValue::SetDouble 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/protocol_handlers_handler.cc
diff --git a/chrome/browser/ui/webui/settings/protocol_handlers_handler.cc b/chrome/browser/ui/webui/settings/protocol_handlers_handler.cc
index 70d02e81591188a2711a1164a7ac2c02df8bf540..c851eb51e1356e54c40dd006b685bcc6d7396e9a 100644
--- a/chrome/browser/ui/webui/settings/protocol_handlers_handler.cc
+++ b/chrome/browser/ui/webui/settings/protocol_handlers_handler.cc
@@ -11,6 +11,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/browser/chrome_notification_types.h"
@@ -99,9 +100,10 @@ void ProtocolHandlersHandler::GetHandlersForProtocol(
handlers_value->SetBoolean("has_policy_recommendations",
registry->HasPolicyRegisteredHandler(protocol));
- base::ListValue* handlers_list = new base::ListValue();
- GetHandlersAsListValue(registry->GetHandlersFor(protocol), handlers_list);
- handlers_value->Set("handlers", handlers_list);
+ auto handlers_list = base::MakeUnique<base::ListValue>();
+ GetHandlersAsListValue(registry->GetHandlersFor(protocol),
+ handlers_list.get());
+ handlers_value->Set("handlers", std::move(handlers_list));
}
void ProtocolHandlersHandler::GetIgnoredHandlers(base::ListValue* handlers) {

Powered by Google App Engine
This is Rietveld 408576698