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

Side by Side Diff: src/platform/update_engine/install_plan.h

Issue 2037002: AU: DBus support. (Closed) Base URL: ssh://git@chromiumos-git/chromeos
Patch Set: fixes for review Created 10 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 (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 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 "chromeos/obsolete_logging.h" 9 #include "chromeos/obsolete_logging.h"
10 10
11 // InstallPlan is a simple struct that contains relevant info for many 11 // InstallPlan is a simple struct that contains relevant info for many
12 // parts of the update system about the install that should happen. 12 // parts of the update system about the install that should happen.
13 13
14 namespace chromeos_update_engine { 14 namespace chromeos_update_engine {
15 15
16 struct InstallPlan { 16 struct InstallPlan {
17 InstallPlan(bool is_full, 17 InstallPlan(bool is_full,
18 const std::string& url, 18 const std::string& url,
19 uint64_t size,
19 const std::string& hash, 20 const std::string& hash,
20 const std::string& install_path, 21 const std::string& install_path,
21 const std::string& kernel_install_path) 22 const std::string& kernel_install_path)
22 : is_full_update(is_full), 23 : is_full_update(is_full),
23 download_url(url), 24 download_url(url),
25 size(size),
24 download_hash(hash), 26 download_hash(hash),
25 install_path(install_path), 27 install_path(install_path),
26 kernel_install_path(kernel_install_path) {} 28 kernel_install_path(kernel_install_path) {}
27 InstallPlan() : is_full_update(false) {} 29 InstallPlan() : is_full_update(false) {}
28 30
29 bool is_full_update; 31 bool is_full_update;
30 std::string download_url; // url to download from 32 std::string download_url; // url to download from
33 uint64_t size; // size of the download url's data
31 std::string download_hash; // hash of the data at the url 34 std::string download_hash; // hash of the data at the url
32 std::string install_path; // path to install device 35 std::string install_path; // path to install device
33 std::string kernel_install_path; // path to kernel install device 36 std::string kernel_install_path; // path to kernel install device
34 37
35 bool operator==(const InstallPlan& that) const { 38 bool operator==(const InstallPlan& that) const {
36 return (is_full_update == that.is_full_update) && 39 return (is_full_update == that.is_full_update) &&
37 (download_url == that.download_url) && 40 (download_url == that.download_url) &&
41 (size == that.size) &&
38 (download_hash == that.download_hash) && 42 (download_hash == that.download_hash) &&
39 (install_path == that.install_path) && 43 (install_path == that.install_path) &&
40 (kernel_install_path == that.kernel_install_path); 44 (kernel_install_path == that.kernel_install_path);
41 } 45 }
42 bool operator!=(const InstallPlan& that) const { 46 bool operator!=(const InstallPlan& that) const {
43 return !((*this) == that); 47 return !((*this) == that);
44 } 48 }
45 void Dump() const { 49 void Dump() const {
46 LOG(INFO) << "InstallPlan: " 50 LOG(INFO) << "InstallPlan: "
47 << (is_full_update ? "full_update" : "delta_update") 51 << (is_full_update ? "full_update" : "delta_update")
48 << ", url: " << download_url << ", hash: " << download_hash 52 << ", url: " << download_url
53 << ", size: " << size
54 << ", hash: " << download_hash
49 << ", install_path: " << install_path 55 << ", install_path: " << install_path
50 << ", kernel_install_path: " << kernel_install_path; 56 << ", kernel_install_path: " << kernel_install_path;
51 } 57 }
52 }; 58 };
53 59
54 } // namespace chromeos_update_engine 60 } // namespace chromeos_update_engine
55 61
56 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_INSTALL_PLAN_H__ 62 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_INSTALL_PLAN_H__
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698