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

Unified Diff: chrome/browser/extensions/api/commands/commands.cc

Issue 1991083002: Remove ExtensionFunction::SetResult(T*) overload. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: IWYU Created 4 years, 7 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/extensions/api/commands/commands.cc
diff --git a/chrome/browser/extensions/api/commands/commands.cc b/chrome/browser/extensions/api/commands/commands.cc
index 2cc997b1ae9f70711874a1f7b66771e951ce5a8e..64c03e8e295df310cc0e3c7771b7d21725e184e4 100644
--- a/chrome/browser/extensions/api/commands/commands.cc
+++ b/chrome/browser/extensions/api/commands/commands.cc
@@ -4,6 +4,9 @@
#include "chrome/browser/extensions/api/commands/commands.h"
+#include <memory>
+#include <utility>
+
#include "chrome/browser/extensions/api/commands/command_service.h"
#include "chrome/browser/profiles/profile.h"
@@ -23,7 +26,7 @@ base::DictionaryValue* CreateCommandValue(
} // namespace
bool GetAllCommandsFunction::RunSync() {
- base::ListValue* command_list = new base::ListValue();
+ std::unique_ptr<base::ListValue> command_list(new base::ListValue());
extensions::CommandService* command_service =
extensions::CommandService::Get(GetProfile());
@@ -61,6 +64,6 @@ bool GetAllCommandsFunction::RunSync() {
command_list->Append(CreateCommandValue(iter->second, active));
}
- SetResult(command_list);
+ SetResult(std::move(command_list));
return true;
}

Powered by Google App Engine
This is Rietveld 408576698