Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: content/public/test/fake_download_item.h

Issue 2880933002: Download driver for components/download. (Closed)
Patch Set: Polish comment. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_PUBLIC_TEST_FAKE_DOWNLOAD_ITEM_H_ 5 #ifndef CONTENT_PUBLIC_TEST_FAKE_DOWNLOAD_ITEM_H_
6 #define CONTENT_PUBLIC_TEST_FAKE_DOWNLOAD_ITEM_H_ 6 #define CONTENT_PUBLIC_TEST_FAKE_DOWNLOAD_ITEM_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 void SetOriginalUrl(const GURL& url); 74 void SetOriginalUrl(const GURL& url);
75 const GURL& GetOriginalUrl() const override; 75 const GURL& GetOriginalUrl() const override;
76 76
77 void SetLastReason(DownloadInterruptReason last_reason); 77 void SetLastReason(DownloadInterruptReason last_reason);
78 DownloadInterruptReason GetLastReason() const override; 78 DownloadInterruptReason GetLastReason() const override;
79 79
80 void SetReceivedBytes(int64_t received_bytes); 80 void SetReceivedBytes(int64_t received_bytes);
81 int64_t GetReceivedBytes() const override; 81 int64_t GetReceivedBytes() const override;
82 82
83 void SetTotalBytes(int64_t total_bytes);
84 int64_t GetTotalBytes() const override;
85
83 void SetLastAccessTime(base::Time time) override; 86 void SetLastAccessTime(base::Time time) override;
84 base::Time GetLastAccessTime() const override; 87 base::Time GetLastAccessTime() const override;
85 88
86 // The methods below are not supported and are not expected to be called. 89 // The methods below are not supported and are not expected to be called.
87 void ValidateDangerousDownload() override; 90 void ValidateDangerousDownload() override;
88 void StealDangerousDownload(bool delete_file_afterward, 91 void StealDangerousDownload(bool delete_file_afterward,
89 const AcquireFileCallback& callback) override; 92 const AcquireFileCallback& callback) override;
90 void Pause() override; 93 void Pause() override;
91 void Resume() override; 94 void Resume() override;
92 void Cancel(bool user_cancel) override; 95 void Cancel(bool user_cancel) override;
(...skipping 22 matching lines...) Expand all
115 base::FilePath GetFileNameToReportUser() const override; 118 base::FilePath GetFileNameToReportUser() const override;
116 TargetDisposition GetTargetDisposition() const override; 119 TargetDisposition GetTargetDisposition() const override;
117 const std::string& GetHash() const override; 120 const std::string& GetHash() const override;
118 void DeleteFile(const base::Callback<void(bool)>& callback) override; 121 void DeleteFile(const base::Callback<void(bool)>& callback) override;
119 bool IsDangerous() const override; 122 bool IsDangerous() const override;
120 DownloadDangerType GetDangerType() const override; 123 DownloadDangerType GetDangerType() const override;
121 bool TimeRemaining(base::TimeDelta* remaining) const override; 124 bool TimeRemaining(base::TimeDelta* remaining) const override;
122 int64_t CurrentSpeed() const override; 125 int64_t CurrentSpeed() const override;
123 int PercentComplete() const override; 126 int PercentComplete() const override;
124 bool AllDataSaved() const override; 127 bool AllDataSaved() const override;
125 int64_t GetTotalBytes() const override;
126 const std::vector<DownloadItem::ReceivedSlice>& GetReceivedSlices() 128 const std::vector<DownloadItem::ReceivedSlice>& GetReceivedSlices()
127 const override; 129 const override;
128 bool CanShowInFolder() override; 130 bool CanShowInFolder() override;
129 bool CanOpenDownload() override; 131 bool CanOpenDownload() override;
130 bool ShouldOpenFileBasedOnExtension() override; 132 bool ShouldOpenFileBasedOnExtension() override;
131 bool GetOpenWhenComplete() const override; 133 bool GetOpenWhenComplete() const override;
132 bool GetAutoOpened() override; 134 bool GetAutoOpened() override;
133 bool GetOpened() const override; 135 bool GetOpened() const override;
134 bool IsTransient() const override; 136 bool IsTransient() const override;
135 BrowserContext* GetBrowserContext() const override; 137 BrowserContext* GetBrowserContext() const override;
(...skipping 17 matching lines...) Expand all
153 base::Time last_access_time_; 155 base::Time last_access_time_;
154 // MAX_DOWNLOAD_STATE is used as the uninitialized state. 156 // MAX_DOWNLOAD_STATE is used as the uninitialized state.
155 DownloadState download_state_ = 157 DownloadState download_state_ =
156 DownloadItem::DownloadState::MAX_DOWNLOAD_STATE; 158 DownloadItem::DownloadState::MAX_DOWNLOAD_STATE;
157 scoped_refptr<const net::HttpResponseHeaders> response_headers_; 159 scoped_refptr<const net::HttpResponseHeaders> response_headers_;
158 std::string mime_type_; 160 std::string mime_type_;
159 GURL original_url_; 161 GURL original_url_;
160 DownloadInterruptReason last_reason_ = 162 DownloadInterruptReason last_reason_ =
161 DownloadInterruptReason::DOWNLOAD_INTERRUPT_REASON_NONE; 163 DownloadInterruptReason::DOWNLOAD_INTERRUPT_REASON_NONE;
162 int64_t received_bytes_ = 0; 164 int64_t received_bytes_ = 0;
165 int64_t total_bytes_ = 0;
163 166
164 // The members below are to be returned by methods, which return by reference. 167 // The members below are to be returned by methods, which return by reference.
165 std::string dummy_string; 168 std::string dummy_string;
166 GURL dummy_url; 169 GURL dummy_url;
167 base::FilePath dummy_file_path; 170 base::FilePath dummy_file_path;
168 171
169 DISALLOW_COPY_AND_ASSIGN(FakeDownloadItem); 172 DISALLOW_COPY_AND_ASSIGN(FakeDownloadItem);
170 }; 173 };
171 174
172 } // namespace content 175 } // namespace content
173 176
174 #endif // CONTENT_PUBLIC_TEST_FAKE_DOWNLOAD_ITEM_H_ 177 #endif // CONTENT_PUBLIC_TEST_FAKE_DOWNLOAD_ITEM_H_
OLDNEW
« no previous file with comments | « content/public/browser/download_url_parameters.h ('k') | content/public/test/fake_download_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698