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

Issue 2819683002: [Extenisons Bindings] Don't throw unchecked errors; add console errors (Closed)

Created:
3 years, 8 months ago by Devlin
Modified:
3 years, 8 months ago
Reviewers:
lazyboy, jbroman
CC:
chromium-apps-reviews_chromium.org, chromium-reviews, extensions-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[Extenisons Bindings] Don't throw unchecked errors; add console errors Throwing an unchecked runtime.lastError results in an uncaught exception, which can prevent future JS from properly running in somewhat unpredictable ways. These errors should be logged as console errors, rather than being thrown as exceptions. Add tests to a) check errors being logged and b) check that chaining API calls and callbacks works even when there are uncheked last errors. BUG=653596 Review-Url: https://codereview.chromium.org/2819683002 Cr-Commit-Position: refs/heads/master@{#465740} Committed: https://chromium.googlesource.com/chromium/src/+/baa379d2816ac03540dc343fa20d6f0ba9791475

Patch Set 1 #

Patch Set 2 : . #

Total comments: 12

Patch Set 3 : jbroman's #

Unified diffs Side-by-side diffs Delta from patch set Stats (+133 lines, -52 lines) Patch
M chrome/browser/extensions/native_bindings_apitest.cc View 1 2 1 chunk +43 lines, -0 lines 0 comments Download
M extensions/renderer/api_binding_unittest.cc View 1 chunk +2 lines, -1 line 0 comments Download
M extensions/renderer/api_bindings_system_unittest.cc View 1 chunk +2 lines, -1 line 0 comments Download
M extensions/renderer/api_last_error.h View 2 chunks +7 lines, -1 line 0 comments Download
M extensions/renderer/api_last_error.cc View 2 chunks +5 lines, -4 lines 0 comments Download
M extensions/renderer/api_last_error_unittest.cc View 1 6 chunks +25 lines, -9 lines 0 comments Download
M extensions/renderer/api_request_handler_unittest.cc View 7 chunks +7 lines, -7 lines 0 comments Download
M extensions/renderer/console.h View 1 chunk +6 lines, -9 lines 0 comments Download
M extensions/renderer/console.cc View 1 2 1 chunk +16 lines, -8 lines 0 comments Download
M extensions/renderer/declarative_event_unittest.cc View 1 chunk +2 lines, -1 line 0 comments Download
M extensions/renderer/module_system.cc View 1 2 1 chunk +5 lines, -6 lines 0 comments Download
M extensions/renderer/native_extension_bindings_system.cc View 1 2 4 chunks +11 lines, -1 line 0 comments Download
M extensions/renderer/object_backed_native_handler.cc View 1 chunk +2 lines, -4 lines 0 comments Download

Messages

Total messages: 21 (14 generated)
Devlin
Hey folks, mind taking a look? jbroman@, this was the root cause of the weirdness ...
3 years, 8 months ago (2017-04-14 00:43:17 UTC) #6
jbroman
lgtm https://codereview.chromium.org/2819683002/diff/20001/chrome/browser/extensions/native_bindings_apitest.cc File chrome/browser/extensions/native_bindings_apitest.cc (right): https://codereview.chromium.org/2819683002/diff/20001/chrome/browser/extensions/native_bindings_apitest.cc#newcode234 chrome/browser/extensions/native_bindings_apitest.cc:234: const Extension* extension = nullptr; nit: Since there's ...
3 years, 8 months ago (2017-04-19 17:45:05 UTC) #7
lazyboy
https://codereview.chromium.org/2819683002/diff/20001/extensions/renderer/api_last_error.cc File extensions/renderer/api_last_error.cc (right): https://codereview.chromium.org/2819683002/diff/20001/extensions/renderer/api_last_error.cc#newcode137 extensions/renderer/api_last_error.cc:137: add_console_error_.Run( I might be missing something, but add_console_error_.is_null() == ...
3 years, 8 months ago (2017-04-19 18:45:40 UTC) #8
Devlin
https://codereview.chromium.org/2819683002/diff/20001/chrome/browser/extensions/native_bindings_apitest.cc File chrome/browser/extensions/native_bindings_apitest.cc (right): https://codereview.chromium.org/2819683002/diff/20001/chrome/browser/extensions/native_bindings_apitest.cc#newcode234 chrome/browser/extensions/native_bindings_apitest.cc:234: const Extension* extension = nullptr; On 2017/04/19 17:45:04, jbroman ...
3 years, 8 months ago (2017-04-19 19:45:33 UTC) #10
lazyboy
lgtm https://codereview.chromium.org/2819683002/diff/20001/extensions/renderer/api_last_error.cc File extensions/renderer/api_last_error.cc (right): https://codereview.chromium.org/2819683002/diff/20001/extensions/renderer/api_last_error.cc#newcode137 extensions/renderer/api_last_error.cc:137: add_console_error_.Run( On 2017/04/19 19:45:33, Devlin wrote: > On ...
3 years, 8 months ago (2017-04-19 20:28:07 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2819683002/60001
3 years, 8 months ago (2017-04-19 20:42:34 UTC) #18
commit-bot: I haz the power
3 years, 8 months ago (2017-04-19 20:49:43 UTC) #21
Message was sent while issue was closed.
Committed patchset #3 (id:60001) as
https://chromium.googlesource.com/chromium/src/+/baa379d2816ac03540dc343fa20d...

Powered by Google App Engine
This is Rietveld 408576698