OLD | NEW |
1 // Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium OS 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 CHROMEOS_PLATFORM_UPDATE_ENGINE_DOWNLOAD_ACTION_H__ | 5 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_DOWNLOAD_ACTION_H__ |
6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_DOWNLOAD_ACTION_H__ | 6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_DOWNLOAD_ACTION_H__ |
7 | 7 |
8 #include <sys/types.h> | 8 #include <sys/types.h> |
9 #include <sys/stat.h> | 9 #include <sys/stat.h> |
10 #include <fcntl.h> | 10 #include <fcntl.h> |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 | 79 |
80 int GetHTTPResponseCode() { return http_fetcher_->http_response_code(); } | 80 int GetHTTPResponseCode() { return http_fetcher_->http_response_code(); } |
81 | 81 |
82 // Debugging/logging | 82 // Debugging/logging |
83 static std::string StaticType() { return "DownloadAction"; } | 83 static std::string StaticType() { return "DownloadAction"; } |
84 std::string Type() const { return StaticType(); } | 84 std::string Type() const { return StaticType(); } |
85 | 85 |
86 // HttpFetcherDelegate methods (see http_fetcher.h) | 86 // HttpFetcherDelegate methods (see http_fetcher.h) |
87 virtual void ReceivedBytes(HttpFetcher *fetcher, | 87 virtual void ReceivedBytes(HttpFetcher *fetcher, |
88 const char* bytes, int length); | 88 const char* bytes, int length); |
| 89 virtual void SeekToOffset(off_t offset); |
89 virtual void TransferComplete(HttpFetcher *fetcher, bool successful); | 90 virtual void TransferComplete(HttpFetcher *fetcher, bool successful); |
90 | 91 |
91 DownloadActionDelegate* delegate() const { return delegate_; } | 92 DownloadActionDelegate* delegate() const { return delegate_; } |
92 void set_delegate(DownloadActionDelegate* delegate) { | 93 void set_delegate(DownloadActionDelegate* delegate) { |
93 delegate_ = delegate; | 94 delegate_ = delegate; |
94 } | 95 } |
95 | 96 |
96 HttpFetcher* http_fetcher() { return http_fetcher_.get(); } | 97 HttpFetcher* http_fetcher() { return http_fetcher_.get(); } |
97 | 98 |
98 private: | 99 private: |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 DISALLOW_COPY_AND_ASSIGN(DownloadAction); | 131 DISALLOW_COPY_AND_ASSIGN(DownloadAction); |
131 }; | 132 }; |
132 | 133 |
133 // We want to be sure that we're compiled with large file support on linux, | 134 // We want to be sure that we're compiled with large file support on linux, |
134 // just in case we find ourselves downloading large images. | 135 // just in case we find ourselves downloading large images. |
135 COMPILE_ASSERT(8 == sizeof(off_t), off_t_not_64_bit); | 136 COMPILE_ASSERT(8 == sizeof(off_t), off_t_not_64_bit); |
136 | 137 |
137 } // namespace chromeos_update_engine | 138 } // namespace chromeos_update_engine |
138 | 139 |
139 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_DOWNLOAD_ACTION_H__ | 140 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_DOWNLOAD_ACTION_H__ |
OLD | NEW |