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

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

Issue 10831302: Download resumption - Preliminary (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed signed/unsigned compare issue. Created 8 years, 1 month 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_item.h
diff --git a/content/public/browser/download_item.h b/content/public/browser/download_item.h
index 9eaf629612e7ca77f2f89701deba996ac6da7bd2..5c1a17449d5ae9518c726e3a6b012a67fcde5262 100644
--- a/content/public/browser/download_item.h
+++ b/content/public/browser/download_item.h
@@ -27,6 +27,7 @@
#include "content/public/browser/download_danger_type.h"
#include "content/public/browser/download_interrupt_reasons.h"
#include "content/public/common/page_transition_types.h"
+#include "net/base/net_log.h"
class FilePath;
class GURL;
@@ -102,6 +103,10 @@ class CONTENT_EXPORT DownloadItem : public base::SupportsUserData {
// down.
virtual void OnDownloadDestroyed(DownloadItem* download) {}
+ // Support for download interruptions.
+ virtual void OnDownloadInterrupted(DownloadItem* download) {}
+ virtual void OnDownloadResumed(DownloadItem* download) {}
+
protected:
virtual ~Observer() {}
};
@@ -157,6 +162,7 @@ class CONTENT_EXPORT DownloadItem : public base::SupportsUserData {
virtual DownloadInterruptReason GetLastReason() const = 0;
virtual bool IsPaused() const = 0;
+ virtual bool CanResumeInterrupted() const = 0;
virtual bool IsTemporary() const = 0;
// Convenience routines for accessing GetState() results conceptually -----
@@ -277,6 +283,9 @@ class CONTENT_EXPORT DownloadItem : public base::SupportsUserData {
// Returns true if it is OK to open the download.
virtual bool CanOpenDownload() = 0;
+ // Returns true if the download is paused or interrupted, and can be resumed.
+ virtual bool CanResumeDownload() const = 0;
+
// Tests if a file type should be opened automatically.
virtual bool ShouldOpenFileBasedOnExtension() = 0;
@@ -319,6 +328,9 @@ class CONTENT_EXPORT DownloadItem : public base::SupportsUserData {
virtual void SetDisplayName(const FilePath& name) = 0;
// Debug/testing -------------------------------------------------------------
+ // Gets the BoundNetLog associated with this download.
+ virtual const net::BoundNetLog& GetBoundNetLog() const = 0;
+
virtual std::string DebugString(bool verbose) const = 0;
virtual void MockDownloadOpenForTesting() = 0;
};
« no previous file with comments | « content/browser/renderer_host/resource_loader.cc ('k') | content/public/browser/download_manager_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698