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

Issue 100963003: Use V8TRYCATCH_FOR_V8STRINGRESOURCE() macro instead of toCoreStringWithUndefinedOrNullCheck() (Closed)

Created:
7 years ago by Inactive
Modified:
7 years ago
Reviewers:
haraken, pfeldman, yurys
CC:
blink-reviews, Nils Barth (inactive), kojih, arv+blink, jsbell+bindings_chromium.org, abarth-chromium, marja+watch_chromium.org, adamk+blink_chromium.org, haraken, Nate Chapin, vsevik
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Use V8TRYCATCH_FOR_V8STRINGRESOURCE() macro instead of toCoreStringWithUndefinedOrNullCheck() Use V8TRYCATCH_FOR_V8STRINGRESOURCE() macro instead of toCoreStringWithUndefinedOrNullCheck() when necessary. Namely, when an exception may be thrown, we should use the macro instead to return early when the call to ToString() throws. This patch also updates toCoreStringWithUndefinedOrNullCheck(v8::Handle<v8::Value>()) to stop calling ToString(). This method can never throw and is thus now safe to use if the caller wants to convert to WTF String only if the v8::Value contains a v8::String. This utility method is used in the inspector code. R=haraken, pfeldman BUG=327338 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=163873

Patch Set 1 #

Total comments: 2

Patch Set 2 : Remove toCoreString(v8::Handle<v8::Value> value) #

Total comments: 10

Patch Set 3 : Take pfeldman's feedback into consideration #

Total comments: 5

Patch Set 4 : Take Yury's feedback into consideration #

Patch Set 5 : Take Yury's feedback into consideration #

Unified diffs Side-by-side diffs Delta from patch set Stats (+49 lines, -16 lines) Patch
A LayoutTests/fast/dom/Window/showModalDialog-invalid-arguments.html View 1 chunk +20 lines, -0 lines 0 comments Download
A LayoutTests/fast/dom/Window/showModalDialog-invalid-arguments-expected.txt View 1 chunk +13 lines, -0 lines 0 comments Download
M Source/bindings/v8/ScriptDebugServer.cpp View 1 2 3 2 chunks +8 lines, -3 lines 0 comments Download
M Source/bindings/v8/V8Binding.h View 1 2 3 1 chunk +6 lines, -10 lines 0 comments Download
M Source/bindings/v8/custom/V8WindowCustom.cpp View 1 chunk +2 lines, -3 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
Inactive
7 years ago (2013-12-12 15:33:47 UTC) #1
haraken
LGTM but pfeldman might want to take another look at the inspector code. https://codereview.chromium.org/100963003/diff/1/Source/bindings/v8/V8Binding.h File ...
7 years ago (2013-12-12 15:41:42 UTC) #2
Inactive
https://codereview.chromium.org/100963003/diff/1/Source/bindings/v8/V8Binding.h File Source/bindings/v8/V8Binding.h (right): https://codereview.chromium.org/100963003/diff/1/Source/bindings/v8/V8Binding.h#newcode192 Source/bindings/v8/V8Binding.h:192: // please use the V8TRYCATCH_FOR_V8STRINGRESOURCE_*() macros instead. On 2013/12/12 ...
7 years ago (2013-12-12 15:44:22 UTC) #3
pfeldman
This looks exactly like the one I rolled out. Please don't change this code due ...
7 years ago (2013-12-12 15:47:07 UTC) #4
Inactive
On 2013/12/12 15:47:07, pfeldman wrote: > This looks exactly like the one I rolled out. ...
7 years ago (2013-12-12 15:51:53 UTC) #5
Inactive
https://codereview.chromium.org/100963003/diff/20001/Source/bindings/v8/custom/V8JavaScriptCallFrameCustom.cpp File Source/bindings/v8/custom/V8JavaScriptCallFrameCustom.cpp (right): https://codereview.chromium.org/100963003/diff/20001/Source/bindings/v8/custom/V8JavaScriptCallFrameCustom.cpp#newcode40 Source/bindings/v8/custom/V8JavaScriptCallFrameCustom.cpp:40: V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, expression, info[0]); For e.g. I understand that this ...
7 years ago (2013-12-12 15:59:25 UTC) #6
pfeldman
Sure, sorry for not being precise. https://codereview.chromium.org/100963003/diff/20001/Source/bindings/v8/PageScriptDebugServer.cpp File Source/bindings/v8/PageScriptDebugServer.cpp (right): https://codereview.chromium.org/100963003/diff/20001/Source/bindings/v8/PageScriptDebugServer.cpp#newcode228 Source/bindings/v8/PageScriptDebugServer.cpp:228: V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, scriptName, callDebuggerMethod("getScriptName", ...
7 years ago (2013-12-12 16:11:23 UTC) #7
Inactive
Thanks for looking into this in details pfedlman@! I updated the CL accordingly.
7 years ago (2013-12-12 16:31:58 UTC) #8
pfeldman
inspector lgtm https://codereview.chromium.org/100963003/diff/40001/Source/bindings/v8/ScriptDebugServer.cpp File Source/bindings/v8/ScriptDebugServer.cpp (right): https://codereview.chromium.org/100963003/diff/40001/Source/bindings/v8/ScriptDebugServer.cpp#newcode387 Source/bindings/v8/ScriptDebugServer.cpp:387: V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, hitBreakpointNumber, hitBreakpointNumbers->Get(i)); We need to make ...
7 years ago (2013-12-12 16:41:41 UTC) #9
yurys
https://codereview.chromium.org/100963003/diff/40001/Source/bindings/v8/ScriptDebugServer.cpp File Source/bindings/v8/ScriptDebugServer.cpp (right): https://codereview.chromium.org/100963003/diff/40001/Source/bindings/v8/ScriptDebugServer.cpp#newcode387 Source/bindings/v8/ScriptDebugServer.cpp:387: V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, hitBreakpointNumber, hitBreakpointNumbers->Get(i)); On 2013/12/12 16:41:41, pfeldman_ooo wrote: > ...
7 years ago (2013-12-12 20:04:43 UTC) #10
Inactive
https://codereview.chromium.org/100963003/diff/40001/Source/bindings/v8/ScriptDebugServer.cpp File Source/bindings/v8/ScriptDebugServer.cpp (right): https://codereview.chromium.org/100963003/diff/40001/Source/bindings/v8/ScriptDebugServer.cpp#newcode387 Source/bindings/v8/ScriptDebugServer.cpp:387: V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, hitBreakpointNumber, hitBreakpointNumbers->Get(i)); On 2013/12/12 20:04:43, yurys wrote: > ...
7 years ago (2013-12-12 22:43:38 UTC) #11
yurys
DevTools changes lgtm!
7 years ago (2013-12-13 07:18:30 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ch.dumez@samsung.com/100963003/70001
7 years ago (2013-12-13 14:11:55 UTC) #13
commit-bot: I haz the power
7 years ago (2013-12-13 15:13:47 UTC) #14
Message was sent while issue was closed.
Change committed as 163873

Powered by Google App Engine
This is Rietveld 408576698