| 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 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "content/browser/download/base_file.h" | 13 #include "content/browser/download/base_file.h" |
| 14 #include "content/browser/download/download_request_handle.h" | 14 #include "content/browser/download/download_request_handle.h" |
| 15 #include "content/browser/download/download_types.h" | 15 #include "content/browser/download/download_types.h" |
| 16 #include "content/common/content_export.h" |
| 16 | 17 |
| 17 struct DownloadCreateInfo; | 18 struct DownloadCreateInfo; |
| 18 class DownloadManager; | 19 class DownloadManager; |
| 19 class ResourceDispatcherHost; | 20 class ResourceDispatcherHost; |
| 20 | 21 |
| 21 // 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 |
| 22 // 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 |
| 23 // 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 |
| 24 // cancelled, the DownloadFile is destroyed. | 25 // cancelled, the DownloadFile is destroyed. |
| 25 class DownloadFile : public BaseFile { | 26 class CONTENT_EXPORT DownloadFile : public BaseFile { |
| 26 public: | 27 public: |
| 27 DownloadFile(const DownloadCreateInfo* info, | 28 DownloadFile(const DownloadCreateInfo* info, |
| 28 DownloadManager* download_manager); | 29 DownloadManager* download_manager); |
| 29 virtual ~DownloadFile(); | 30 virtual ~DownloadFile(); |
| 30 | 31 |
| 31 // Cancels the download request associated with this file. | 32 // Cancels the download request associated with this file. |
| 32 void CancelDownloadRequest(); | 33 void CancelDownloadRequest(); |
| 33 | 34 |
| 34 int id() const { return id_; } | 35 int id() const { return id_; } |
| 35 DownloadManager* GetDownloadManager(); | 36 DownloadManager* GetDownloadManager(); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 65 // download system, specifically canceling a download. | 66 // download system, specifically canceling a download. |
| 66 DownloadRequestHandle request_handle_; | 67 DownloadRequestHandle request_handle_; |
| 67 | 68 |
| 68 // DownloadManager this download belongs to. | 69 // DownloadManager this download belongs to. |
| 69 scoped_refptr<DownloadManager> download_manager_; | 70 scoped_refptr<DownloadManager> download_manager_; |
| 70 | 71 |
| 71 DISALLOW_COPY_AND_ASSIGN(DownloadFile); | 72 DISALLOW_COPY_AND_ASSIGN(DownloadFile); |
| 72 }; | 73 }; |
| 73 | 74 |
| 74 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_ | 75 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_H_ |
| OLD | NEW |