OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_IMPL_H_ |
6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_IMPL_H_ | 6 #define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_IMPL_H_ |
7 | 7 |
8 #include "content/browser/download/download_file.h" | 8 #include "content/browser/download/download_file.h" |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 public: | 29 public: |
30 // Takes ownership of the object pointed to by |request_handle|. | 30 // Takes ownership of the object pointed to by |request_handle|. |
31 // |bound_net_log| will be used for logging the download file's events. | 31 // |bound_net_log| will be used for logging the download file's events. |
32 // May be constructed on any thread. All methods besides the constructor | 32 // May be constructed on any thread. All methods besides the constructor |
33 // (including destruction) must occur on the FILE thread. | 33 // (including destruction) must occur on the FILE thread. |
34 // | 34 // |
35 // Note that the DownloadFileImpl automatically reads from the passed in | 35 // Note that the DownloadFileImpl automatically reads from the passed in |
36 // stream, and sends updates and status of those reads to the | 36 // stream, and sends updates and status of those reads to the |
37 // DownloadDestinationObserver. | 37 // DownloadDestinationObserver. |
38 DownloadFileImpl( | 38 DownloadFileImpl( |
39 scoped_ptr<DownloadSaveInfo> save_info, | 39 const DownloadSaveInfo& save_info, |
40 const base::FilePath& default_downloads_directory, | 40 const base::FilePath& default_downloads_directory, |
41 const GURL& url, | 41 const GURL& url, |
42 const GURL& referrer_url, | 42 const GURL& referrer_url, |
43 bool calculate_hash, | 43 bool calculate_hash, |
44 scoped_ptr<ByteStreamReader> stream, | 44 scoped_ptr<net::FileStream> file_stream, |
| 45 scoped_ptr<ByteStreamReader> byte_stream, |
45 const net::BoundNetLog& bound_net_log, | 46 const net::BoundNetLog& bound_net_log, |
46 scoped_ptr<PowerSaveBlocker> power_save_blocker, | 47 scoped_ptr<PowerSaveBlocker> power_save_blocker, |
47 base::WeakPtr<DownloadDestinationObserver> observer); | 48 base::WeakPtr<DownloadDestinationObserver> observer); |
48 | 49 |
49 virtual ~DownloadFileImpl(); | 50 virtual ~DownloadFileImpl(); |
50 | 51 |
51 // DownloadFile functions. | 52 // DownloadFile functions. |
52 virtual void Initialize(const InitializeCallback& callback) OVERRIDE; | 53 virtual void Initialize(const InitializeCallback& callback) OVERRIDE; |
53 virtual void RenameAndUniquify( | 54 virtual void RenameAndUniquify( |
54 const base::FilePath& full_path, | 55 const base::FilePath& full_path, |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 108 |
108 // RAII handle to keep the system from sleeping while we're downloading. | 109 // RAII handle to keep the system from sleeping while we're downloading. |
109 scoped_ptr<PowerSaveBlocker> power_save_blocker_; | 110 scoped_ptr<PowerSaveBlocker> power_save_blocker_; |
110 | 111 |
111 DISALLOW_COPY_AND_ASSIGN(DownloadFileImpl); | 112 DISALLOW_COPY_AND_ASSIGN(DownloadFileImpl); |
112 }; | 113 }; |
113 | 114 |
114 } // namespace content | 115 } // namespace content |
115 | 116 |
116 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_IMPL_H_ | 117 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_IMPL_H_ |
OLD | NEW |