Closed
Bug 912457
Opened 11 years ago
Closed 11 years ago
[OS.File] OS.File doesn't expose flush on file object from chrome
Categories
(Toolkit Graveyard :: OS.File, defect)
Toolkit Graveyard
OS.File
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla27
People
(Reporter: ochameau, Assigned: nmaier)
Details
(Keywords: dev-doc-complete, Whiteboard: [Async][mentor=Yoric][lang=js])
Attachments
(1 file, 1 obsolete file)
6.08 KB,
patch
|
nmaier
:
review+
|
Details | Diff | Splinter Review |
The documentation talks about a flush method on file objects, but it isn't being exposed, at least when using OS.File from chrome code:
https://developer.mozilla.org/en-US/docs/JavaScript_OS.File/OS.File_for_the_main_thread#OS.File.prototype.flush
Comment 1•11 years ago
|
||
The change is actually rather simple:
- in osfile_async_worker.jsm, add a method File_prototype_flush that calls File.prototype.flush, much like e.g File_prototype_setPosition calls File.prototype.setPosition);
- in osfile_async_front.jsm, add a method File.prototype.flush that sends message File_prototype_flush, much like e.g. File.prototype.setPosition sends message File_prototype_setPosition.
Whiteboard: [mentor=Yoric][lang=js]
Hi, this could be a first bug to start, can it be assigned to me?
Comment 3•11 years ago
|
||
Have fun :)
If you have any questions, don't hesitate to come and chat on #introduction: http://client00.chat.mibbit.com/?server=irc.mozilla.org&channel=%23introduction&nick=tomiberes
Assignee: nobody → tomiberes
Comment 4•11 years ago
|
||
Hi Tomiberes, how are things doing on this bug? Do you need any assistance?
Flags: needinfo?(tomiberes)
Comment 5•11 years ago
|
||
In the absence of news, de-assigning.
Assignee: tomiberes → nobody
Flags: needinfo?(tomiberes)
Updated•11 years ago
|
Summary: OS.File doesn't expose flush on file object from chrome → [OS.File] OS.File doesn't expose flush on file object from chrome
Whiteboard: [mentor=Yoric][lang=js] → [Async][mentor=Yoric][lang=js]
Assignee | ||
Comment 6•11 years ago
|
||
Note that this patch is on top of some other patches (bug 928239, bug 924858, bug 924916) in my queue and will fail to apply the xpcshell.ini hunk without the other patches.
Comment 7•11 years ago
|
||
In that case, could you add dependencies?
Comment 8•11 years ago
|
||
Comment on attachment 818844 [details] [diff] [review]
Expose async |flush()| in OS.File.
Review of attachment 818844 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good, thanks.
::: toolkit/components/osfile/modules/osfile_async_front.jsm
@@ +498,5 @@
> + },
> +
> + /**
> + * Flushes the file's buffers and causes all buffered data
> + * to be written.
Could you add one line to mention that this operation is generally quite expensive, serves essentially to protect against hardware/kernel/power failures taking place immediately after the write and should be reserved for valuable files?
Attachment #818844 -
Flags: review?(dteller) → review+
Assignee | ||
Comment 9•11 years ago
|
||
How about:
Disk flushes are very expensive and therefore should be used carefully, sparingly and only in scenarios where it is vital that data survives system crashes. Even though the function will be executed off the main-thread, it might still affect the overall performance of any running application.
Sounds good.
Assignee | ||
Comment 11•11 years ago
|
||
Unbitrotted. Carrying over r=yoric.
Part of this green try: https://tbpl.mozilla.org/?tree=Try&rev=62ec046931e3
Attachment #823021 -
Flags: review+
Assignee | ||
Updated•11 years ago
|
Attachment #818844 -
Attachment is obsolete: true
Assignee | ||
Updated•11 years ago
|
Keywords: checkin-needed
Comment 12•11 years ago
|
||
Flags: in-testsuite+
Keywords: checkin-needed
Whiteboard: [Async][mentor=Yoric][lang=js] → [Async][mentor=Yoric][lang=js][fixed-in-fx-team]
Comment 13•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [Async][mentor=Yoric][lang=js][fixed-in-fx-team] → [Async][mentor=Yoric][lang=js]
Target Milestone: --- → mozilla27
Assignee | ||
Comment 14•11 years ago
|
||
Updated article to state |.flush()| is supported in the async interface since Gecko 27:
https://developer.mozilla.org/en-US/docs/JavaScript_OS.File/OS.File_for_the_main_thread
Keywords: dev-doc-complete
Updated•2 years ago
|
Product: Toolkit → Toolkit Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•