Generator for accessing C++ objects from Java code

NEW
Unassigned

Status

()

Firefox for Android
General
4 years ago
4 years ago

People

(Reporter: wesj, Unassigned)

Tracking

Trunk
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

4 years ago
At some point, it would be nice to be able to do our JNI generation backwards, perhaps generating code from IDL files? The main use case I have here is Java InputStreams. There are cases (File inputs on pages) where Android hands us an input stream. For a normal app, they'd just use that to upload a file to a site or show it in the UI. Since Gecko can't handle them, we download the entire file into temp and then hand that file to Gecko.

I played with this once and at some point, and thought a pretty way to do it would be if Java could hold handles to the C++ objects itself (we do something like this in our SQLiteWrapper already). i.e. Java would hold a reference to the nsIStreamListener (or the nsIInputStream?) itself and call methods on it when it had data available.

I have a feeling there's a much better way to do this, but wanted to jot down the idea somewhere in case other people had thoughts.
You need to log in before you can comment on or make changes to this bug.