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

Unified Diff: chrome/browser/extensions/api/idltest/idltest_api.cc

Issue 2282063002: [Extensions] Convert some SyncExtensionFunctions (Closed)
Patch Set: 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/idltest/idltest_api.cc
diff --git a/chrome/browser/extensions/api/idltest/idltest_api.cc b/chrome/browser/extensions/api/idltest/idltest_api.cc
index 7b341530d7459be41316cb3348649471c261031a..1864fd8e3c5368c9da3738fb74c3d71792e12984 100644
--- a/chrome/browser/extensions/api/idltest/idltest_api.cc
+++ b/chrome/browser/extensions/api/idltest/idltest_api.cc
@@ -26,22 +26,20 @@ std::unique_ptr<base::ListValue> CopyBinaryValueToIntegerList(
} // namespace
-bool IdltestSendArrayBufferFunction::RunSync() {
+ExtensionFunction::ResponseAction IdltestSendArrayBufferFunction::Run() {
BinaryValue* input = NULL;
EXTENSION_FUNCTION_VALIDATE(args_ != NULL && args_->GetBinary(0, &input));
- SetResult(CopyBinaryValueToIntegerList(input));
- return true;
+ return RespondNow(OneArgument(CopyBinaryValueToIntegerList(input)));
}
-bool IdltestSendArrayBufferViewFunction::RunSync() {
+ExtensionFunction::ResponseAction IdltestSendArrayBufferViewFunction::Run() {
BinaryValue* input = NULL;
EXTENSION_FUNCTION_VALIDATE(args_ != NULL && args_->GetBinary(0, &input));
- SetResult(CopyBinaryValueToIntegerList(input));
- return true;
+ return RespondNow(OneArgument(CopyBinaryValueToIntegerList(input)));
}
-bool IdltestGetArrayBufferFunction::RunSync() {
+ExtensionFunction::ResponseAction IdltestGetArrayBufferFunction::Run() {
std::string hello = "hello world";
- SetResult(BinaryValue::CreateWithCopiedBuffer(hello.c_str(), hello.size()));
- return true;
+ return RespondNow(OneArgument(
+ BinaryValue::CreateWithCopiedBuffer(hello.c_str(), hello.size())));
}

Powered by Google App Engine
This is Rietveld 408576698