OLD | NEW |
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_OMAHA_RESQUEST_PREP_ACTION_H__ | 5 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_OMAHA_RESQUEST_PREP_ACTION_H__ |
6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_OMAHA_RESQUEST_PREP_ACTION_H__ | 6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_OMAHA_RESQUEST_PREP_ACTION_H__ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include "update_engine/action.h" | 9 #include "update_engine/action.h" |
10 #include "update_engine/update_check_action.h" | 10 #include "update_engine/update_check_action.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 static std::string StaticType() { return "OmahaRequestPrepAction"; } | 42 static std::string StaticType() { return "OmahaRequestPrepAction"; } |
43 std::string Type() const { return StaticType(); } | 43 std::string Type() const { return StaticType(); } |
44 | 44 |
45 // For unit-tests. | 45 // For unit-tests. |
46 void set_root(const std::string& root) { | 46 void set_root(const std::string& root) { |
47 root_ = root; | 47 root_ = root; |
48 } | 48 } |
49 | 49 |
50 private: | 50 private: |
51 // Gets a machine-local ID (for now, first MAC address we find) | 51 // Gets a machine-local ID (for now, first MAC address we find) |
52 std::string GetMachineId() const; | 52 bool GetMachineId(std::string* out_id) const; |
53 | 53 |
54 // Fetches the value for a given key from | 54 // Fetches the value for a given key from |
55 // /mnt/stateful_partition/etc/lsb-release if possible. Failing that, | 55 // /mnt/stateful_partition/etc/lsb-release if possible. Failing that, |
56 // it looks for the key in /etc/lsb-release . | 56 // it looks for the key in /etc/lsb-release . |
57 std::string GetLsbValue(const std::string& key) const; | 57 std::string GetLsbValue(const std::string& key) const; |
58 | 58 |
59 // Gets the machine type (e.g. "i686") | 59 // Gets the machine type (e.g. "i686") |
60 std::string GetMachineType() const; | 60 std::string GetMachineType() const; |
61 | 61 |
62 // Set to true if this should set up the Update Check Action to do | 62 // Set to true if this should set up the Update Check Action to do |
63 // a full update | 63 // a full update |
64 bool force_full_update_; | 64 bool force_full_update_; |
65 | 65 |
66 // When reading files, prepend root_ to the paths. Useful for testing. | 66 // When reading files, prepend root_ to the paths. Useful for testing. |
67 std::string root_; | 67 std::string root_; |
68 | 68 |
69 DISALLOW_COPY_AND_ASSIGN(OmahaRequestPrepAction); | 69 DISALLOW_COPY_AND_ASSIGN(OmahaRequestPrepAction); |
70 }; | 70 }; |
71 | 71 |
72 } // namespace chromeos_update_engine | 72 } // namespace chromeos_update_engine |
73 | 73 |
74 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_OMAHA_RESQUEST_PREP_ACTION_H__ | 74 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_OMAHA_RESQUEST_PREP_ACTION_H__ |
OLD | NEW |