I'm working on some UI related to downloads, and I need a clean indication
that a download is finished. Not just finished but Finished. And I've found
we're getting two notifications: one before auto-opening happens, and one
after it happens.

If we look at DownloadManager::ContinueDownloadFinished (line 867) we see:

  // Notify our observers that we are complete (the call to Finished() set
> the
>   // state to complete but did not notify).
>   download->UpdateObservers();
>

That's at the very end, and that's the real Finished notification (auto-open
is done, etc). Looking at the comment we see that we'd called
DownloadItem::Finished earlier (in fact, in
DownloadManager::DownloadFinished, line 814). But if you look at the
implementation of DownloadItem::Finished you'll see that the comment is a
lie...

Glen changed it about a year
ago<http://src.chromium.org/viewvc/chrome/trunk/src/chrome/browser/download/download_manager.cc?r1=4049&r2=4177>to
fix a bug, so I'm not keen on switching it back. But I need to know
when
a download's done. Any download experts have an opinion?

Avi

-- 
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
    http://groups.google.com/group/chromium-dev

Reply via email to