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

Issue 989573002: Cleanly handle excessively long JS source strings. (Closed)

Created:
5 years, 9 months ago by vogelheim
Modified:
5 years, 9 months ago
CC:
arv+blink, blink-reviews, blink-reviews-bindings_chromium.org, vivekg_samsung, vivekg
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Cleanly handle excessively long JS source strings. BUG=463672 R=jochen@chromium.org Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=192086

Patch Set 1 #

Total comments: 5

Patch Set 2 : Properly throw the exception. #

Patch Set 3 : General error (rather than Range Error) seems like a better fit. #

Total comments: 1

Patch Set 4 : Handle both ScriptController + WorkerScriptController case. #

Patch Set 5 : Report only compile time exceptions (and not runtime exceptions) in ScriptController. #

Patch Set 6 : A new approach: Hope that V8 exception reporting gets fixed #

Total comments: 4

Patch Set 7 : syntax error => general error #

Unified diffs Side-by-side diffs Delta from patch set Stats (+18 lines, -3 lines) Patch
M Source/bindings/core/v8/V8ScriptRunner.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M Source/bindings/core/v8/V8ScriptRunner.cpp View 1 2 3 4 5 6 1 chunk +16 lines, -1 line 0 comments Download
M Source/bindings/core/v8/WorkerScriptController.cpp View 1 2 3 4 5 1 chunk +1 line, -2 lines 0 comments Download

Messages

Total messages: 30 (3 generated)
vogelheim
https://codereview.chromium.org/989573002/diff/1/Source/bindings/core/v8/V8ScriptRunner.cpp File Source/bindings/core/v8/V8ScriptRunner.cpp (right): https://codereview.chromium.org/989573002/diff/1/Source/bindings/core/v8/V8ScriptRunner.cpp#newcode366 Source/bindings/core/v8/V8ScriptRunner.cpp:366: V8ThrowException::throwGeneralError(isolate, "JavaScript source exceeds maximum string length."); Does this ...
5 years, 9 months ago (2015-03-06 17:07:52 UTC) #1
jochen (gone - plz use gerrit)
hum, no idea maybe Marja or Kentaro know?
5 years, 9 months ago (2015-03-06 17:15:22 UTC) #3
marja
https://codereview.chromium.org/989573002/diff/1/Source/bindings/core/v8/V8ScriptRunner.cpp File Source/bindings/core/v8/V8ScriptRunner.cpp (right): https://codereview.chromium.org/989573002/diff/1/Source/bindings/core/v8/V8ScriptRunner.cpp#newcode366 Source/bindings/core/v8/V8ScriptRunner.cpp:366: V8ThrowException::throwGeneralError(isolate, "JavaScript source exceeds maximum string length."); Hmm, there ...
5 years, 9 months ago (2015-03-06 18:10:10 UTC) #4
haraken
https://codereview.chromium.org/989573002/diff/1/Source/bindings/core/v8/V8ScriptRunner.cpp File Source/bindings/core/v8/V8ScriptRunner.cpp (right): https://codereview.chromium.org/989573002/diff/1/Source/bindings/core/v8/V8ScriptRunner.cpp#newcode366 Source/bindings/core/v8/V8ScriptRunner.cpp:366: V8ThrowException::throwGeneralError(isolate, "JavaScript source exceeds maximum string length."); On 2015/03/06 ...
5 years, 9 months ago (2015-03-07 04:17:15 UTC) #5
vogelheim
https://codereview.chromium.org/989573002/diff/1/Source/bindings/core/v8/V8ScriptRunner.cpp File Source/bindings/core/v8/V8ScriptRunner.cpp (right): https://codereview.chromium.org/989573002/diff/1/Source/bindings/core/v8/V8ScriptRunner.cpp#newcode366 Source/bindings/core/v8/V8ScriptRunner.cpp:366: V8ThrowException::throwGeneralError(isolate, "JavaScript source exceeds maximum string length."); On 2015/03/06 ...
5 years, 9 months ago (2015-03-09 17:36:52 UTC) #6
vogelheim
The new version throws the exception, similar to throwStackOverflowExceptionIfNeeded earlier in the same file.
5 years, 9 months ago (2015-03-09 18:33:11 UTC) #7
marja
I assume you tried out that this gives the console message?
5 years, 9 months ago (2015-03-09 18:50:15 UTC) #8
marja
I assume you tried out that this gives the console message?
5 years, 9 months ago (2015-03-09 18:50:20 UTC) #9
vogelheim
Am 09.03.2015 7:50 nachm. schrieb <marja@chromium.org>: > > I assume you tried out that this ...
5 years, 9 months ago (2015-03-09 19:16:01 UTC) #10
haraken
https://codereview.chromium.org/989573002/diff/40001/Source/bindings/core/v8/V8ScriptRunner.cpp File Source/bindings/core/v8/V8ScriptRunner.cpp (right): https://codereview.chromium.org/989573002/diff/40001/Source/bindings/core/v8/V8ScriptRunner.cpp#newcode373 Source/bindings/core/v8/V8ScriptRunner.cpp:373: v8::Function::New(isolate, throwSourceTooLargeException)->Call(v8::Undefined(isolate), 0, 0); Can we use a (already ...
5 years, 9 months ago (2015-03-09 23:21:56 UTC) #11
haraken
Continuation of our discussion offline: - ScriptController::executeScriptAndReturnValue doesn't rethrow a TryCatch, because it's possible that ...
5 years, 9 months ago (2015-03-11 09:10:26 UTC) #12
jochen (gone - plz use gerrit)
i think we need something similar to the code in WorkerScriptController::evaluate just passing the exception ...
5 years, 9 months ago (2015-03-12 15:02:56 UTC) #13
blink-reviews
Right. So my current plan is to keep trying to make the V8 exception work. ...
5 years, 9 months ago (2015-03-12 15:12:34 UTC) #14
haraken
On 2015/03/12 15:12:34, blink-reviews wrote: > Right. So my current plan is to keep trying ...
5 years, 9 months ago (2015-03-12 23:35:42 UTC) #15
vogelheim
Update: - Got a version that works, by making ScriptController's TryCatch report exceptions. - This ...
5 years, 9 months ago (2015-03-16 14:44:32 UTC) #16
vogelheim
PTAL. Both regular scripts + worker scripts now handle the error gracefully AND write a ...
5 years, 9 months ago (2015-03-16 19:40:34 UTC) #17
haraken
Thanks for being persistent on this! It looks like you need to fix test failures ...
5 years, 9 months ago (2015-03-17 00:10:05 UTC) #18
jochen (gone - plz use gerrit)
maybe we should do the macro dance after all to avoid having to rebaseline so ...
5 years, 9 months ago (2015-03-17 10:36:40 UTC) #19
vogelheim
Update: - The errors were exceptions being reported twice. - We knew that would happen, ...
5 years, 9 months ago (2015-03-17 12:01:18 UTC) #20
blink-reviews
Much smaller set of test failures now and those are indeed syntax errors that are ...
5 years, 9 months ago (2015-03-17 13:11:51 UTC) #21
vogelheim
Result: - 16x duplicate console messages for syntax errors - 5x messages where the actual ...
5 years, 9 months ago (2015-03-17 13:21:35 UTC) #22
vogelheim
PTAL. mstarzigner@ suggested he's working on V8 exception reporting and in particular he has a ...
5 years, 9 months ago (2015-03-18 10:15:32 UTC) #23
jochen (gone - plz use gerrit)
lgtm
5 years, 9 months ago (2015-03-18 10:24:50 UTC) #24
haraken
LGTM https://codereview.chromium.org/989573002/diff/100001/Source/bindings/core/v8/V8ScriptRunner.cpp File Source/bindings/core/v8/V8ScriptRunner.cpp (right): https://codereview.chromium.org/989573002/diff/100001/Source/bindings/core/v8/V8ScriptRunner.cpp#newcode364 Source/bindings/core/v8/V8ScriptRunner.cpp:364: V8ThrowException::throwSyntaxError(isolate, "Source file too large."); Can we use ...
5 years, 9 months ago (2015-03-18 11:14:54 UTC) #25
vogelheim
https://codereview.chromium.org/989573002/diff/100001/Source/bindings/core/v8/V8ScriptRunner.cpp File Source/bindings/core/v8/V8ScriptRunner.cpp (right): https://codereview.chromium.org/989573002/diff/100001/Source/bindings/core/v8/V8ScriptRunner.cpp#newcode364 Source/bindings/core/v8/V8ScriptRunner.cpp:364: V8ThrowException::throwSyntaxError(isolate, "Source file too large."); On 2015/03/18 11:14:54, haraken ...
5 years, 9 months ago (2015-03-18 11:28:26 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/989573002/120001
5 years, 9 months ago (2015-03-18 11:32:52 UTC) #29
commit-bot: I haz the power
5 years, 9 months ago (2015-03-18 12:50:29 UTC) #30
Message was sent while issue was closed.
Committed patchset #7 (id:120001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=192086

Powered by Google App Engine
This is Rietveld 408576698