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

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

Issue 2767373002: Implement GetJobResponse and merge JobData into DataManager. (Closed)
Patch Set: Removed typedef and added DISALLOW_COPY_AND_ASSIGN Created 3 years, 8 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 62
63 void SetMimeType(const std::string& mime_type); 63 void SetMimeType(const std::string& mime_type);
64 std::string GetMimeType() const override; 64 std::string GetMimeType() const override;
65 65
66 void SetOriginalUrl(const GURL& url); 66 void SetOriginalUrl(const GURL& url);
67 const GURL& GetOriginalUrl() const override; 67 const GURL& GetOriginalUrl() const override;
68 68
69 void SetLastReason(DownloadInterruptReason last_reason); 69 void SetLastReason(DownloadInterruptReason last_reason);
70 DownloadInterruptReason GetLastReason() const override; 70 DownloadInterruptReason GetLastReason() const override;
71 71
72 void SetReceivedBytes(int64_t received_bytes);
73 int64_t GetReceivedBytes() const override;
74
72 // The methods below are not supported and are not expected to be called. 75 // The methods below are not supported and are not expected to be called.
73 void ValidateDangerousDownload() override; 76 void ValidateDangerousDownload() override;
74 void StealDangerousDownload(bool delete_file_afterward, 77 void StealDangerousDownload(bool delete_file_afterward,
75 const AcquireFileCallback& callback) override; 78 const AcquireFileCallback& callback) override;
76 void Pause() override; 79 void Pause() override;
77 void Resume() override; 80 void Resume() override;
78 void Cancel(bool user_cancel) override; 81 void Cancel(bool user_cancel) override;
79 void Remove() override; 82 void Remove() override;
80 void OpenDownload() override; 83 void OpenDownload() override;
81 void ShowDownloadInShell() override; 84 void ShowDownloadInShell() override;
(...skipping 21 matching lines...) Expand all
103 TargetDisposition GetTargetDisposition() const override; 106 TargetDisposition GetTargetDisposition() const override;
104 const std::string& GetHash() const override; 107 const std::string& GetHash() const override;
105 void DeleteFile(const base::Callback<void(bool)>& callback) override; 108 void DeleteFile(const base::Callback<void(bool)>& callback) override;
106 bool IsDangerous() const override; 109 bool IsDangerous() const override;
107 DownloadDangerType GetDangerType() const override; 110 DownloadDangerType GetDangerType() const override;
108 bool TimeRemaining(base::TimeDelta* remaining) const override; 111 bool TimeRemaining(base::TimeDelta* remaining) const override;
109 int64_t CurrentSpeed() const override; 112 int64_t CurrentSpeed() const override;
110 int PercentComplete() const override; 113 int PercentComplete() const override;
111 bool AllDataSaved() const override; 114 bool AllDataSaved() const override;
112 int64_t GetTotalBytes() const override; 115 int64_t GetTotalBytes() const override;
113 int64_t GetReceivedBytes() const override;
114 const std::vector<DownloadItem::ReceivedSlice>& GetReceivedSlices() 116 const std::vector<DownloadItem::ReceivedSlice>& GetReceivedSlices()
115 const override; 117 const override;
116 bool CanShowInFolder() override; 118 bool CanShowInFolder() override;
117 bool CanOpenDownload() override; 119 bool CanOpenDownload() override;
118 bool ShouldOpenFileBasedOnExtension() override; 120 bool ShouldOpenFileBasedOnExtension() override;
119 bool GetOpenWhenComplete() const override; 121 bool GetOpenWhenComplete() const override;
120 bool GetAutoOpened() override; 122 bool GetAutoOpened() override;
121 bool GetOpened() const override; 123 bool GetOpened() const override;
122 base::Time GetLastAccessTime() const override; 124 base::Time GetLastAccessTime() const override;
123 BrowserContext* GetBrowserContext() const override; 125 BrowserContext* GetBrowserContext() const override;
(...skipping 14 matching lines...) Expand all
138 bool is_file_externally_removed_ = false; 140 bool is_file_externally_removed_ = false;
139 base::Time start_time_; 141 base::Time start_time_;
140 base::Time end_time_; 142 base::Time end_time_;
141 // MAX_DOWNLOAD_STATE is used as the uninitialized state. 143 // MAX_DOWNLOAD_STATE is used as the uninitialized state.
142 DownloadState download_state_ = 144 DownloadState download_state_ =
143 DownloadItem::DownloadState::MAX_DOWNLOAD_STATE; 145 DownloadItem::DownloadState::MAX_DOWNLOAD_STATE;
144 std::string mime_type_; 146 std::string mime_type_;
145 GURL original_url_; 147 GURL original_url_;
146 DownloadInterruptReason last_reason_ = 148 DownloadInterruptReason last_reason_ =
147 DownloadInterruptReason::DOWNLOAD_INTERRUPT_REASON_NONE; 149 DownloadInterruptReason::DOWNLOAD_INTERRUPT_REASON_NONE;
150 int64_t received_bytes_ = 0;
148 151
149 // The members below are to be returned by methods, which return by reference. 152 // The members below are to be returned by methods, which return by reference.
150 std::string dummy_string; 153 std::string dummy_string;
151 std::vector<GURL> dummy_url_vector; 154 std::vector<GURL> dummy_url_vector;
152 GURL dummy_url; 155 GURL dummy_url;
153 base::FilePath dummy_file_path; 156 base::FilePath dummy_file_path;
154 157
155 DISALLOW_COPY_AND_ASSIGN(FakeDownloadItem); 158 DISALLOW_COPY_AND_ASSIGN(FakeDownloadItem);
156 }; 159 };
157 160
158 } // namespace content 161 } // namespace content
159 162
160 #endif // CONTENT_PUBLIC_TEST_FAKE_DOWNLOAD_ITEM_H_ 163 #endif // CONTENT_PUBLIC_TEST_FAKE_DOWNLOAD_ITEM_H_
OLDNEW
« no previous file with comments | « content/browser/background_fetch/background_fetch_request_info.cc ('k') | content/public/test/fake_download_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698