Closed Bug 329522 Opened 18 years ago Closed 18 years ago

Use JNI's RegisterNatives in javaxpcomglue

Categories

(Core Graveyard :: Java to XPCOM Bridge, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jhpedemonte, Assigned: jhpedemonte)

Details

(Keywords: fixed1.8.1)

Attachments

(1 file)

JNI provides a RegisterNatives method which associates a given Java native method with a method implementation.  This is in contrast to explicitly exporting the method impls from the JNI library and then loading the library into Java.

Using RegisterNatives would make it easier to add Java native methods in the future, since we wouldn't need to worry about creating an exported dummy method in javaxpcomglue.  Also, it would remove the javaxpcomglue library as the go between when Java methods call into XPCOM and back.  That is, all calls into XPCOM from Java currently look like this:

  Java --> javaxpcomlgue  \
                           > JavaXPCOM (as part of libXUL)
  Java <-- javaxpcomglue  /

Using RegisterNatives, we can directly associate the Java methods with their implementations in the XUL library.
Attached patch patchSplinter Review
Use RegisterNatives.  Also allowed me to get rid of function ptr globals.
Attachment #214202 - Flags: review?(benjamin)
Attachment #214202 - Flags: review?(benjamin) → review+
Checked in to trunk and 1.8 branch. ->FIXED
Status: NEW → RESOLVED
Closed: 18 years ago
Keywords: fixed1.8.1
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: