Description[Extensions Bindings] Add lastError utilities to APIBindingJSUtil
Some custom bindings require the ability to query or mutate the
lastError state. Provide native bindings to perform the following
functions:
- setLastError
- clearLastError
- hasLastError
- runCallbackWithLastError (sets the last error, runs the provided
callback, and then clears the last error).
Add tests for the same.
Note that in the JS bindings, the analogous methods also accept a
context "chrome" object. This is bad, since its only use is allowing
cross-context modification. We should see if we can eliminate it.
BUG=653596
Review-Url: https://codereview.chromium.org/2762623003
Cr-Commit-Position: refs/heads/master@{#459334}
Committed: https://chromium.googlesource.com/chromium/src/+/2615ab3076703e2d4e409370ba32c46ab0aa170c
Patch Set 1 #Patch Set 2 : . #Patch Set 3 : . #
Total comments: 10
Patch Set 4 : jbroman's #
Total comments: 2
Patch Set 5 : s/empty/undefined #Patch Set 6 : Rebase #Messages
Total messages: 20 (11 generated)
|