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

Unified Diff: extensions/browser/extension_function.cc

Issue 2612873004: Remove some usages of AsyncExtensionFunction::results_. (Closed)
Patch Set: sync Created 3 years, 11 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
« no previous file with comments | « extensions/browser/extension_function.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/extension_function.cc
diff --git a/extensions/browser/extension_function.cc b/extensions/browser/extension_function.cc
index c9a76ac5a8361b5e4c50501406d41b37dd27669e..548153710550e3e388f154ae1092651d1b7def8e 100644
--- a/extensions/browser/extension_function.cc
+++ b/extensions/browser/extension_function.cc
@@ -153,6 +153,13 @@ class RespondLaterAction : public ExtensionFunction::ResponseActionObject {
void Execute() override {}
};
+class AlreadyRespondedAction : public ExtensionFunction::ResponseActionObject {
+ public:
+ ~AlreadyRespondedAction() override {}
+
+ void Execute() override {}
+};
+
// Used in implementation of ScopedUserGestureForTests.
class UserGestureForTests {
public:
@@ -393,6 +400,12 @@ ExtensionFunction::ResponseAction ExtensionFunction::RespondLater() {
return ResponseAction(new RespondLaterAction());
}
+ExtensionFunction::ResponseAction ExtensionFunction::AlreadyResponded() {
+ DCHECK(did_respond()) << "ExtensionFunction did not call Respond(),"
+ " but Run() returned AlreadyResponded()";
+ return ResponseAction(new AlreadyRespondedAction());
+}
+
// static
ExtensionFunction::ResponseAction ExtensionFunction::ValidationFailure(
ExtensionFunction* function) {
« no previous file with comments | « extensions/browser/extension_function.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698