Bug 103662

Summary: [V8] DOM callbacks shouldn't reimplement ScopedPersistent they should use it
Product: WebKit Reporter: Adam Barth <abarth>
Component: New BugsAssignee: Adam Barth <abarth>
Status: RESOLVED FIXED    
Severity: Normal CC: adamk, eric, haraken, japhet, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

Description Adam Barth 2012-11-29 12:43:53 PST
[V8] DOM callbacks shouldn't reimplement ScopedPersistent they should use it
Comment 1 Adam Barth 2012-11-29 12:45:19 PST
Created attachment 176792 [details]
Patch
Comment 2 Adam Klein 2012-11-29 12:51:49 PST
Comment on attachment 176792 [details]
Patch

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

> Source/WebCore/bindings/scripts/CodeGeneratorV8.pm:3360
> +    m_callback.get().MakeWeak(this, &${v8InterfaceName}::weakCallback);

Nit, you can use operator-> here
Comment 3 Adam Barth 2012-11-29 13:38:21 PST
(In reply to comment #2)
> (From update of attachment 176792 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=176792&action=review
> 
> > Source/WebCore/bindings/scripts/CodeGeneratorV8.pm:3360
> > +    m_callback.get().MakeWeak(this, &${v8InterfaceName}::weakCallback);
> 
> Nit, you can use operator-> here

I need to call a function on the Handle itself, not the underlying object.  I'm pretty sure I made -> give you back the underlying object.
Comment 4 Adam Barth 2012-11-29 13:43:55 PST
In file included from gen/webkit/bindings/V8DerivedSources02.cpp:45:
gen/webcore/bindings/V8NavigatorUserMediaErrorCallback.cpp:46:17: error: no member named 'MakeWeak' in 'v8::Object'
    m_callback->MakeWeak(this, &V8NavigatorUserMediaErrorCallback::weakCallback);
    ~~~~~~~~~~  ^
In file included from gen/webkit/bindings/V8DerivedSources02.cpp:49:
Comment 5 Eric Seidel (no email) 2012-11-29 13:45:53 PST
Comment on attachment 176792 [details]
Patch

LGTM.
Comment 6 WebKit Review Bot 2012-11-29 15:00:03 PST
Comment on attachment 176792 [details]
Patch

Clearing flags on attachment: 176792

Committed r136168: <http://trac.webkit.org/changeset/136168>
Comment 7 WebKit Review Bot 2012-11-29 15:00:07 PST
All reviewed patches have been landed.  Closing bug.