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

Issue 23812006: Have Dictionary use V8TRYCATCH_FOR_V8STRINGRESOURCE() macro (Closed)

Created:
7 years, 3 months ago by do-not-use
Modified:
7 years, 3 months ago
Reviewers:
haraken, marja
CC:
blink-reviews, Nils Barth (inactive), kojih, jsbell+bindings_chromium.org, eae+blinkwatch, abarth-chromium, marja+watch_chromium.org, dglazkov+blink, adamk+blink_chromium.org, Nate Chapin
Visibility:
Public.

Description

Have Dictionary use V8TRYCATCH_FOR_V8STRINGRESOURCE() macro Have Dictionary use V8TRYCATCH_FOR_V8STRINGRESOURCE() macro instead of the deprecated toWebCoreString(). R=haraken BUG= Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=157541

Patch Set 1 #

Total comments: 1

Patch Set 2 : Add test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+56 lines, -23 lines) Patch
A LayoutTests/fast/js/dictionary-string-conversion-exception.html View 1 1 chunk +16 lines, -0 lines 0 comments Download
A LayoutTests/fast/js/dictionary-string-conversion-exception-expected.txt View 1 1 chunk +12 lines, -0 lines 0 comments Download
M Source/bindings/v8/Dictionary.cpp View 6 chunks +18 lines, -16 lines 0 comments Download
M Source/bindings/v8/V8BindingMacros.h View 1 chunk +6 lines, -3 lines 0 comments Download
M Source/bindings/v8/V8StringResource.h View 2 chunks +4 lines, -4 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
do-not-use
7 years, 3 months ago (2013-09-10 11:45:41 UTC) #1
do-not-use
https://codereview.chromium.org/23812006/diff/1/Source/bindings/v8/V8StringResource.h File Source/bindings/v8/V8StringResource.h (right): https://codereview.chromium.org/23812006/diff/1/Source/bindings/v8/V8StringResource.h#newcode184 Source/bindings/v8/V8StringResource.h:184: operator String() const { return toString<String>(); } I made ...
7 years, 3 months ago (2013-09-10 11:50:13 UTC) #2
marja
I don't know this part of the code well enough to review this; I hope ...
7 years, 3 months ago (2013-09-10 11:58:58 UTC) #3
haraken
This CL looks correct but changes behavior. We will throw exceptions for code that hasn't ...
7 years, 3 months ago (2013-09-10 14:01:28 UTC) #4
do-not-use
On 2013/09/10 14:01:28, haraken wrote: > This CL looks correct but changes behavior. We will ...
7 years, 3 months ago (2013-09-10 14:06:54 UTC) #5
do-not-use
On 2013/09/10 14:01:28, haraken wrote: > This CL looks correct but changes behavior. We will ...
7 years, 3 months ago (2013-09-10 14:26:14 UTC) #6
haraken
LGTM, thanks for the test. We should replace almost all toWebCoreString with V8_TRYCATCH :)
7 years, 3 months ago (2013-09-10 16:34:26 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ch.dumez@sisa.samsung.com/23812006/10001
7 years, 3 months ago (2013-09-10 19:24:43 UTC) #8
commit-bot: I haz the power
Change committed as 157541
7 years, 3 months ago (2013-09-10 20:21:31 UTC) #9
do-not-use
On 2013/09/10 16:34:26, haraken wrote: > LGTM, thanks for the test. > > We should ...
7 years, 3 months ago (2013-09-11 07:03:04 UTC) #10
haraken
7 years, 3 months ago (2013-09-11 07:12:49 UTC) #11
Message was sent while issue was closed.
On 2013/09/11 07:03:04, Christophe Dumez wrote:
> On 2013/09/10 16:34:26, haraken wrote:
> > LGTM, thanks for the test.
> > 
> > We should replace almost all toWebCoreString with V8_TRYCATCH :)
> 
> Looking at the other toWebCoreString() uses, there are a lot of cases where
the
> input is already a v8::String or a v8::Value for which we already checked that
> IsString() returns true. In such case, I don't believe it can throw an
exception
> and using V8_TRYCATCH would only decrease code readability IMHO (also do a
> useless IsString() check).
> 
> v8StringToWebCoreString() may be a suitable alternative in this case?
> 
>      if (value->IsString())
> -        return IDBKey::createString(toWebCoreString(value));
> +        return
> IDBKey::createString(v8StringToWebCoreString<String>(value.As<v8::String>(),
> Externalize));

Yeah, you're right.

I just thought there are a lot of places where we're calling
ToString/ToNumber/ToInt etc without guarding the call with a TRYCATCH block.
However, I've not seriously checked the code base, so I'm not sure how much
we're really missing TRYCATH's.

Powered by Google App Engine
This is Rietveld 408576698