Closed
Bug 244448
Opened 21 years ago
Closed 21 years ago
Exthandler changes for download resuming
Categories
(Core Graveyard :: File Handling, enhancement)
Core Graveyard
File Handling
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla1.8alpha1
People
(Reporter: Biesinger, Assigned: Biesinger)
References
Details
Attachments
(1 file, 1 obsolete file)
3.12 KB,
patch
|
darin.moz
:
superreview+
|
Details | Diff | Splinter Review |
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.
Assignee | ||
Comment 1•21 years ago
|
||
Assignee: file-handling → cbiesinger
Status: NEW → ASSIGNED
Assignee | ||
Updated•21 years ago
|
Attachment #149148 -
Flags: review?(bzbarsky)
Assignee | ||
Updated•21 years ago
|
Target Milestone: --- → mozilla1.8alpha
![]() |
||
Comment 2•21 years ago
|
||
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+
Assignee | ||
Comment 3•21 years ago
|
||
(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.
![]() |
||
Comment 4•21 years ago
|
||
> 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.
Assignee | ||
Comment 5•21 years ago
|
||
(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.
![]() |
||
Comment 6•21 years ago
|
||
> Maybe this is what happened.
Hmm.. if so, that's kinda cool (since it'd actually do the right thing!)
Assignee | ||
Comment 7•21 years ago
|
||
requested changes made
Assignee | ||
Updated•21 years ago
|
Attachment #149148 -
Attachment is obsolete: true
Assignee | ||
Updated•21 years ago
|
Attachment #149156 -
Flags: superreview?(darin)
![]() |
||
Comment 8•21 years ago
|
||
Nice! That is exactly the sort of documentation we need all over!
Updated•21 years ago
|
Attachment #149156 -
Flags: superreview?(darin) → superreview+
Assignee | ||
Comment 9•21 years ago
|
||
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
Assignee | ||
Comment 10•21 years ago
|
||
this caused bug 249677
Updated•9 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•