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_OMAHA_REQUEST_ACTION_H__ | 5 #ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_OMAHA_REQUEST_ACTION_H__ |
6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_OMAHA_REQUEST_ACTION_H__ | 6 #define CHROMEOS_PLATFORM_UPDATE_ENGINE_OMAHA_REQUEST_ACTION_H__ |
7 | 7 |
8 #include <sys/stat.h> | 8 #include <sys/stat.h> |
9 #include <sys/types.h> | 9 #include <sys/types.h> |
10 #include <fcntl.h> | 10 #include <fcntl.h> |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 }; | 60 }; |
61 | 61 |
62 enum Result { | 62 enum Result { |
63 kResultError = 0, | 63 kResultError = 0, |
64 kResultSuccess = 1, | 64 kResultSuccess = 1, |
65 }; | 65 }; |
66 | 66 |
67 OmahaEvent() | 67 OmahaEvent() |
68 : type(kTypeUnknown), | 68 : type(kTypeUnknown), |
69 result(kResultError), | 69 result(kResultError), |
70 error_code(0) {} | 70 error_code(kActionCodeError) {} |
71 OmahaEvent(Type in_type, Result in_result, int in_error_code) | 71 explicit OmahaEvent(Type in_type) |
| 72 : type(in_type), |
| 73 result(kResultSuccess), |
| 74 error_code(kActionCodeSuccess) {} |
| 75 OmahaEvent(Type in_type, Result in_result, ActionExitCode in_error_code) |
72 : type(in_type), | 76 : type(in_type), |
73 result(in_result), | 77 result(in_result), |
74 error_code(in_error_code) {} | 78 error_code(in_error_code) {} |
75 | 79 |
76 Type type; | 80 Type type; |
77 Result result; | 81 Result result; |
78 int error_code; | 82 ActionExitCode error_code; |
79 }; | 83 }; |
80 | 84 |
81 class NoneType; | 85 class NoneType; |
82 class OmahaRequestAction; | 86 class OmahaRequestAction; |
83 struct OmahaRequestParams; | 87 struct OmahaRequestParams; |
84 | 88 |
85 template<> | 89 template<> |
86 class ActionTraits<OmahaRequestAction> { | 90 class ActionTraits<OmahaRequestAction> { |
87 public: | 91 public: |
88 // Takes parameters on the input pipe. | 92 // Takes parameters on the input pipe. |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 | 146 |
143 // Stores the response from the omaha server | 147 // Stores the response from the omaha server |
144 std::vector<char> response_buffer_; | 148 std::vector<char> response_buffer_; |
145 | 149 |
146 DISALLOW_COPY_AND_ASSIGN(OmahaRequestAction); | 150 DISALLOW_COPY_AND_ASSIGN(OmahaRequestAction); |
147 }; | 151 }; |
148 | 152 |
149 } // namespace chromeos_update_engine | 153 } // namespace chromeos_update_engine |
150 | 154 |
151 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_OMAHA_REQUEST_ACTION_H__ | 155 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_OMAHA_REQUEST_ACTION_H__ |
OLD | NEW |