Bug 55383 - JavaInstance should be a pure interface
Summary: JavaInstance should be a pure interface
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Steve Block
URL:
Keywords:
Depends on: 55212 55219 55384 55765 55766 55772 55967 56009 56197 57019 57533
Blocks: 57230 57859
  Show dependency treegraph
 
Reported: 2011-02-28 08:51 PST by Steve Block
Modified: 2011-04-05 10:19 PDT (History)
4 users (show)

See Also:


Attachments
Patch 1 (15.75 KB, patch)
2011-04-04 04:12 PDT, Steve Block
no flags Details | Formatted Diff | Diff
Patch 2 (15.68 KB, patch)
2011-04-05 09:16 PDT, Steve Block
dglazkov: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Block 2011-02-28 08:51:58 PST
The Java bridge code in WebCore/bridge/jni uses JavaInstance to represent a Java object which can be injected into JavaScript. The binding to JavaScript is done via NPAPI so objects of type JavaInstance are manipulated via JavaNPObject.

The implementation of JavaInstance is a simple wrapper around a JNI jobject. To allow implementations flexibility in how the binding to a Java object is achieved, JavaInstance should be an interface. The current JavaInstance implementation would be moved to a new JavaInstanceJobject class which implements this interface.
Comment 1 Steve Block 2011-04-04 04:12:21 PDT
Created attachment 88047 [details]
Patch 1
Comment 2 Andrei Popescu 2011-04-05 08:47:40 PDT
> Source/WebCore/bridge/jni/v8/JavaInstanceJobjectV8.cpp:45
> +    m_class = 0;

Can we use an initialization list instead?

> Source/WebCore/bridge/jni/v8/JavaInstanceJobjectV8.cpp:51
> +    delete m_class;

Use an OwnPtr?
Comment 3 Steve Block 2011-04-05 09:15:53 PDT
> Can we use an initialization list instead?
Done

> Use an OwnPtr?
Done
Comment 4 Steve Block 2011-04-05 09:16:16 PDT
Created attachment 88249 [details]
Patch 2
Comment 5 Andrei Popescu 2011-04-05 09:23:55 PDT
LGTM
Comment 6 Dimitri Glazkov (Google) 2011-04-05 09:44:53 PDT
Comment on attachment 88249 [details]
Patch 2

rs=me.
Comment 7 Steve Block 2011-04-05 10:12:16 PDT
Committed r82950: <http://trac.webkit.org/changeset/82950>