Last Comment Bug 308370 - nsIncrementalDownload::GetDestination should return a clone of nsIFile
: nsIncrementalDownload::GetDestination should return a clone of nsIFile
: fixed1.8
Product: Core
Classification: Components
Component: Networking (show other bugs)
: Trunk
: All All
: -- major (vote)
: mozilla1.8beta5
Assigned To: Darin Fisher
: benc
: Patrick McManus [:mcmanus]
Depends on: 308369
Blocks: 307429
  Show dependency treegraph
Reported: 2005-09-13 12:35 PDT by Darin Fisher
Modified: 2005-09-14 13:50 PDT (History)
3 users (show)
mscott: blocking1.8b5+
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

v1 patch (1.13 KB, patch)
2005-09-13 13:17 PDT, Darin Fisher
cbiesinger: review+
mscott: approval1.8b5+
Details | Diff | Splinter Review

Description Darin Fisher 2005-09-13 12:35:17 PDT
nsIncrementalDownload::GetDestination should return a clone of nsIFile

This is needed to workaround the fact that nsIFile implementations may cache
their stat caches.  It is also similar to the way nsStandardURL::GetFile is
implemented, which allows consumers to modify the nsIFile that they get back. 
Because internal string buffers are shared, the main cost incurred is that of
allocating a new nsLocalFile structure.
Comment 1 Darin Fisher 2005-09-13 13:17:32 PDT
Created attachment 195931 [details] [diff] [review]
v1 patch
Comment 2 Christian :Biesinger (don't email me, ping me on IRC) 2005-09-13 15:30:14 PDT
Comment on attachment 195931 [details] [diff] [review]
v1 patch

should the IDL document that the caller can freely modify the file?
Comment 3 Darin Fisher 2005-09-13 16:47:03 PDT
My thinking is that we may want to change this code in the future if we ever get
a nsIFile implementation that sucks less ;-)  Like, it would be really cool if I
could hand out a reference to my nsIFile that was 1) immutable and 2) smart
enough to return the actual file size when requested.
Comment 4 Christian :Biesinger (don't email me, ping me on IRC) 2005-09-13 17:15:18 PDT
ah ok, if we could ensure immuability that'd be great :)
Comment 5 Darin Fisher 2005-09-13 17:54:15 PDT
Yeah, I've always wanted a way to mark a nsLocalFile instance as immutable. 
Something similar to the way nsStandardURL works would be nice.  But, heck...
it'd be nice if we even used nsStandardURL's support for immutability ;-)
Comment 6 Scott MacGregor 2005-09-14 10:17:28 PDT
this looks low risk so approving for the branch but we should let it bake on the
trunk for a couple days just to be safe. 
Comment 7 Darin Fisher 2005-09-14 13:50:26 PDT
fixed-on-trunk, fixed1.8

Note You need to log in before you can comment on or make changes to this bug.