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

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

Issue 9570005: Added callback to DownloadUrl() so we can find download failures. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added thread checks. Created 8 years, 10 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 12d6fb02b4a121d7ebfae8f2aceca6c00b378279..9c665c7bcc6092921818c94604dac4b191f4b289 100644
--- a/content/public/browser/download_manager.h
+++ b/content/public/browser/download_manager.h
@@ -62,6 +62,8 @@ class WebContents;
class CONTENT_EXPORT DownloadManager
: public base::RefCountedThreadSafe<DownloadManager> {
public:
+ typedef base::Callback<void(DownloadId, net::Error)> OnStartedCallback;
+
virtual ~DownloadManager() {}
static DownloadManager* Create(
@@ -176,13 +178,16 @@ class CONTENT_EXPORT DownloadManager
// saved, and whether the user should be prompted about the download.
// |web_contents| is the web page that the download is done in context of,
// and must be non-NULL.
+ // |callback| will be called when the download starts, or if an error
+ // occurs.
Randy Smith (Not in Mondays) 2012/03/06 21:29:14 You should specify the calling interface to callba
ahendrickson 2012/03/06 22:01:36 Heh, I added that information to the typedef in th
virtual void DownloadUrl(const GURL& url,
const GURL& referrer,
const std::string& referrer_encoding,
bool prefer_cache,
int64 post_id,
const DownloadSaveInfo& save_info,
- content::WebContents* web_contents) = 0;
+ content::WebContents* web_contents,
+ const OnStartedCallback& callback) = 0;
// Allow objects to observe the download creation process.
virtual void AddObserver(Observer* observer) = 0;

Powered by Google App Engine
This is Rietveld 408576698