| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 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_INSTALL_PLAN_H__ | 5 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_INSTALL_PLAN_H__ |
| 6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_INSTALL_PLAN_H__ | 6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_INSTALL_PLAN_H__ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> |
| 10 |
| 9 #include "base/logging.h" | 11 #include "base/logging.h" |
| 10 | 12 |
| 11 // InstallPlan is a simple struct that contains relevant info for many | 13 // InstallPlan is a simple struct that contains relevant info for many |
| 12 // parts of the update system about the install that should happen. | 14 // parts of the update system about the install that should happen. |
| 13 | 15 |
| 14 namespace chromeos_update_engine { | 16 namespace chromeos_update_engine { |
| 15 | 17 |
| 16 struct InstallPlan { | 18 struct InstallPlan { |
| 17 InstallPlan(bool is_full, | 19 InstallPlan(bool is_full, |
| 18 bool is_resume, | 20 bool is_resume, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 30 kernel_install_path(kernel_install_path) {} | 32 kernel_install_path(kernel_install_path) {} |
| 31 InstallPlan() : is_full_update(false), is_resume(false), size(0) {} | 33 InstallPlan() : is_full_update(false), is_resume(false), size(0) {} |
| 32 | 34 |
| 33 bool is_full_update; | 35 bool is_full_update; |
| 34 bool is_resume; | 36 bool is_resume; |
| 35 std::string download_url; // url to download from | 37 std::string download_url; // url to download from |
| 36 uint64_t size; // size of the download url's data | 38 uint64_t size; // size of the download url's data |
| 37 std::string download_hash; // hash of the data at the url | 39 std::string download_hash; // hash of the data at the url |
| 38 std::string install_path; // path to install device | 40 std::string install_path; // path to install device |
| 39 std::string kernel_install_path; // path to kernel install device | 41 std::string kernel_install_path; // path to kernel install device |
| 42 std::vector<char> current_kernel_hash; // computed by FileSystemCopierAction |
| 43 std::vector<char> current_rootfs_hash; // computed by FileSystemCopierAction |
| 40 | 44 |
| 41 bool operator==(const InstallPlan& that) const { | 45 bool operator==(const InstallPlan& that) const { |
| 42 return (is_full_update == that.is_full_update) && | 46 return (is_full_update == that.is_full_update) && |
| 43 (is_resume == that.is_resume) && | 47 (is_resume == that.is_resume) && |
| 44 (download_url == that.download_url) && | 48 (download_url == that.download_url) && |
| 45 (size == that.size) && | 49 (size == that.size) && |
| 46 (download_hash == that.download_hash) && | 50 (download_hash == that.download_hash) && |
| 47 (install_path == that.install_path) && | 51 (install_path == that.install_path) && |
| 48 (kernel_install_path == that.kernel_install_path); | 52 (kernel_install_path == that.kernel_install_path); |
| 49 } | 53 } |
| 50 bool operator!=(const InstallPlan& that) const { | 54 bool operator!=(const InstallPlan& that) const { |
| 51 return !((*this) == that); | 55 return !((*this) == that); |
| 52 } | 56 } |
| 53 void Dump() const { | 57 void Dump() const { |
| 54 LOG(INFO) << "InstallPlan: " | 58 LOG(INFO) << "InstallPlan: " |
| 55 << (is_full_update ? "full_update" : "delta_update") | 59 << (is_full_update ? "full_update" : "delta_update") |
| 56 << (is_resume ? ", resume" : ", new_update") | 60 << (is_resume ? ", resume" : ", new_update") |
| 57 << ", url: " << download_url | 61 << ", url: " << download_url |
| 58 << ", size: " << size | 62 << ", size: " << size |
| 59 << ", hash: " << download_hash | 63 << ", hash: " << download_hash |
| 60 << ", install_path: " << install_path | 64 << ", install_path: " << install_path |
| 61 << ", kernel_install_path: " << kernel_install_path; | 65 << ", kernel_install_path: " << kernel_install_path; |
| 62 } | 66 } |
| 63 }; | 67 }; |
| 64 | 68 |
| 65 } // namespace chromeos_update_engine | 69 } // namespace chromeos_update_engine |
| 66 | 70 |
| 67 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_INSTALL_PLAN_H__ | 71 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_INSTALL_PLAN_H__ |
| OLD | NEW |