Closed Bug 1150160 Opened 10 years ago Closed 10 years ago

Support import of apps as memory blobs.

Categories

(Core Graveyard :: DOM: Apps, defect, P1)

x86_64
Linux
defect

Tracking

(firefox40 fixed)

RESOLVED FIXED
mozilla40
Tracking Status
firefox40 --- fixed

People

(Reporter: fabrice, Assigned: fabrice)

References

Details

(Whiteboard: [spark])

Attachments

(1 file)

No description provided.
Attached patch import-memory-blob.patch (deleted) — Splinter Review
Justin, do you mind testing that for lightsaber? That removes the need to save blobs on the sd-card and to grand the sd-card permissions to all apps.
Attachment #8586915 - Flags: feedback?(jdarcangelo)
Comment on attachment 8586915 [details] [diff] [review] import-memory-blob.patch Review of attachment 8586915 [details] [diff] [review]: ----------------------------------------------------------------- Seems to work for me. Thanks!
Attachment #8586915 - Flags: feedback?(jdarcangelo) → feedback+
Attachment #8586915 - Flags: review?(ferjmoreno)
Blocks: cypress
Priority: -- → P1
Whiteboard: [lightsaber]
Comment on attachment 8586915 [details] [diff] [review] import-memory-blob.patch Review of attachment 8586915 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/apps/ImportExport.jsm @@ +37,5 @@ > const PR_CREATE_FILE = 0x08; > const PR_TRUNCATE = 0x20; > > function debug(aMsg) { > +//#ifdef DEBUG I guess you used this to debug problems while working on the patch, but should be removed now. @@ +246,5 @@ > + return new Promise((aResolve, aReject) => { > + let reader = Cc['@mozilla.org/files/filereader;1'] > + .createInstance(Ci.nsIDOMFileReader); > + reader.onloadend = () => { > + Cu.import("resource://gre/modules/osfile.jsm"); Nit: could you use a lazy module getter? @@ +248,5 @@ > + .createInstance(Ci.nsIDOMFileReader); > + reader.onloadend = () => { > + Cu.import("resource://gre/modules/osfile.jsm"); > + let path = OS.Path.join(OS.Constants.Path.tmpDir, "blob-" + > + this._tmpId + ".zip"); You could use openUnique to generate a file with a unique file name: https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript_code_modules/OSFile.jsm/OS.File_for_the_main_thread#OS.File.openUnique%28%29
Attachment #8586915 - Flags: review?(ferjmoreno) → review+
The file should be closed after being opened here: https://hg.mozilla.org/integration/b2g-inbound/rev/557609749a57#l1.55 Since you've opened it, you could also directly use |file.write| instead of |writeAtomic|.
Backed out in https://hg.mozilla.org/integration/b2g-inbound/rev/a586f075e7d0 for Windows "Memory blob processed. - got "[object Object]", expected "InvalidZip""
Status: NEW → RESOLVED
Closed: 10 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
Whiteboard: [lightsaber] → [ignite]
Whiteboard: [ignite] → [spark]
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: