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

Unified Diff: extensions/browser/api/app_runtime/app_runtime_api.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: extensions/browser/api/app_runtime/app_runtime_api.cc
diff --git a/extensions/browser/api/app_runtime/app_runtime_api.cc b/extensions/browser/api/app_runtime/app_runtime_api.cc
index c652d8c174567a79795a8677e88b05d6bc5962fc..2b225df2f2f35628f5559423d10840d59fafbd0b 100644
--- a/extensions/browser/api/app_runtime/app_runtime_api.cc
+++ b/extensions/browser/api/app_runtime/app_runtime_api.cc
@@ -34,7 +34,7 @@ void DispatchOnEmbedRequestedEventImpl(
std::unique_ptr<base::DictionaryValue> app_embedding_request_data,
content::BrowserContext* context) {
std::unique_ptr<base::ListValue> args(new base::ListValue());
- args->Append(app_embedding_request_data.release());
+ args->Append(std::move(app_embedding_request_data));
std::unique_ptr<Event> event(
new Event(events::APP_RUNTIME_ON_EMBED_REQUESTED,
app_runtime::OnEmbedRequested::kEventName, std::move(args)));
@@ -64,7 +64,7 @@ void DispatchOnLaunchedEventImpl(
ExtensionsBrowserClient::Get()->IsLoggedInAsPublicAccount());
std::unique_ptr<base::ListValue> args(new base::ListValue());
- args->Append(launch_data.release());
+ args->Append(std::move(launch_data));
std::unique_ptr<Event> event(new Event(events::APP_RUNTIME_ON_LAUNCHED,
app_runtime::OnLaunched::kEventName,
std::move(args)));
@@ -190,7 +190,7 @@ void AppRuntimeEventRouter::DispatchOnLaunchedEventWithFileEntries(
launch_item->SetString("mimeType", entries[i].mime_type);
launch_item->SetString("entryId", file_entries[i].id);
launch_item->SetBoolean("isDirectory", entries[i].is_directory);
- items->Append(launch_item.release());
+ items->Append(std::move(launch_item));
}
launch_data->Set("items", items.release());
DispatchOnLaunchedEventImpl(extension->id(), source_enum,

Powered by Google App Engine
This is Rietveld 408576698