Closed
Bug 1322501
Opened 8 years ago
Closed 4 years ago
Asynchronously obtain, send, and store image data from Gecko to Java
Categories
(Firefox for Android Graveyard :: Activity Stream, defect, P3)
Firefox for Android Graveyard
Activity Stream
Tracking
(fennec+, firefox57 affected)
RESOLVED
INCOMPLETE
People
(Reporter: Grisha, Unassigned)
References
Details
(Whiteboard: [MobileAS] 1.26 1.27)
Attachments
(1 file)
(deleted),
text/plain
|
Details |
For Activity Stream, we need to display highlight preview images. There's a high chance that an image we'd like to display is already available via Gecko's cache.
Obtaining image data itself is easy enough, and can be achieved via performing a network request to fetch it, setting correct cache flags so that request is fulfilled via cache, possibly without validation.
The second step is sending image data over to Java.
Updated•7 years ago
|
Priority: -- → P2
Whiteboard: [MobileAS]
Updated•7 years ago
|
Rank: 1
Whiteboard: [MobileAS] → [MobileAS] 1.26
Updated•7 years ago
|
Iteration: --- → 1.26
Priority: P2 → P1
Updated•7 years ago
|
Iteration: 1.26 → 1.27
Whiteboard: [MobileAS] 1.26 → [MobileAS] 1.26 1.27
Updated•7 years ago
|
Assignee: nobody → michael.l.comella
Comment 1•7 years ago
|
||
Now that I've dug in a little, I've realized that this is an optimization of bug 1301718, which is basically to do this in Java first. So unassigning to focus on the other bug first.
I've made decent progress: I was able to get a reference to the nsICacheEntry for a given URL, from which we can get an inputStream. I'll upload my scratchpad after this. On IRC, jchen suggested passing a reference to Java of the memory that the inputStream is pointing to and writing a custom InputStream in Java that decodes that data (which may be similar to how ThumbnailHelper does it):
17:52
<mcomella> jchen: I'm trying to send a cached image from Gecko -> Java: do you have any tips? I have an nsICacheEntry, which can give me an inputstream and I can also use imgITools.decodeImage to turn it into a an imgIContainer. However, I can't seem to find 1) the raw data or 2) the path on disk, which I think I need to pass one of to Java. This is part of
17:52 https://bugzilla.mozilla.org/show_bug.cgi?id=1322501
18:03
<jchen> mcomella: i guess one way is to read the image data from the inputstream and copy the raw data to java (similar to ThumbnailHelper)
18:04
<jchen> mcomella: you can implement an inputstream in java that does the bytebuffer transfer behind the scenes, and decode the image in java using your java inputstream
18:06
<mcomella> Michael Comella jchen: So rather than passing the data over the gecko bridge, you're suggesting I should pass a reference to the buffer where the data is stored and decode it in java using a custom inputstream?
18:06 *"the data" being the raw bytes of the image data
18:06 From gecko
18:06
<jchen> something like that
---
Notes:
- nsICacheEntry & friends are best looked up via dxr, filtering on idl files, e.g.: https://dxr.mozilla.org/mozilla-central/search?q=path%3Anetwerk%2Fcache2%2F*.idl&redirect=false
- about:cache is very helpful for seeing what's in your cache, its metadata, and getting a reference to a cached entry for testing
Comment 3•7 years ago
|
||
Actually, since this is just an optimization, I'm going to reflag it for triage.
tracking-fennec: --- → ?
Updated•7 years ago
|
Summary: Asynchronously obtain and send image data from Gecko to Java → Asynchronously obtain, send, and store image data from Gecko to Java
Updated•7 years ago
|
Priority: P1 → --
tracking-fennec: ? → +
status-firefox57:
--- → affected
Updated•7 years ago
|
Iteration: 1.27 → 1.28
Updated•7 years ago
|
Iteration: 1.28 → ---
Priority: -- → P2
Comment 4•7 years ago
|
||
Bumping this to P3, filing a smaller bug to download just over wifi.
mcomella, can you add the dependency when you file the other bug?
Flags: needinfo?(michael.l.comella)
Updated•7 years ago
|
Priority: P2 → P3
Updated•7 years ago
|
Flags: needinfo?(michael.l.comella)
Comment 5•7 years ago
|
||
All open Activity Stream bugs are moving from the whiteboard tag, "[mobileAS]", to the Firefox for Android component, "Activity Stream", so that I can keep better track of these bugs as the new triage owner; I will send out an email shortly with additional details, caveats, etc.
Component: General → Activity Stream
Comment 6•4 years ago
|
||
We have completed our launch of our new Firefox on Android. The development of the new versions use GitHub for issue tracking. If the bug report still reproduces in a current version of [Firefox on Android nightly](https://play.google.com/store/apps/details?id=org.mozilla.fenix) an issue can be reported at the [Fenix GitHub project](https://github.com/mozilla-mobile/fenix/). If you want to discuss your report please use [Mozilla's chat](https://wiki.mozilla.org/Matrix#Connect_to_Matrix) server https://chat.mozilla.org and join the [#fenix](https://chat.mozilla.org/#/room/#fenix:mozilla.org) channel.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → INCOMPLETE
Updated•4 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•