Bug 22493

Summary: Abstract away JSC:: usage in WebCore/html
Product: WebKit Reporter: Darin Fisher (:fishd, Google) <fishd>
Component: WebCore Misc.Assignee: Darin Fisher (:fishd, Google) <fishd>
Status: RESOLVED FIXED    
Severity: Normal CC: ggaren, sam
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
v1 patch ggaren: review+

Description Darin Fisher (:fishd, Google) 2008-11-25 13:47:35 PST
Abstract away the JSC:: in WebCore/html/

My proposal is to define the following types:

  typedef RefPtr<JSC::Bindings::Instance> ScriptInstance;
  typedef PassRefPtr<JSC::Bindings::Instance> PassScriptInstance;

Then, I will use these types in HTMLPlugInElement.{h,cpp}.  The result will enable V8 bindings to work with HTMLPlugInElement without any modifications or #ifdefs.

The key here is that V8 bindings does not have something like JSC::Bindings::Instance.  Instead, the HTMLPlugInElement's getInstance method simply vends a V8Object that is pre-bound to the underlying NPObject returned by the plugin's getValue function.

I thought about changing the JSC build to also vend a JSValue* from HTMLPlugInElement::getInstance, but that wouldn't work out too well since there is not an ExecState available at the time when getInstance is called.  Hence, the typedef solution that I'm proposing, which seems to allow the greatest flexibility.
Comment 1 Darin Fisher (:fishd, Google) 2008-11-25 14:09:49 PST
Created attachment 25501 [details]
v1 patch
Comment 2 Geoffrey Garen 2008-11-25 17:15:58 PST
Comment on attachment 25501 [details]
v1 patch

r=me
Comment 3 Darin Fisher (:fishd, Google) 2008-11-25 17:19:49 PST
http://trac.webkit.org/changeset/38774
Comment 4 Darin Fisher (:fishd, Google) 2008-11-25 18:21:33 PST
Windows bustage fix:
http://trac.webkit.org/changeset/38777

This change was required because runtime.h is now exposed via ScriptInstance.h, forcing it to be a "private" header that WebKit.vcproj can see.