Bug 46280

Summary: [Chromium] Fix memory model for dataset
Product: WebKit Reporter: Erik Arvidsson <arv>
Component: New BugsAssignee: Erik Arvidsson <arv>
Status: RESOLVED FIXED    
Severity: Normal CC: antonm, japhet
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Other   
OS: OS X 10.5   
Attachments:
Description Flags
Patch japhet: review+, japhet: commit-queue-

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>