| 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) {
|
|
|