Closed Bug 244448 Opened 21 years ago Closed 21 years ago

Exthandler changes for download resuming

Categories

(Core Graveyard :: File Handling, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.8alpha1

People

(Reporter: Biesinger, Assigned: Biesinger)

References

Details

Attachments

(1 file, 1 obsolete file)

In order to implement UI for download resuming, two things need to happen: o) Partially downloaded files must not be deleted. (This happens already for "save target as") o) The listener must know about the filename of the temporary file, so that it knows where to save the resumed file.
Attached patch patch (obsolete) — Splinter Review
Assignee: file-handling → cbiesinger
Status: NEW → ASSIGNED
Attachment #149148 - Flags: review?(bzbarsky)
Target Milestone: --- → mozilla1.8alpha
Comment on attachment 149148 [details] [diff] [review] patch >Index: nsExternalHelperAppService.cpp >+ // Tell the listener about the location of the target file >+ nsCOMPtr<nsIObserver> obs(aDownload); Missing do_QI here? >+ if (obs) >+ obs->Observe(mTempFile, "temp-file", nsnull); Did you just make up the "temp-file" topic? It may be worth documenting it somewhere, especially if we expect embeddors to create their own nsIDownload implementations (which we do, since nsIDownload is in uriloader and the implementations are in xpfe, toolkit, and embedding/browser (not sure what this last one is). More precisely, it should be documented somewhere what the "@mozilla.org/download;1" contract requires (implementing nsIDownload) and what it can do to get more info (implementing nsIObserver and listening for the "temp-file" notification)... I'm not sure we have a place for such documentation (we really need to get our SDK story together), so maybe nsIDownload.idl is a decent place to stick it for now.... :( >+ if (mTempFile && (action != nsIMIMEInfo::saveToDisk)) No need to over-parenthesize. != binds more strongly than &&, and people really should know that. r=bzbarsky with that.
Attachment #149148 - Flags: review?(bzbarsky) → review+
(In reply to comment #2) > >+ // Tell the listener about the location of the target file > >+ nsCOMPtr<nsIObserver> obs(aDownload); > > Missing do_QI here? Yeah. I thought I had put it here. Why did it compile this way? > Did you just make up the "temp-file" topic? yep. > It may be worth documenting it > somewhere, especially if we expect embeddors to create their own nsIDownload > implementations (which we do, since nsIDownload is in uriloader and the > implementations are in xpfe, toolkit, and embedding/browser (not sure what this > last one is). I weren't sure of a good place for it... > More precisely, it should be documented somewhere what the > "@mozilla.org/download;1" contract requires (implementing nsIDownload) and what > it can do to get more info (implementing nsIObserver and listening for the > "temp-file" notification)... I guess http://lxr.mozilla.org/seamonkey/source/uriloader/base/nsIDownload.idl#144 could use a comment about this. > No need to over-parenthesize. != binds more strongly than &&, and people > really should know that. ok.
> Why did it compile this way? I have no clue, and it worries me that it did.... nsCOMPtr doesn't seem to have any constructors that would fit this scenario. Yeah, just sticking it in the IDL there seems to be OK for now, followed by a post to n.p.m.documentation asking about how we can document such things in general.
(In reply to comment #4) > I have no clue, and it worries me that it did.... nsCOMPtr doesn't seem to have > any constructors that would fit this scenario. Hmm. any nsISupports can be implicitly converted to an nsQueryInterface. nsCOMPtr has a ctor that takes an nsQueryInterface. Maybe this is what happened. > Yeah, just sticking it in the IDL there seems to be OK for now, followed by a > post to n.p.m.documentation asking about how we can document such things in general. ok, posting sent.
> Maybe this is what happened. Hmm.. if so, that's kinda cool (since it'd actually do the right thing!)
Attached patch patch v2Splinter Review
requested changes made
Attachment #149148 - Attachment is obsolete: true
Attachment #149156 - Flags: superreview?(darin)
Nice! That is exactly the sort of documentation we need all over!
Attachment #149156 - Flags: superreview?(darin) → superreview+
Checking in base/nsIDownload.idl; /cvsroot/mozilla/uriloader/base/nsIDownload.idl,v <-- nsIDownload.idl new revision: 1.9; previous revision: 1.8 done Checking in exthandler/nsExternalHelperAppService.cpp; /cvsroot/mozilla/uriloader/exthandler/nsExternalHelperAppService.cpp,v <-- nsExternalHelperAppService.cpp new revision: 1.261; previous revision: 1.260 done
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
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: