| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_ |
| 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 // These objects live exclusively on the download thread and handle the writing | 22 // These objects live exclusively on the download thread and handle the writing |
| 23 // operations for one download. These objects live only for the duration that | 23 // operations for one download. These objects live only for the duration that |
| 24 // the download is 'in progress': once the download has been completed or | 24 // the download is 'in progress': once the download has been completed or |
| 25 // cancelled, the DownloadFile is destroyed. | 25 // cancelled, the DownloadFile is destroyed. |
| 26 class CONTENT_EXPORT DownloadFile : public BaseFile { | 26 class CONTENT_EXPORT DownloadFile : public BaseFile { |
| 27 public: | 27 public: |
| 28 // Takes ownership of the object pointed to by |request_handle|. | 28 // Takes ownership of the object pointed to by |request_handle|. |
| 29 DownloadFile(const DownloadCreateInfo* info, | 29 DownloadFile(const DownloadCreateInfo* info, |
| 30 DownloadRequestHandleInterface* request_handle, | 30 DownloadRequestHandleInterface* request_handle, |
| 31 DownloadManager* download_manager); | 31 DownloadManager* download_manager, |
| 32 const std::string& initial_hash); |
| 32 virtual ~DownloadFile(); | 33 virtual ~DownloadFile(); |
| 33 | 34 |
| 34 // Cancels the download request associated with this file. | 35 // Cancels the download request associated with this file. |
| 35 void CancelDownloadRequest(); | 36 void CancelDownloadRequest(); |
| 36 | 37 |
| 37 int id() const { return id_.local(); } | 38 int id() const { return id_.local(); } |
| 38 DownloadManager* GetDownloadManager(); | 39 DownloadManager* GetDownloadManager(); |
| 39 const DownloadId& global_id() const { return id_; } | 40 const DownloadId& global_id() const { return id_; } |
| 40 | 41 |
| 41 virtual std::string DebugString() const; | 42 virtual std::string DebugString() const; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 69 // download system, specifically canceling a download. | 70 // download system, specifically canceling a download. |
| 70 scoped_ptr<DownloadRequestHandleInterface> request_handle_; | 71 scoped_ptr<DownloadRequestHandleInterface> request_handle_; |
| 71 | 72 |
| 72 // DownloadManager this download belongs to. | 73 // DownloadManager this download belongs to. |
| 73 scoped_refptr<DownloadManager> download_manager_; | 74 scoped_refptr<DownloadManager> download_manager_; |
| 74 | 75 |
| 75 DISALLOW_COPY_AND_ASSIGN(DownloadFile); | 76 DISALLOW_COPY_AND_ASSIGN(DownloadFile); |
| 76 }; | 77 }; |
| 77 | 78 |
| 78 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_ | 79 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_ |
| OLD | NEW |