Bug 94713

Summary: [V8] Remove V8Proxy from V8DOMWrapper::instantiateV8Object()
Product: WebKit Reporter: Kentaro Hara <haraken>
Component: WebCore JavaScriptAssignee: Kentaro Hara <haraken>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, eric.carlson, feature-media-reviews, japhet, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 85330    
Attachments:
Description Flags
Patch none

Description Kentaro Hara 2012-08-22 08:17:46 PDT
V8DOMWrapper::instantiateV8Object() should receive Frame* instead of V8Proxy*.
Comment 1 Kentaro Hara 2012-08-22 08:21:04 PDT
Created attachment 159939 [details]
Patch
Comment 2 Kentaro Hara 2012-08-22 08:22:21 PDT
Comment on attachment 159939 [details]
Patch

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

> Source/WebCore/bindings/scripts/CodeGeneratorV8.pm:3408
> +    wrapper = V8DOMWrapper::instantiateV8Object(proxy ? proxy->frame() : 0, &info, impl.get());

'proxy' will be removed from CodeGeneratorV8.pm in a follow-up patch (because removing 'proxy' is not so trivial).
Comment 3 Adam Barth 2012-08-22 12:28:54 PDT
Comment on attachment 159939 [details]
Patch

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

> Source/WebCore/bindings/v8/V8DOMWrapper.cpp:163
> -v8::Local<v8::Object> V8DOMWrapper::instantiateV8Object(V8Proxy* proxy, WrapperTypeInfo* type, void* impl)
> +v8::Local<v8::Object> V8DOMWrapper::instantiateV8Object(Frame* frame, WrapperTypeInfo* type, void* impl)

This should actually take a ScriptExecutionContext, but Frame is better than V8Proxy :)

> Source/WebCore/bindings/v8/V8DOMWrapper.cpp:175
> -                Frame* frame = V8DOMWindow::toNative(globalPrototype)->frame();
> -                if (frame && frame->script()->canExecuteScripts(NotAboutToExecuteScript))
> -                    proxy = frame->script()->proxy();
> +                Frame* globalFrame = V8DOMWindow::toNative(globalPrototype)->frame();
> +                if (globalFrame && globalFrame->script()->canExecuteScripts(NotAboutToExecuteScript))
> +                    frame = globalFrame;

This code is wrong, but we can fix that in another patch.  Can you file a bug about V8DOMWrapper::instantiateV8Object needing to take a ScriptExecutionContext ?
Comment 4 WebKit Review Bot 2012-08-22 15:44:11 PDT
Comment on attachment 159939 [details]
Patch

Clearing flags on attachment: 159939

Committed r126362: <http://trac.webkit.org/changeset/126362>
Comment 5 WebKit Review Bot 2012-08-22 15:44:14 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Kentaro Hara 2012-08-22 17:38:00 PDT
(In reply to comment #3)
> This code is wrong, but we can fix that in another patch.  Can you file a bug about V8DOMWrapper::instantiateV8Object needing to take a ScriptExecutionContext ?

Filed a bug 94763.