Closed
Bug 824949
Opened 12 years ago
Closed 12 years ago
Add support for FALLBACK appcache entries for pre-installed 3rd party apps
Categories
(Firefox OS Graveyard :: General, defect)
Firefox OS Graveyard
General
Tracking
(blocking-basecamp:+, firefox19 fixed, firefox20 fixed, b2g18 fixed)
People
(Reporter: ochameau, Assigned: ochameau)
References
Details
Attachments
(1 file, 2 obsolete files)
(deleted),
patch
|
ochameau
:
review+
|
Details | Diff | Splinter Review |
Bug 791039 introduced support for appcache prepopulation for 3rd party preinstalled apps. Apps in `external-apps` gaia folder can ship a `cache` folder containing an `appcache.manifest` that will be read by gecko on first run and updates in order to prepopulate the appcache with files contained in `cache` folder.
But that patch was only adding a limited support of appcache manifest, it only care about cache entries but ignored namespace and fallback ones.
Such entry support was requested in bug 815814.
Assignee | ||
Comment 1•12 years ago
|
||
Assignee | ||
Comment 2•12 years ago
|
||
Assignee | ||
Comment 3•12 years ago
|
||
Comment on attachment 696026 [details] [diff] [review]
Bug 824949 - Add support for FALLBACK appcache entries for pre-installed 3rd party apps
This code is based on existing c++ implementation available here:
http://mxr.mozilla.org/mozilla-central/source/uriloader/prefetch/nsOfflineCacheUpdate.cpp#938
Attachment #696026 -
Flags: review?(21)
Assignee | ||
Updated•12 years ago
|
Assignee: nobody → poirot.alex
Comment 4•12 years ago
|
||
Comment on attachment 696026 [details] [diff] [review]
Bug 824949 - Add support for FALLBACK appcache entries for pre-installed 3rd party apps
Review of attachment 696026 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/apps/src/OfflineCacheInstaller.jsm
@@ +129,5 @@
> let urls = [];
> + let namespaces = [];
> + let fallbacks = [];
> +
> + let section = 'CACHE';
nit: section -> currentSection
@@ +191,1 @@
> }
I would have like a processCacheLine, processFallbackLine, processNetworkLine or something that makes the method smaller.
@@ +208,5 @@
> storeCache(applicationCache, url, file, itemType);
> });
> +
> + let array = Cc['@mozilla.org/array;1'].createInstance(Ci.nsIArray);
> + array.QueryInterface(Ci.nsIMutableArray);
Components.Contructor for the array maybe to stay in sinc with the rest of the code.
Attachment #696026 -
Flags: review?(21)
Assignee | ||
Comment 5•12 years ago
|
||
Updated•12 years ago
|
blocking-basecamp: --- → ?
Assignee | ||
Updated•12 years ago
|
Attachment #696026 -
Attachment is obsolete: true
Assignee | ||
Comment 6•12 years ago
|
||
Comment on attachment 696531 [details] [diff] [review]
Bug 824949 - Add support for FALLBACK appcache entries for pre-installed 3rd party apps
You opened my eyes, I didn't realized how long what that method alone in this file :o So I made some more substantial modifications and split in reasonable sized functions.
I hope you will like them!
I tested this patch again with potch patch against marketplace-dev.
Attachment #696531 -
Flags: review?(21)
Updated•12 years ago
|
blocking-basecamp: ? → +
Comment 7•12 years ago
|
||
Comment on attachment 696531 [details] [diff] [review]
Bug 824949 - Add support for FALLBACK appcache entries for pre-installed 3rd party apps
Review of attachment 696531 [details] [diff] [review]:
-----------------------------------------------------------------
r+ with nits.
::: dom/apps/src/OfflineCacheInstaller.jsm
@@ +108,5 @@
> + } else if (line.substr(0, 4) == 'http') {
> + urls.push(line);
> + } else {
> + throw new Error('Only accept absolute path and http/https URLs');
> +
nit: extra line break
@@ +113,5 @@
> + }
> +}
> +
> +function parseFallbackLine(app, namespaces, fallbacks, line) {
> + let split = line.split(/[ \t]+/);
let [namespace, fallback] = line.split(/[ \t]+/); ? ;)
Attachment #696531 -
Flags: review?(21) → review+
Comment 8•12 years ago
|
||
Can we get the nits addressed and land this?
Assignee | ||
Comment 9•12 years ago
|
||
Assignee | ||
Updated•12 years ago
|
Attachment #696531 -
Attachment is obsolete: true
Assignee | ||
Comment 10•12 years ago
|
||
Comment on attachment 697394 [details] [diff] [review]
Bug 824949 - Add support for FALLBACK appcache entries for pre-installed 3rd party apps r=vingtetun
Addressed nits.
Tested again with potch's version of marketplace-dev using fallback entry.
https://github.com/potch/gaia/commit/f5960def1ed01924a39f2fd8e4f65d49ffd3d529
The only modification needed is to add `/offline/home` in CACHE entries.
Attachment #697394 -
Flags: review+
Assignee | ||
Updated•12 years ago
|
Keywords: checkin-needed
Comment 11•12 years ago
|
||
Do you know there is a support in Gecko to download offline cache to a selected profile folder for you?
http://hg.mozilla.org/mozilla-central/annotate/6955309291ee/uriloader/prefetch/nsIOfflineCacheUpdate.idl#l230
It is not very wise to reimplement the manifest parser and updater again, when there is a full offline cache update and download code in Gecko already.
Updated•12 years ago
|
Target Milestone: --- → B2G C4 (2jan on)
Assignee | ||
Comment 12•12 years ago
|
||
(In reply to Honza Bambas (:mayhemer) from comment #11)
> Do you know there is a support in Gecko to download offline cache to a
> selected profile folder for you?
>
> http://hg.mozilla.org/mozilla-central/annotate/6955309291ee/uriloader/
> prefetch/nsIOfflineCacheUpdate.idl#l230
>
> It is not very wise to reimplement the manifest parser and updater again,
> when there is a full offline cache update and download code in Gecko already.
As far as I can tell there isn't any method close to what we are doing.
Here at the time we feed the offline cache DB, we do not have network connection. It is done on first run and then on updates. We are filling the offline cache with files coming from the file system.
We could have hacked something in c++, but I don't think it will be that easier.
The parser implemention doesn't seems to be hookable.
Note that we do not do any update. We just prepropulate offline cache in order to be able to load web apps without requiring to have data connection, then all existing c++ code do the rest.
Comment 13•12 years ago
|
||
Ah, it's that code. Then yes, you unfortunately don't have another option.
Comment 14•12 years ago
|
||
Keywords: checkin-needed
Comment 15•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Comment 16•12 years ago
|
||
You need to log in
before you can comment on or make changes to this bug.
Description
•