Closed Bug 1186467 Opened 4 years ago Closed 4 years ago

Convert NativeJSContainer to use new JNI scheme

Categories

(Firefox for Android :: General, defect)

All
Android
defect
Not set

Tracking

()

RESOLVED FIXED
Firefox 42
Tracking Status
firefox42 --- fixed

People

(Reporter: jchen, Assigned: jchen)

References

Details

Attachments

(4 files)

NativeJSContainer currently use mozglue stubs, but we should convert it to use the new JNI scheme that automatically forward native calls to corresponding instances.
Depends on: 1186517
Depends on: 1186530
This patch adds:
* Conversion operator from String::Param to String::LocalRef.
* More overloads of the jni::ThrowException function.
* name members to built-in types like jni::Object, jni::String, etc.
  This allows using jni::Accessors::EnsureClassRef on built-in types
  to get built-in class refs (e.g. jclass for java/lang/String).
* Ability to implicitly convert LocalRef<Cls> to LocalRef<Object>
* Fixes for bugs in LocalRef/GlobalRef where new refs are not created.
Attachment #8641157 - Flags: review?(snorp)
JNIObject is the base class for any class that wish to use per-instance
native methods. It encapsulates the long native pointer that used to be
in NativeJSContainer.
Attachment #8641158 - Flags: review?(snorp)
This patch makes NativeJSContainer use per-instance native methods.
NativeJSContainer is also updated to use smart JNI reference classes.
Attachment #8641160 - Flags: review?(snorp)
Attachment #8641157 - Flags: review?(snorp) → review+
Attachment #8641158 - Flags: review?(snorp) → review+
Comment on attachment 8641160 [details] [diff] [review]
Rewrite NativeJSContainer to use new native JNI scheme (v1)

Review of attachment 8641160 [details] [diff] [review]:
-----------------------------------------------------------------

Lovely.
Attachment #8641160 - Flags: review?(snorp) → review+
You need to log in before you can comment on or make changes to this bug.