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

Unified Diff: chrome/browser/extensions/api/command_line_private/command_line_private_api.cc

Issue 2236703002: [Extensions] Convert some SyncExtensionFunctions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nulltpr Created 4 years, 4 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/command_line_private/command_line_private_api.cc
diff --git a/chrome/browser/extensions/api/command_line_private/command_line_private_api.cc b/chrome/browser/extensions/api/command_line_private/command_line_private_api.cc
index fec43b8cfd07f0aad5c1f8f28e43b338d8e3fb99..7bcc6848f6f4918e569e56af5cb4f75a34a717b1 100644
--- a/chrome/browser/extensions/api/command_line_private/command_line_private_api.cc
+++ b/chrome/browser/extensions/api/command_line_private/command_line_private_api.cc
@@ -21,19 +21,17 @@ namespace extensions {
namespace command_line_private = api::command_line_private;
-bool CommandLinePrivateHasSwitchFunction::RunSync() {
+ExtensionFunction::ResponseAction CommandLinePrivateHasSwitchFunction::Run() {
std::unique_ptr<command_line_private::HasSwitch::Params> params(
command_line_private::HasSwitch::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params);
- if (params->name.empty()) {
- error_ = kEmptySwitchName;
- return false;
- }
+ if (params->name.empty())
+ return RespondNow(Error(kEmptySwitchName));
- results_ = command_line_private::HasSwitch::Results::Create(
- base::CommandLine::ForCurrentProcess()->HasSwitch(params->name));
- return true;
+ return RespondNow(
+ ArgumentList(command_line_private::HasSwitch::Results::Create(
+ base::CommandLine::ForCurrentProcess()->HasSwitch(params->name))));
}
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698