Bug 46280 - [Chromium] Fix memory model for dataset
Summary: [Chromium] Fix memory model for dataset
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: Erik Arvidsson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-22 11:03 PDT by Erik Arvidsson
Modified: 2010-09-22 12:11 PDT (History)
2 users (show)

See Also:


Attachments
Patch (1.72 KB, patch)
2010-09-22 11:04 PDT, Erik Arvidsson
japhet: review+
japhet: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Arvidsson 2010-09-22 11:03:39 PDT
[Chromium] Fix memory model for dataset
Comment 1 Erik Arvidsson 2010-09-22 11:04:22 PDT
Created attachment 68396 [details]
Patch
Comment 2 anton muhin 2010-09-22 11:10:19 PDT
Comment on attachment 68396 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=68396&action=review

Thanks a lot for doing this.

Alas, I cannot r+ it, but it's almost LGTM

> WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp:107
> +        if (elementValue->IsObject())

I think that if elementValue is an empty handle, that would segfault

> WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp:108
> +            V8DOMWrapper::setHiddenReference(v8::Handle<v8::Object>::Cast(elementValue), wrapper);

you can use elementValue.As<v8::Object> too.  These .As methods are rarely met currently as they were added relatively recently, up to you if you'd like to switch to new API or not
Comment 3 anton muhin 2010-09-22 11:10:46 PDT
(In reply to comment #2)
> (From update of attachment 68396 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=68396&action=review
> 
> Thanks a lot for doing this.
> 
> Alas, I cannot r+ it, but it's almost LGTM
> 
> > WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp:107
> > +        if (elementValue->IsObject())
> 
> I think that if elementValue is an empty handle, that would segfault
> 
> > WebCore/bindings/v8/custom/V8DOMStringMapCustom.cpp:108
> > +            V8DOMWrapper::setHiddenReference(v8::Handle<v8::Object>::Cast(elementValue), wrapper);
> 
> you can use elementValue.As<v8::Object> too.  These .As methods are rarely met currently as they were added relatively recently, up to you if you'd like to switch to new API or not

cannot r+ means I am not a reviewer
Comment 4 Nate Chapin 2010-09-22 11:41:13 PDT
Comment on attachment 68396 [details]
Patch

r+, reiterating antonm's point about adding an isEmpty() check.
Comment 5 Erik Arvidsson 2010-09-22 12:11:15 PDT
Committed r68064: <http://trac.webkit.org/changeset/68064>