Chromium Code Reviews
DescriptionIntroduce AlreadyResponded() response action from ExtensionFunction.
Currently ExtensionFunction::Run has to either:
call RespondNow() to synchronously respond or
call RespondLater() to asynchronously Respond() later point in time after
Run() finishes.
There are some asynchronous ExtensionFunction implementations where,
due to how base:: callbacks are used in them, it can be difficult to
pick either one of the two responses above. This happens when a callback
used in Run() can sometimes synchronously fire and if the callback
calls Respond(), then returning RespondLater() from Run() would be
a wrong choice.
This CL provides AlreadyResponded() response action for those cases.
While returning response from Run(), the ExtensionFunction can check
whether it has already responded and return AlreadyResponded(). Otherwise,
it can return RespondLater().
This CL removes some usages of AsyncExtensionFunction::results_ in turn.
This CL also converts those classes to directly inherit from
UIThreadExtensionFunction.
BUG=648275
Review-Url: https://codereview.chromium.org/2612873004
Cr-Commit-Position: refs/heads/master@{#445507}
Committed: https://chromium.googlesource.com/chromium/src/+/30abd07e271e93f99b70745a08b360793be779cc
Patch Set 1 #
Total comments: 15
Patch Set 2 : fix async calls + introduce AlreadyResponded() #Patch Set 3 : revert system_network_api changes #Patch Set 4 : add DCHECK message #
Total comments: 4
Patch Set 5 : address comments #Patch Set 6 : fix argument types of Get*NetworksFunction #Patch Set 7 : sync #Messages
Total messages: 29 (19 generated)
|