|
[Extensions Bindings] Add an ExceptionHandler class
There are a number of times we need to handle exceptions from untrusted
code running in the bindings system; two of the main ones include when
running a callback to an asynchronous extension function and when
dispatching events to listeners. In both of these cases, we want to log
the exception (so the developer knows something went wrong), but we
don't want to allow the exception to interrupt the flow of running JS.
Introduce an ExceptionHandler class to handle these cases and log the
caught exceptions to either the console (default) or a custom-set
handler (used in testing). Wire it up to the APIRequestHandler (with
more uses coming in later patch sets).
Add unit tests for both the ExceptionHandler and the APIRequestHandler's
use of it.
BUG= 653596
Review-Url: https://codereview.chromium.org/2961103002
Cr-Commit-Position: refs/heads/master@{#485807}
Committed: https://chromium.googlesource.com/chromium/src/+/e5e2cb9ce72dd22be2685f08cf881d6141cb21b0
Total comments: 9
Total comments: 14
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+448 lines, -81 lines) |
Patch |
 |
M |
extensions/renderer/BUILD.gn
|
View
|
1
2
3
4
|
2 chunks |
+3 lines, -0 lines |
0 comments
|
Download
|
 |
M |
extensions/renderer/bindings/api_binding_types.h
|
View
|
|
1 chunk |
+4 lines, -0 lines |
0 comments
|
Download
|
 |
M |
extensions/renderer/bindings/api_binding_unittest.cc
|
View
|
1
2
3
4
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
extensions/renderer/bindings/api_bindings_system.h
|
View
|
1
2
3
4
|
4 chunks |
+6 lines, -0 lines |
0 comments
|
Download
|
 |
M |
extensions/renderer/bindings/api_bindings_system.cc
|
View
|
1
2
3
4
|
1 chunk |
+6 lines, -1 line |
0 comments
|
Download
|
 |
M |
extensions/renderer/bindings/api_bindings_system_unittest.cc
|
View
|
1
2
3
4
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
extensions/renderer/bindings/api_last_error.h
|
View
|
1
2
|
3 chunks |
+3 lines, -5 lines |
0 comments
|
Download
|
 |
M |
extensions/renderer/bindings/api_last_error.cc
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
extensions/renderer/bindings/api_request_handler.h
|
View
|
1
2
3
4
|
3 chunks |
+7 lines, -1 line |
0 comments
|
Download
|
 |
M |
extensions/renderer/bindings/api_request_handler.cc
|
View
|
1
2
3
4
|
3 chunks |
+14 lines, -2 lines |
0 comments
|
Download
|
 |
M |
extensions/renderer/bindings/api_request_handler_unittest.cc
|
View
|
1
2
3
4
|
21 chunks |
+105 lines, -65 lines |
0 comments
|
Download
|
 |
M |
extensions/renderer/bindings/declarative_event_unittest.cc
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
A |
extensions/renderer/bindings/exception_handler.h
|
View
|
1
2
3
4
|
1 chunk |
+53 lines, -0 lines |
0 comments
|
Download
|
 |
A |
extensions/renderer/bindings/exception_handler.cc
|
View
|
1
2
3
4
|
1 chunk |
+95 lines, -0 lines |
0 comments
|
Download
|
 |
A |
extensions/renderer/bindings/exception_handler_unittest.cc
|
View
|
1
2
3
|
1 chunk |
+144 lines, -0 lines |
0 comments
|
Download
|
 |
M |
extensions/renderer/native_extension_bindings_system.cc
|
View
|
1
2
3
4
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
Total messages: 37 (25 generated)
|