Closed
Bug 752724
Opened 13 years ago
Closed 7 years ago
Implement Device Storage editable features
Categories
(Core :: DOM: Device Interfaces, defect)
Tracking
()
RESOLVED
INCOMPLETE
mozilla16
People
(Reporter: dougt, Unassigned)
References
()
Details
Attachments
(1 file)
(deleted),
patch
|
dougt
:
review-
|
Details | Diff | Splinter Review |
Follow up from bug 717103 - this implements the file handle methods.
Comment 2•13 years ago
|
||
If I understood it correctly, .get() and .getEditable() return two different objects (File and FileHandle) backed by the same OS file. The whole point of FileHandle is to provide automatic locking. Now, when you have a (big sized) File object returned by .get(), you pass it to FileReader, then you immediatelly call .getEditable() and do some writing (FileReader is still reading) ... Jonas, should DeviceStorage.get() delegate to FileHandle.getFile() ? So File objects would not be created directly.
Reporter | ||
Comment 3•13 years ago
|
||
> The whole point of FileHandle is to provide automatic locking.
I thought it was so that you'd be able to write to the file.
Reporter | ||
Comment 4•13 years ago
|
||
oh, i like what you're saying Jan. Just expose .get() on device storage -- which is the common case. If you want to write, you use the FileReader and getEditable?
The point of FileHandle is to provide the ability to write, as well the locking mechanisms needed to allow writing safely. And yes, DeviceStorage.get should simply return the same Blob as you'd get from DeviceStorage.getEditable().getFile() (modulo the asynchronous syntax needed). The main advantages with DeviceStorage.get is that it provides a simpler syntax for the common case of simply wanting to read a file, and it also allows for safer security models since it allows read-only access.
Comment 7•13 years ago
|
||
Sorry, I wanted to say "The main point" instead of "whole point" And it provides the ability to write indeed.
Comment 8•13 years ago
|
||
Doug, I still think that you should pass an object that implements nsIFileStorage to DOMFileHandle::Create() For now, only StorageId() has to be implemented. Anyway, we might want to add additional methods to nsIFileStorage to lock the file at OS level to interact with other processes. SQLite has a cross platform implementation of shared and exclusive locks. That might serve as a good example once we need it.
Reporter | ||
Comment 9•13 years ago
|
||
jan, as on IRC, I still do not understand why you need StorageID. I do not think you need nsIFileStorage to provide OS locking -- you can do that based on the nsIFile used to create the FileHandle.
Comment 10•13 years ago
|
||
Some things need to be (or might be needed) done only for DeviceStorage some only for IndexedDB and some for both, so I created the abstract nsIFileStorage interface. Feel free to ignore it if you are convinced it's completely useless for DeviceStorage. We don't need the OS file locking in IndexedDB, but FileHandle has to work with both "file storages". If you want to put OS file locking insided DOMFileHandle ok, up to you.
Reporter | ||
Updated•13 years ago
|
Attachment #621769 -
Flags: review?(Jan.Varga) → review-
Updated•12 years ago
|
Keywords: sec-review-needed
Lucas - What specifically do you want reviewed here, the implementation or the whole concept?
Comment 12•12 years ago
|
||
This API permits writing to a file, so it seems like it should get a secreview and possibly an implementation review as well. A flaw here would be pretty bad.
Updated•12 years ago
|
Assignee: doug.turner → Jan.Varga
Target Milestone: --- → mozilla16
Version: unspecified → Trunk
Updated•12 years ago
|
Flags: sec-review?
Updated•12 years ago
|
Flags: sec-review? → sec-review?(ptheriault)
Updated•12 years ago
|
Assignee: Jan.Varga → nobody
Updated•12 years ago
|
Blocks: B2G-secreview
Updated•12 years ago
|
Priority: -- → P3
Updated•12 years ago
|
Priority: P3 → --
Comment 14•11 years ago
|
||
We're going to implement FileHandle in child processes first.
Flags: needinfo?(doug.turner)
Comment 15•11 years ago
|
||
Removing secreview tag here for now. Please re-flag if/when this progresses.
Flags: sec-review?(ptheriault)
Comment 16•7 years ago
|
||
FxOS/Gonk has been removed from the codebase. Mass-invalidating FxOS related Device Interface bugs to clean up the component. If I incorrectly invalidated something, please let me know.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
Comment 17•7 years ago
|
||
Bulk correction of resolution of B2G bugs to INCOMPLETE.
Resolution: INVALID → INCOMPLETE
You need to log in
before you can comment on or make changes to this bug.
Description
•