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

Issue 482603002: Unify logic of stack trace generation for extension errors (Closed)

Created:
6 years, 4 months ago by robwu
Modified:
6 years, 4 months ago
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, sadrul, kalyank, ben+ash_chromium.org, extensions-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Unify logic of generating a stack trace for extension errors Include the stack trace of the code that triggered the error. Refactored the error generation method to prevent extension code from breaking the state of the internals. BUG=404406 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=291392

Patch Set 1 #

Total comments: 31

Patch Set 2 : Processed reviewers' comments #

Total comments: 4

Patch Set 3 : Add $Error and $String.indexOf to safe builtins #

Total comments: 31

Patch Set 4 : Revert every use of "throw new $Error.self" #

Patch Set 5 : Add method to safely serialize a thrown object #

Patch Set 6 : Rietveld not working? #

Patch Set 7 : Update expected error message in test #

Patch Set 8 : update expected stack trace length #

Unified diffs Side-by-side diffs Delta from patch set Stats (+144 lines, -60 lines) Patch
M chrome/browser/extensions/error_console/error_console_browsertest.cc View 1 2 3 4 5 6 7 1 chunk +6 lines, -10 lines 0 comments Download
M chrome/renderer/resources/extensions/file_system_custom_bindings.js View 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/renderer/resources/extensions/page_capture_custom_bindings.js View 3 4 5 1 chunk +2 lines, -4 lines 0 comments Download
M chrome/test/data/extensions/api_test/bindings/exception_in_handler_should_not_crash/page.js View 1 3 4 5 2 chunks +15 lines, -7 lines 0 comments Download
M extensions/renderer/module_system.cc View 1 2 3 4 5 2 chunks +2 lines, -1 line 0 comments Download
M extensions/renderer/resources/binding.js View 1 2 3 4 5 3 chunks +5 lines, -3 lines 0 comments Download
M extensions/renderer/resources/event.js View 3 4 5 3 chunks +4 lines, -6 lines 0 comments Download
M extensions/renderer/resources/send_request.js View 3 4 5 5 chunks +3 lines, -19 lines 0 comments Download
M extensions/renderer/resources/uncaught_exception_handler.js View 1 2 3 4 5 1 chunk +94 lines, -5 lines 0 comments Download
M extensions/renderer/safe_builtins.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M extensions/renderer/safe_builtins.cc View 1 2 4 chunks +10 lines, -3 lines 0 comments Download

Messages

Total messages: 34 (0 generated)
robwu
6 years, 4 months ago (2014-08-17 22:48:06 UTC) #1
Finnur
On the face of it, I'm supportive of any effort to make exceptions more understandable ...
6 years, 4 months ago (2014-08-18 11:50:14 UTC) #2
robwu
Ben, could you take a look? https://codereview.chromium.org/482603002/diff/1/chrome/test/data/extensions/api_test/bindings/exception_in_handler_should_not_crash/page.js File chrome/test/data/extensions/api_test/bindings/exception_in_handler_should_not_crash/page.js (right): https://codereview.chromium.org/482603002/diff/1/chrome/test/data/extensions/api_test/bindings/exception_in_handler_should_not_crash/page.js#newcode7 chrome/test/data/extensions/api_test/bindings/exception_in_handler_should_not_crash/page.js:7: function thrownewError(message) { ...
6 years, 4 months ago (2014-08-18 15:37:32 UTC) #3
Finnur
https://codereview.chromium.org/482603002/diff/1/chrome/test/data/extensions/api_test/bindings/exception_in_handler_should_not_crash/page.js File chrome/test/data/extensions/api_test/bindings/exception_in_handler_should_not_crash/page.js (right): https://codereview.chromium.org/482603002/diff/1/chrome/test/data/extensions/api_test/bindings/exception_in_handler_should_not_crash/page.js#newcode7 chrome/test/data/extensions/api_test/bindings/exception_in_handler_should_not_crash/page.js:7: function thrownewError(message) { I don't see why it matters ...
6 years, 4 months ago (2014-08-18 16:07:44 UTC) #4
not at google - send to devlin
Thanks for doing this! I've wanted this for a long time. https://codereview.chromium.org/482603002/diff/1/chrome/test/data/extensions/api_test/bindings/exception_in_handler_should_not_crash/page.js File chrome/test/data/extensions/api_test/bindings/exception_in_handler_should_not_crash/page.js (right): ...
6 years, 4 months ago (2014-08-18 16:09:45 UTC) #5
robwu
https://codereview.chromium.org/482603002/diff/1/chrome/test/data/extensions/api_test/bindings/exception_in_handler_should_not_crash/page.js File chrome/test/data/extensions/api_test/bindings/exception_in_handler_should_not_crash/page.js (right): https://codereview.chromium.org/482603002/diff/1/chrome/test/data/extensions/api_test/bindings/exception_in_handler_should_not_crash/page.js#newcode7 chrome/test/data/extensions/api_test/bindings/exception_in_handler_should_not_crash/page.js:7: function thrownewError(message) { On 2014/08/18 16:09:44, kalman wrote: > ...
6 years, 4 months ago (2014-08-18 20:59:47 UTC) #6
not at google - send to devlin
https://codereview.chromium.org/482603002/diff/1/extensions/renderer/module_system.cc File extensions/renderer/module_system.cc (right): https://codereview.chromium.org/482603002/diff/1/extensions/renderer/module_system.cc#newcode556 extensions/renderer/module_system.cc:556: "var Error = window.Error;"); On 2014/08/18 20:59:46, robwu wrote: ...
6 years, 4 months ago (2014-08-18 23:13:11 UTC) #7
robwu
https://codereview.chromium.org/482603002/diff/1/extensions/renderer/module_system.cc File extensions/renderer/module_system.cc (right): https://codereview.chromium.org/482603002/diff/1/extensions/renderer/module_system.cc#newcode556 extensions/renderer/module_system.cc:556: "var Error = window.Error;"); On 2014/08/18 23:13:10, kalman wrote: ...
6 years, 4 months ago (2014-08-18 23:27:18 UTC) #8
not at google - send to devlin
https://codereview.chromium.org/482603002/diff/1/extensions/renderer/module_system.cc File extensions/renderer/module_system.cc (right): https://codereview.chromium.org/482603002/diff/1/extensions/renderer/module_system.cc#newcode556 extensions/renderer/module_system.cc:556: "var Error = window.Error;"); On 2014/08/18 23:27:18, robwu wrote: ...
6 years, 4 months ago (2014-08-18 23:39:16 UTC) #9
robwu
https://codereview.chromium.org/482603002/diff/1/extensions/renderer/module_system.cc File extensions/renderer/module_system.cc (right): https://codereview.chromium.org/482603002/diff/1/extensions/renderer/module_system.cc#newcode556 extensions/renderer/module_system.cc:556: "var Error = window.Error;"); On 2014/08/18 23:39:16, kalman wrote: ...
6 years, 4 months ago (2014-08-19 14:21:54 UTC) #10
not at google - send to devlin
Looks fine apart from those million comments I made :) and I wanted to look ...
6 years, 4 months ago (2014-08-19 16:45:56 UTC) #11
robwu
https://codereview.chromium.org/482603002/diff/40001/extensions/renderer/resources/event.js File extensions/renderer/resources/event.js (right): https://codereview.chromium.org/482603002/diff/40001/extensions/renderer/resources/event.js#newcode203 extensions/renderer/resources/event.js:203: if (this.eventOptions.supportsRules) On 2014/08/19 16:45:55, kalman wrote: > Oh ...
6 years, 4 months ago (2014-08-19 17:35:57 UTC) #12
not at google - send to devlin
https://codereview.chromium.org/482603002/diff/40001/extensions/renderer/resources/event.js File extensions/renderer/resources/event.js (right): https://codereview.chromium.org/482603002/diff/40001/extensions/renderer/resources/event.js#newcode203 extensions/renderer/resources/event.js:203: if (this.eventOptions.supportsRules) On 2014/08/19 17:35:57, robwu wrote: > On ...
6 years, 4 months ago (2014-08-19 17:54:38 UTC) #13
robwu
https://codereview.chromium.org/482603002/diff/40001/extensions/renderer/resources/event.js File extensions/renderer/resources/event.js (right): https://codereview.chromium.org/482603002/diff/40001/extensions/renderer/resources/event.js#newcode203 extensions/renderer/resources/event.js:203: if (this.eventOptions.supportsRules) On 2014/08/19 17:54:38, kalman wrote: > On ...
6 years, 4 months ago (2014-08-19 20:51:37 UTC) #14
not at google - send to devlin
lgtm
6 years, 4 months ago (2014-08-19 20:54:47 UTC) #15
robwu
The CQ bit was checked by rob@robwu.nl
6 years, 4 months ago (2014-08-19 21:04:03 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rob@robwu.nl/482603002/100001
6 years, 4 months ago (2014-08-19 21:06:02 UTC) #17
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: linux_gpu on tryserver.chromium.gpu ...
6 years, 4 months ago (2014-08-19 21:27:34 UTC) #18
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 4 months ago (2014-08-19 21:31:05 UTC) #19
commit-bot: I haz the power
Try jobs failed on following builders: linux_gpu on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/linux_gpu/builds/54510) mac_gpu on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/mac_gpu/builds/43831) android_aosp ...
6 years, 4 months ago (2014-08-19 21:31:06 UTC) #20
robwu
The CQ bit was checked by rob@robwu.nl
6 years, 4 months ago (2014-08-19 21:42:22 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rob@robwu.nl/482603002/160001
6 years, 4 months ago (2014-08-19 21:43:54 UTC) #22
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: linux_chromium_chromeos_rel_swarming on tryserver.chromium.linux ...
6 years, 4 months ago (2014-08-20 02:34:14 UTC) #23
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 4 months ago (2014-08-20 03:13:38 UTC) #24
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_swarming on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_swarming/builds/7987)
6 years, 4 months ago (2014-08-20 03:13:39 UTC) #25
robwu
The CQ bit was checked by rob@robwu.nl
6 years, 4 months ago (2014-08-21 10:55:00 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rob@robwu.nl/482603002/180001
6 years, 4 months ago (2014-08-21 10:55:58 UTC) #27
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: linux_chromium_chromeos_rel_swarming on tryserver.chromium.linux ...
6 years, 4 months ago (2014-08-21 12:41:24 UTC) #28
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 4 months ago (2014-08-21 13:12:53 UTC) #29
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel_swarming on tryserver.chromium.linux (http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_swarming/builds/6517)
6 years, 4 months ago (2014-08-21 13:12:54 UTC) #30
robwu
The CQ bit was checked by rob@robwu.nl
6 years, 4 months ago (2014-08-22 11:17:18 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rob@robwu.nl/482603002/200001
6 years, 4 months ago (2014-08-22 11:18:19 UTC) #32
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: android_dbg_tests_recipe on tryserver.chromium.linux ...
6 years, 4 months ago (2014-08-22 12:11:11 UTC) #33
commit-bot: I haz the power
6 years, 4 months ago (2014-08-22 13:06:35 UTC) #34
Message was sent while issue was closed.
Committed patchset #8 (200001) as 291392

Powered by Google App Engine
This is Rietveld 408576698