Bug 22493 - Abstract away JSC:: usage in WebCore/html
Summary: Abstract away JSC:: usage in WebCore/html
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Darin Fisher (:fishd, Google)
Depends on:
Reported: 2008-11-25 13:47 PST by Darin Fisher (:fishd, Google)
Modified: 2008-11-25 18:21 PST (History)
2 users (show)

See Also:

v1 patch (12.80 KB, patch)
2008-11-25 14:09 PST, Darin Fisher (:fishd, Google)
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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

Comment 3 Darin Fisher (:fishd, Google) 2008-11-25 17:19:49 PST
Comment 4 Darin Fisher (:fishd, Google) 2008-11-25 18:21:33 PST
Windows bustage fix:

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.