Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1240)

Unified Diff: content/public/browser/download_manager.h

Issue 10735089: DownloadManager::Observer::OnDownloadCreated (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/public/browser/download_manager.h
diff --git a/content/public/browser/download_manager.h b/content/public/browser/download_manager.h
index 09628b0268a217e273cd1e564cbe5d1a03d1422e..70056d3b4c33ebd2680319b353e0335f9214ac4f 100644
--- a/content/public/browser/download_manager.h
+++ b/content/public/browser/download_manager.h
@@ -79,9 +79,22 @@ class CONTENT_EXPORT DownloadManager
// to the DownloadManager's collection of downloads.
class CONTENT_EXPORT Observer {
public:
+ // A DownloadItem was created. Useful methods on the item that are
+ // guaranteed to work as advertised include GetId(), AddObserver(),
+ // SetExternalData(), GetURL(). The item is guaranteed to be accessible via
+ // DownloadManager::GetDownload(). No other guarantees are made about its
+ // state: it may have just been loaded from history, it may be an active
+ // download, or it may be a SavePage download, it may or may not already be
+ // persisted. If a consumer needs a DownloadItem's filename, it should wait
+ // for an OnDownloadUpdated() when the filename is not empty(). When the
+ // history is loaded on startup, this method may be called many (thousands)
+ // of times at once.
Randy Smith (Not in Mondays) 2012/07/23 18:40:50 Can you shorten this a bit? I think we're ok just
benjhayden 2012/07/23 18:54:22 Please just give me a string to copy-paste into he
Randy Smith (Not in Mondays) 2012/07/23 19:00:06 Sure, though please confirm with Asanka that what
benjhayden 2012/07/25 16:24:38 Done.
+ virtual void OnDownloadCreated(
+ DownloadManager* manager, DownloadItem* item) {}
+
// New or deleted download, observers should query us for the current set
// of downloads.
- virtual void ModelChanged(DownloadManager* manager) = 0;
+ virtual void ModelChanged(DownloadManager* manager) {}
// Called when the DownloadManager is being destroyed to prevent Observers
// from calling back to a stale pointer.

Powered by Google App Engine
This is Rietveld 408576698