nsIncrementalDownload::GetDestination should return a clone of nsIFile

RESOLVED FIXED in mozilla1.8beta5

Status

()

Core
Networking
--
major
RESOLVED FIXED
12 years ago
12 years ago

People

(Reporter: Darin Fisher, Assigned: Darin Fisher)

Tracking

({fixed1.8})

Trunk
mozilla1.8beta5
fixed1.8
Points:
---
Dependency tree / graph
Bug Flags:
blocking1.8b5 +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

1.13 KB, patch
Biesinger
: review+
Scott MacGregor
: approval1.8b5+
Details | Diff | Splinter Review
(Assignee)

Description

12 years ago
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.
(Assignee)

Comment 1

12 years ago
Created attachment 195931 [details] [diff] [review]
v1 patch
Attachment #195931 - Flags: review?(cbiesinger)
(Assignee)

Updated

12 years ago
Status: NEW → ASSIGNED
Flags: blocking1.8b5?
Target Milestone: --- → mozilla1.8beta5
(Assignee)

Updated

12 years ago
Blocks: 307429
(Assignee)

Updated

12 years ago
Depends on: 308369
Comment on attachment 195931 [details] [diff] [review]
v1 patch

should the IDL document that the caller can freely modify the file?
Attachment #195931 - Flags: review?(cbiesinger) → review+
(Assignee)

Comment 3

12 years ago
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.
ah ok, if we could ensure immuability that'd be great :)
(Assignee)

Comment 5

12 years ago
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 ;-)

Updated

12 years ago
Attachment #195931 - Flags: approval1.8b5+

Comment 6

12 years ago
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. 
Flags: blocking1.8b5? → blocking1.8b5+
(Assignee)

Comment 7

12 years ago
fixed-on-trunk, fixed1.8
Status: ASSIGNED → RESOLVED
Last Resolved: 12 years ago
Keywords: fixed1.8
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.