Index: content/browser/download/download_file_impl.h |
diff --git a/content/browser/download/download_file_impl.h b/content/browser/download/download_file_impl.h |
index ab39c1402c06d752583309f246044335d0912f84..c6bfba1a982b026afbe42afb5e85fd2b13e559b3 100644 |
--- a/content/browser/download/download_file_impl.h |
+++ b/content/browser/download/download_file_impl.h |
@@ -10,9 +10,12 @@ |
#include "base/memory/ref_counted.h" |
#include "base/memory/scoped_ptr.h" |
+#include "base/memory/weak_ptr.h" |
#include "base/timer.h" |
#include "content/browser/download/base_file.h" |
+#include "content/browser/download/byte_stream.h" |
#include "content/browser/download/download_request_handle.h" |
+#include "net/base/net_log.h" |
class PowerSaveBlocker; |
@@ -36,12 +39,9 @@ class CONTENT_EXPORT DownloadFileImpl : virtual public content::DownloadFile { |
// DownloadFile functions. |
virtual net::Error Initialize() OVERRIDE; |
- virtual net::Error AppendDataToFile(const char* data, |
- size_t data_len) OVERRIDE; |
virtual net::Error Rename(const FilePath& full_path) OVERRIDE; |
virtual void Detach() OVERRIDE; |
virtual void Cancel() OVERRIDE; |
- virtual void Finish() OVERRIDE; |
virtual void AnnotateWithSourceInformation() OVERRIDE; |
virtual FilePath FullPath() const OVERRIDE; |
virtual bool InProgress() const OVERRIDE; |
@@ -55,13 +55,26 @@ class CONTENT_EXPORT DownloadFileImpl : virtual public content::DownloadFile { |
virtual const content::DownloadId& GlobalId() const OVERRIDE; |
virtual std::string DebugString() const OVERRIDE; |
+ protected: // For test class overrides. |
+ virtual net::Error AppendDataToFile(const char* data, |
+ size_t data_len); |
+ |
private: |
+ // Called when there's some activity on input_pipe_ that needs to be |
+ // handled. |
+ void PipeActive(); |
+ |
// Send updates on our progress. |
void SendUpdate(); |
// The base file instance. |
BaseFile file_; |
+ // The pipe through which data comes. |
+ // TODO(rdsmith): Move this into BaseFile; requires using the same |
+ // pipe semantics in SavePackage. |
+ scoped_refptr<content::ByteStream> input_pipe_; |
+ |
// The unique identifier for this download, assigned at creation by |
// the DownloadFileManager for its internal record keeping. |
content::DownloadId id_; |
@@ -76,6 +89,10 @@ class CONTENT_EXPORT DownloadFileImpl : virtual public content::DownloadFile { |
// DownloadManager this download belongs to. |
scoped_refptr<content::DownloadManager> download_manager_; |
+ net::BoundNetLog bound_net_log_; |
+ |
+ base::WeakPtrFactory<DownloadFileImpl> weak_factory_; |
+ |
// RAII handle to keep the system from sleeping while we're downloading. |
scoped_ptr<PowerSaveBlocker> power_save_blocker_; |