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

Unified Diff: chrome/browser/ui/webui/media_router/media_router_webui_message_handler.cc

Issue 2051663003: base::ListValue::Append cleanup: pass unique_ptr instead of the released pointer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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/media_router/media_router_webui_message_handler.cc
diff --git a/chrome/browser/ui/webui/media_router/media_router_webui_message_handler.cc b/chrome/browser/ui/webui/media_router/media_router_webui_message_handler.cc
index 879decc40f5fcf4f7f2a9f89e36779e73e930df6..dc9c475f6f9dc46518bb0795aeb7e3b78ae88c81 100644
--- a/chrome/browser/ui/webui/media_router/media_router_webui_message_handler.cc
+++ b/chrome/browser/ui/webui/media_router/media_router_webui_message_handler.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/ui/webui/media_router/media_router_webui_message_handler.h"
#include <string>
+#include <utility>
#include "base/bind.h"
#include "base/metrics/histogram_macros.h"
@@ -128,7 +129,7 @@ std::unique_ptr<base::DictionaryValue> SinksAndIdentityToValue(
sink_val->SetInteger("castModes", cast_mode_bits);
sink_val->SetBoolean("isPseudoSink", is_pseudo_sink);
- sinks_val->Append(sink_val.release());
+ sinks_val->Append(std::move(sink_val));
}
sink_list_and_identity->Set("sinks", sinks_val.release());
@@ -178,7 +179,7 @@ std::unique_ptr<base::ListValue> CastModesToValue(
cast_mode_val->SetString(
"description", MediaCastModeToDescription(cast_mode, source_host));
cast_mode_val->SetString("host", source_host);
- value->Append(cast_mode_val.release());
+ value->Append(std::move(cast_mode_val));
}
return value;
@@ -885,7 +886,7 @@ std::unique_ptr<base::ListValue> MediaRouterWebUIMessageHandler::RoutesToValue(
current_cast_modes);
std::unique_ptr<base::DictionaryValue> route_val(RouteToValue(
route, can_join, extension_id, off_the_record_, current_cast_mode));
- value->Append(route_val.release());
+ value->Append(std::move(route_val));
}
return value;

Powered by Google App Engine
This is Rietveld 408576698