| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 80 |
| 81 // Debugging/logging | 81 // Debugging/logging |
| 82 static std::string StaticType() { return "DownloadAction"; } | 82 static std::string StaticType() { return "DownloadAction"; } |
| 83 std::string Type() const { return StaticType(); } | 83 std::string Type() const { return StaticType(); } |
| 84 | 84 |
| 85 // HttpFetcherDelegate methods (see http_fetcher.h) | 85 // HttpFetcherDelegate methods (see http_fetcher.h) |
| 86 virtual void ReceivedBytes(HttpFetcher *fetcher, | 86 virtual void ReceivedBytes(HttpFetcher *fetcher, |
| 87 const char* bytes, int length); | 87 const char* bytes, int length); |
| 88 virtual void TransferComplete(HttpFetcher *fetcher, bool successful); | 88 virtual void TransferComplete(HttpFetcher *fetcher, bool successful); |
| 89 | 89 |
| 90 DownloadActionDelegate* delegate() const { return delegate_; } |
| 90 void set_delegate(DownloadActionDelegate* delegate) { | 91 void set_delegate(DownloadActionDelegate* delegate) { |
| 91 delegate_ = delegate; | 92 delegate_ = delegate; |
| 92 } | 93 } |
| 93 | 94 |
| 94 private: | 95 private: |
| 95 // The InstallPlan passed in | 96 // The InstallPlan passed in |
| 96 InstallPlan install_plan_; | 97 InstallPlan install_plan_; |
| 97 | 98 |
| 98 // The FileWriter that downloaded data should be written to. It will | 99 // The FileWriter that downloaded data should be written to. It will |
| 99 // either point to *decompressing_file_writer_ or *delta_performer_. | 100 // either point to *decompressing_file_writer_ or *delta_performer_. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 121 DISALLOW_COPY_AND_ASSIGN(DownloadAction); | 122 DISALLOW_COPY_AND_ASSIGN(DownloadAction); |
| 122 }; | 123 }; |
| 123 | 124 |
| 124 // We want to be sure that we're compiled with large file support on linux, | 125 // We want to be sure that we're compiled with large file support on linux, |
| 125 // just in case we find ourselves downloading large images. | 126 // just in case we find ourselves downloading large images. |
| 126 COMPILE_ASSERT(8 == sizeof(off_t), off_t_not_64_bit); | 127 COMPILE_ASSERT(8 == sizeof(off_t), off_t_not_64_bit); |
| 127 | 128 |
| 128 } // namespace chromeos_update_engine | 129 } // namespace chromeos_update_engine |
| 129 | 130 |
| 130 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_DOWNLOAD_ACTION_H__ | 131 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_DOWNLOAD_ACTION_H__ |
| OLD | NEW |