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 26 matching lines...) Expand all Loading... |
37 DownloadFileImpl( | 37 DownloadFileImpl( |
38 scoped_ptr<DownloadSaveInfo> save_info, | 38 scoped_ptr<DownloadSaveInfo> save_info, |
39 const base::FilePath& default_downloads_directory, | 39 const base::FilePath& default_downloads_directory, |
40 const GURL& url, | 40 const GURL& url, |
41 const GURL& referrer_url, | 41 const GURL& referrer_url, |
42 bool calculate_hash, | 42 bool calculate_hash, |
43 scoped_ptr<ByteStreamReader> stream, | 43 scoped_ptr<ByteStreamReader> stream, |
44 const net::BoundNetLog& bound_net_log, | 44 const net::BoundNetLog& bound_net_log, |
45 base::WeakPtr<DownloadDestinationObserver> observer); | 45 base::WeakPtr<DownloadDestinationObserver> observer); |
46 | 46 |
47 virtual ~DownloadFileImpl(); | 47 ~DownloadFileImpl() override; |
48 | 48 |
49 // DownloadFile functions. | 49 // DownloadFile functions. |
50 virtual void Initialize(const InitializeCallback& callback) override; | 50 void Initialize(const InitializeCallback& callback) override; |
51 virtual void RenameAndUniquify( | 51 void RenameAndUniquify(const base::FilePath& full_path, |
52 const base::FilePath& full_path, | 52 const RenameCompletionCallback& callback) override; |
53 const RenameCompletionCallback& callback) override; | 53 void RenameAndAnnotate(const base::FilePath& full_path, |
54 virtual void RenameAndAnnotate( | 54 const RenameCompletionCallback& callback) override; |
55 const base::FilePath& full_path, | 55 void Detach() override; |
56 const RenameCompletionCallback& callback) override; | 56 void Cancel() override; |
57 virtual void Detach() override; | 57 base::FilePath FullPath() const override; |
58 virtual void Cancel() override; | 58 bool InProgress() const override; |
59 virtual base::FilePath FullPath() const override; | 59 int64 CurrentSpeed() const override; |
60 virtual bool InProgress() const override; | 60 bool GetHash(std::string* hash) override; |
61 virtual int64 CurrentSpeed() const override; | 61 std::string GetHashState() override; |
62 virtual bool GetHash(std::string* hash) override; | 62 void SetClientGuid(const std::string& guid) override; |
63 virtual std::string GetHashState() override; | |
64 virtual void SetClientGuid(const std::string& guid) override; | |
65 | 63 |
66 protected: | 64 protected: |
67 // For test class overrides. | 65 // For test class overrides. |
68 virtual DownloadInterruptReason AppendDataToFile( | 66 virtual DownloadInterruptReason AppendDataToFile( |
69 const char* data, size_t data_len); | 67 const char* data, size_t data_len); |
70 | 68 |
71 virtual base::TimeDelta GetRetryDelayForFailedRename(int attempt_number); | 69 virtual base::TimeDelta GetRetryDelayForFailedRename(int attempt_number); |
72 | 70 |
73 virtual bool ShouldRetryFailedRename(DownloadInterruptReason reason); | 71 virtual bool ShouldRetryFailedRename(DownloadInterruptReason reason); |
74 | 72 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 base::WeakPtr<DownloadDestinationObserver> observer_; | 129 base::WeakPtr<DownloadDestinationObserver> observer_; |
132 | 130 |
133 base::WeakPtrFactory<DownloadFileImpl> weak_factory_; | 131 base::WeakPtrFactory<DownloadFileImpl> weak_factory_; |
134 | 132 |
135 DISALLOW_COPY_AND_ASSIGN(DownloadFileImpl); | 133 DISALLOW_COPY_AND_ASSIGN(DownloadFileImpl); |
136 }; | 134 }; |
137 | 135 |
138 } // namespace content | 136 } // namespace content |
139 | 137 |
140 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_IMPL_H_ | 138 #endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_FILE_IMPL_H_ |
OLD | NEW |