Jay Srinivasan | 480ddfa | 2012-06-01 19:15:26 -0700 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
Gilad Arnold | cf175a0 | 2014-07-10 16:48:47 -0700 | [diff] [blame] | 5 | #ifndef UPDATE_ENGINE_OMAHA_REQUEST_ACTION_H_ |
| 6 | #define UPDATE_ENGINE_OMAHA_REQUEST_ACTION_H_ |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 7 | |
Alex Vakulenko | 44cab30 | 2014-07-23 13:12:15 -0700 | [diff] [blame] | 8 | #include <fcntl.h> |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 9 | #include <sys/stat.h> |
Andrew de los Reyes | 09e56d6 | 2010-04-23 13:45:53 -0700 | [diff] [blame] | 10 | #include <sys/types.h> |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 11 | |
| 12 | #include <string> |
Jay Srinivasan | 6f6ea00 | 2012-12-14 11:26:28 -0800 | [diff] [blame] | 13 | #include <vector> |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 14 | |
Chris Masone | d903c3b | 2011-05-12 15:35:46 -0700 | [diff] [blame] | 15 | #include <base/memory/scoped_ptr.h> |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 16 | #include <curl/curl.h> |
| 17 | |
Andrew de los Reyes | 09e56d6 | 2010-04-23 13:45:53 -0700 | [diff] [blame] | 18 | #include "update_engine/action.h" |
| 19 | #include "update_engine/http_fetcher.h" |
Jay Srinivasan | 0826288 | 2012-12-28 19:29:43 -0800 | [diff] [blame] | 20 | #include "update_engine/omaha_response.h" |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 21 | |
Darin Petkov | 6a5b322 | 2010-07-13 14:55:28 -0700 | [diff] [blame] | 22 | // The Omaha Request action makes a request to Omaha and can output |
| 23 | // the response on the output ActionPipe. |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 24 | |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 25 | namespace chromeos_update_engine { |
| 26 | |
| 27 | // Encodes XML entities in a given string with libxml2. input must be |
| 28 | // UTF-8 formatted. Output will be UTF-8 formatted. |
| 29 | std::string XmlEncode(const std::string& input); |
| 30 | |
Darin Petkov | 0dc8e9a | 2010-07-14 14:51:57 -0700 | [diff] [blame] | 31 | // This struct encapsulates the Omaha event information. For a |
| 32 | // complete list of defined event types and results, see |
| 33 | // http://code.google.com/p/omaha/wiki/ServerProtocol#event |
| 34 | struct OmahaEvent { |
Jay Srinivasan | 56d5aa4 | 2012-03-26 14:27:59 -0700 | [diff] [blame] | 35 | // The Type values correspond to EVENT_TYPE values of Omaha. |
Darin Petkov | 0dc8e9a | 2010-07-14 14:51:57 -0700 | [diff] [blame] | 36 | enum Type { |
| 37 | kTypeUnknown = 0, |
| 38 | kTypeDownloadComplete = 1, |
| 39 | kTypeInstallComplete = 2, |
| 40 | kTypeUpdateComplete = 3, |
Darin Petkov | 8c2980e | 2010-07-16 15:16:49 -0700 | [diff] [blame] | 41 | kTypeUpdateDownloadStarted = 13, |
| 42 | kTypeUpdateDownloadFinished = 14, |
Darin Petkov | 0dc8e9a | 2010-07-14 14:51:57 -0700 | [diff] [blame] | 43 | }; |
| 44 | |
Jay Srinivasan | 56d5aa4 | 2012-03-26 14:27:59 -0700 | [diff] [blame] | 45 | // The Result values correspond to EVENT_RESULT values of Omaha. |
Darin Petkov | 0dc8e9a | 2010-07-14 14:51:57 -0700 | [diff] [blame] | 46 | enum Result { |
| 47 | kResultError = 0, |
| 48 | kResultSuccess = 1, |
Darin Petkov | 95508da | 2011-01-05 12:42:29 -0800 | [diff] [blame] | 49 | kResultSuccessReboot = 2, |
Alex Vakulenko | d2779df | 2014-06-16 13:19:00 -0700 | [diff] [blame] | 50 | kResultUpdateDeferred = 9, // When we ignore/defer updates due to policy. |
Darin Petkov | 0dc8e9a | 2010-07-14 14:51:57 -0700 | [diff] [blame] | 51 | }; |
| 52 | |
| 53 | OmahaEvent() |
| 54 | : type(kTypeUnknown), |
| 55 | result(kResultError), |
Gilad Arnold | d1c4d2d | 2014-06-05 14:07:53 -0700 | [diff] [blame] | 56 | error_code(ErrorCode::kError) {} |
Darin Petkov | e17f86b | 2010-07-20 09:12:01 -0700 | [diff] [blame] | 57 | explicit OmahaEvent(Type in_type) |
| 58 | : type(in_type), |
| 59 | result(kResultSuccess), |
Gilad Arnold | d1c4d2d | 2014-06-05 14:07:53 -0700 | [diff] [blame] | 60 | error_code(ErrorCode::kSuccess) {} |
David Zeuthen | a99981f | 2013-04-29 13:42:47 -0700 | [diff] [blame] | 61 | OmahaEvent(Type in_type, Result in_result, ErrorCode in_error_code) |
Darin Petkov | 0dc8e9a | 2010-07-14 14:51:57 -0700 | [diff] [blame] | 62 | : type(in_type), |
| 63 | result(in_result), |
| 64 | error_code(in_error_code) {} |
| 65 | |
| 66 | Type type; |
| 67 | Result result; |
David Zeuthen | a99981f | 2013-04-29 13:42:47 -0700 | [diff] [blame] | 68 | ErrorCode error_code; |
Darin Petkov | 0dc8e9a | 2010-07-14 14:51:57 -0700 | [diff] [blame] | 69 | }; |
| 70 | |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 71 | class NoneType; |
Darin Petkov | a4a8a8c | 2010-07-15 22:21:12 -0700 | [diff] [blame] | 72 | class OmahaRequestAction; |
Yunlian Jiang | a178e5e | 2013-04-05 14:41:56 -0700 | [diff] [blame] | 73 | class OmahaRequestParams; |
Darin Petkov | 1cbd78f | 2010-07-29 12:38:34 -0700 | [diff] [blame] | 74 | class PrefsInterface; |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 75 | |
David Zeuthen | e8ed863 | 2014-07-24 13:38:10 -0400 | [diff] [blame] | 76 | // This struct is declared in the .cc file. |
| 77 | struct OmahaParserData; |
| 78 | |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 79 | template<> |
Darin Petkov | 6a5b322 | 2010-07-13 14:55:28 -0700 | [diff] [blame] | 80 | class ActionTraits<OmahaRequestAction> { |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 81 | public: |
Darin Petkov | 0dc8e9a | 2010-07-14 14:51:57 -0700 | [diff] [blame] | 82 | // Takes parameters on the input pipe. |
Darin Petkov | a4a8a8c | 2010-07-15 22:21:12 -0700 | [diff] [blame] | 83 | typedef NoneType InputObjectType; |
Darin Petkov | 0dc8e9a | 2010-07-14 14:51:57 -0700 | [diff] [blame] | 84 | // On UpdateCheck success, puts the Omaha response on output. Event |
| 85 | // requests do not have an output pipe. |
Darin Petkov | 6a5b322 | 2010-07-13 14:55:28 -0700 | [diff] [blame] | 86 | typedef OmahaResponse OutputObjectType; |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 87 | }; |
| 88 | |
Darin Petkov | 6a5b322 | 2010-07-13 14:55:28 -0700 | [diff] [blame] | 89 | class OmahaRequestAction : public Action<OmahaRequestAction>, |
| 90 | public HttpFetcherDelegate { |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 91 | public: |
Darin Petkov | 1cbd78f | 2010-07-29 12:38:34 -0700 | [diff] [blame] | 92 | static const int kNeverPinged = -1; |
| 93 | static const int kPingTimeJump = -2; |
Jay Srinivasan | 2b5a0f0 | 2012-12-19 17:25:56 -0800 | [diff] [blame] | 94 | // We choose this value of 10 as a heuristic for a work day in trying |
| 95 | // each URL, assuming we check roughly every 45 mins. This is a good time to |
| 96 | // wait - neither too long nor too little - so we don't give up the preferred |
| 97 | // URLs that appear earlier in list too quickly before moving on to the |
| 98 | // fallback ones. |
| 99 | static const int kDefaultMaxFailureCountPerUrl = 10; |
Darin Petkov | 1cbd78f | 2010-07-29 12:38:34 -0700 | [diff] [blame] | 100 | |
Jay Srinivasan | 480ddfa | 2012-06-01 19:15:26 -0700 | [diff] [blame] | 101 | // These are the possible outcome upon checking whether we satisfied |
| 102 | // the wall-clock-based-wait. |
| 103 | enum WallClockWaitResult { |
| 104 | kWallClockWaitNotSatisfied, |
| 105 | kWallClockWaitDoneButUpdateCheckWaitRequired, |
| 106 | kWallClockWaitDoneAndUpdateCheckWaitNotRequired, |
| 107 | }; |
| 108 | |
Darin Petkov | 0dc8e9a | 2010-07-14 14:51:57 -0700 | [diff] [blame] | 109 | // The ctor takes in all the parameters that will be used for making |
| 110 | // the request to Omaha. For some of them we have constants that |
| 111 | // should be used. |
| 112 | // |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 113 | // Takes ownership of the passed in HttpFetcher. Useful for testing. |
Darin Petkov | 0dc8e9a | 2010-07-14 14:51:57 -0700 | [diff] [blame] | 114 | // |
| 115 | // Takes ownership of the passed in OmahaEvent. If |event| is NULL, |
| 116 | // this is an UpdateCheck request, otherwise it's an Event request. |
| 117 | // Event requests always succeed. |
| 118 | // |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 119 | // A good calling pattern is: |
Darin Petkov | a4a8a8c | 2010-07-15 22:21:12 -0700 | [diff] [blame] | 120 | // OmahaRequestAction(..., new OmahaEvent(...), new WhateverHttpFetcher); |
Darin Petkov | 0dc8e9a | 2010-07-14 14:51:57 -0700 | [diff] [blame] | 121 | // or |
Darin Petkov | a4a8a8c | 2010-07-15 22:21:12 -0700 | [diff] [blame] | 122 | // OmahaRequestAction(..., NULL, new WhateverHttpFetcher); |
Jay Srinivasan | 6f6ea00 | 2012-12-14 11:26:28 -0800 | [diff] [blame] | 123 | OmahaRequestAction(SystemState* system_state, |
Darin Petkov | a4a8a8c | 2010-07-15 22:21:12 -0700 | [diff] [blame] | 124 | OmahaEvent* event, |
Thieu Le | 116fda3 | 2011-04-19 11:01:54 -0700 | [diff] [blame] | 125 | HttpFetcher* http_fetcher, |
| 126 | bool ping_only); |
Darin Petkov | 6a5b322 | 2010-07-13 14:55:28 -0700 | [diff] [blame] | 127 | virtual ~OmahaRequestAction(); |
| 128 | typedef ActionTraits<OmahaRequestAction>::InputObjectType InputObjectType; |
| 129 | typedef ActionTraits<OmahaRequestAction>::OutputObjectType OutputObjectType; |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 130 | void PerformAction(); |
| 131 | void TerminateProcessing(); |
David Zeuthen | 33bae49 | 2014-02-25 16:16:18 -0800 | [diff] [blame] | 132 | void ActionCompleted(ErrorCode code); |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 133 | |
Darin Petkov | 1023a60 | 2010-08-30 13:47:51 -0700 | [diff] [blame] | 134 | int GetHTTPResponseCode() { return http_fetcher_->http_response_code(); } |
| 135 | |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 136 | // Debugging/logging |
Darin Petkov | 6a5b322 | 2010-07-13 14:55:28 -0700 | [diff] [blame] | 137 | static std::string StaticType() { return "OmahaRequestAction"; } |
adlr@google.com | c98a7ed | 2009-12-04 18:54:03 +0000 | [diff] [blame] | 138 | std::string Type() const { return StaticType(); } |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 139 | |
| 140 | // Delegate methods (see http_fetcher.h) |
| 141 | virtual void ReceivedBytes(HttpFetcher *fetcher, |
| 142 | const char* bytes, int length); |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 143 | |
Jay Srinivasan | 23b92a5 | 2012-10-27 02:00:21 -0700 | [diff] [blame] | 144 | virtual void TransferComplete(HttpFetcher *fetcher, bool successful); |
Darin Petkov | 0dc8e9a | 2010-07-14 14:51:57 -0700 | [diff] [blame] | 145 | // Returns true if this is an Event request, false if it's an UpdateCheck. |
| 146 | bool IsEvent() const { return event_.get() != NULL; } |
| 147 | |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 148 | private: |
David Zeuthen | 639aa36 | 2014-02-03 16:23:44 -0800 | [diff] [blame] | 149 | FRIEND_TEST(OmahaRequestActionTest, GetInstallDate); |
| 150 | |
| 151 | // Enumeration used in PersistInstallDate(). |
| 152 | enum InstallDateProvisioningSource { |
| 153 | kProvisionedFromOmahaResponse, |
| 154 | kProvisionedFromOOBEMarker, |
| 155 | |
| 156 | // kProvisionedMax is the count of the number of enums above. Add |
| 157 | // any new enums above this line only. |
| 158 | kProvisionedMax |
| 159 | }; |
| 160 | |
| 161 | // Gets the install date, expressed as the number of PST8PDT |
| 162 | // calendar weeks since January 1st 2007, times seven. Returns -1 if |
| 163 | // unknown. See http://crbug.com/336838 for details about this value. |
| 164 | static int GetInstallDate(SystemState* system_state); |
| 165 | |
| 166 | // Parses the Omaha Response in |doc| and sets the |
| 167 | // |install_date_days| field of |output_object| to the value of the |
| 168 | // elapsed_days attribute of the daystart element. Returns True if |
| 169 | // the value was set, False if it wasn't found. |
David Zeuthen | e8ed863 | 2014-07-24 13:38:10 -0400 | [diff] [blame] | 170 | static bool ParseInstallDate(OmahaParserData* parser_data, |
David Zeuthen | 639aa36 | 2014-02-03 16:23:44 -0800 | [diff] [blame] | 171 | OmahaResponse* output_object); |
| 172 | |
| 173 | // Returns True if the kPrefsInstallDateDays state variable is set, |
| 174 | // False otherwise. |
| 175 | static bool HasInstallDate(SystemState *system_state); |
| 176 | |
| 177 | // Writes |install_date_days| into the kPrefsInstallDateDays state |
| 178 | // variable and emits an UMA stat for the |source| used. Returns |
| 179 | // True if the value was written, False if an error occurred. |
| 180 | static bool PersistInstallDate(SystemState *system_state, |
| 181 | int install_date_days, |
| 182 | InstallDateProvisioningSource source); |
| 183 | |
Darin Petkov | 1cbd78f | 2010-07-29 12:38:34 -0700 | [diff] [blame] | 184 | // If this is an update check request, initializes |
| 185 | // |ping_active_days_| and |ping_roll_call_days_| to values that may |
| 186 | // be sent as pings to Omaha. |
| 187 | void InitPingDays(); |
| 188 | |
Darin Petkov | 84c763c | 2010-07-29 16:27:58 -0700 | [diff] [blame] | 189 | // Based on the persistent preference store values, calculates the |
Darin Petkov | 1cbd78f | 2010-07-29 12:38:34 -0700 | [diff] [blame] | 190 | // number of days since the last ping sent for |key|. |
| 191 | int CalculatePingDays(const std::string& key); |
| 192 | |
Jay Srinivasan | 480ddfa | 2012-06-01 19:15:26 -0700 | [diff] [blame] | 193 | // Returns true if the download of a new update should be deferred. |
| 194 | // False if the update can be downloaded. |
Jay Srinivasan | 23b92a5 | 2012-10-27 02:00:21 -0700 | [diff] [blame] | 195 | bool ShouldDeferDownload(OmahaResponse* output_object); |
Jay Srinivasan | 480ddfa | 2012-06-01 19:15:26 -0700 | [diff] [blame] | 196 | |
| 197 | // Returns true if the basic wall-clock-based waiting period has been |
| 198 | // satisfied based on the scattering policy setting. False otherwise. |
| 199 | // If true, it also indicates whether the additional update-check-count-based |
| 200 | // waiting period also needs to be satisfied before the download can begin. |
| 201 | WallClockWaitResult IsWallClockBasedWaitingSatisfied( |
Jay Srinivasan | 23b92a5 | 2012-10-27 02:00:21 -0700 | [diff] [blame] | 202 | OmahaResponse* output_object); |
Jay Srinivasan | 480ddfa | 2012-06-01 19:15:26 -0700 | [diff] [blame] | 203 | |
| 204 | // Returns true if the update-check-count-based waiting period has been |
| 205 | // satisfied. False otherwise. |
Jay Srinivasan | 23b92a5 | 2012-10-27 02:00:21 -0700 | [diff] [blame] | 206 | bool IsUpdateCheckCountBasedWaitingSatisfied(); |
| 207 | |
| 208 | // Parses the response from Omaha that's available in |doc| using the other |
| 209 | // helper methods below and populates the |output_object| with the relevant |
| 210 | // values. Returns true if we should continue the parsing. False otherwise, |
| 211 | // in which case it sets any error code using |completer|. |
David Zeuthen | e8ed863 | 2014-07-24 13:38:10 -0400 | [diff] [blame] | 212 | bool ParseResponse(OmahaParserData* parser_data, |
Jay Srinivasan | 23b92a5 | 2012-10-27 02:00:21 -0700 | [diff] [blame] | 213 | OmahaResponse* output_object, |
| 214 | ScopedActionCompleter* completer); |
| 215 | |
| 216 | // Parses the status property in the given update_check_node and populates |
| 217 | // |output_object| if valid. Returns true if we should continue the parsing. |
| 218 | // False otherwise, in which case it sets any error code using |completer|. |
David Zeuthen | e8ed863 | 2014-07-24 13:38:10 -0400 | [diff] [blame] | 219 | bool ParseStatus(OmahaParserData* parser_data, |
Jay Srinivasan | 23b92a5 | 2012-10-27 02:00:21 -0700 | [diff] [blame] | 220 | OmahaResponse* output_object, |
| 221 | ScopedActionCompleter* completer); |
| 222 | |
| 223 | // Parses the URL nodes in the given XML document and populates |
| 224 | // |output_object| if valid. Returns true if we should continue the parsing. |
| 225 | // False otherwise, in which case it sets any error code using |completer|. |
David Zeuthen | e8ed863 | 2014-07-24 13:38:10 -0400 | [diff] [blame] | 226 | bool ParseUrls(OmahaParserData* parser_data, |
Jay Srinivasan | 23b92a5 | 2012-10-27 02:00:21 -0700 | [diff] [blame] | 227 | OmahaResponse* output_object, |
| 228 | ScopedActionCompleter* completer); |
| 229 | |
| 230 | // Parses the package node in the given XML document and populates |
| 231 | // |output_object| if valid. Returns true if we should continue the parsing. |
| 232 | // False otherwise, in which case it sets any error code using |completer|. |
David Zeuthen | e8ed863 | 2014-07-24 13:38:10 -0400 | [diff] [blame] | 233 | bool ParsePackage(OmahaParserData* parser_data, |
Jay Srinivasan | 23b92a5 | 2012-10-27 02:00:21 -0700 | [diff] [blame] | 234 | OmahaResponse* output_object, |
| 235 | ScopedActionCompleter* completer); |
| 236 | |
| 237 | // Parses the other parameters in the given XML document and populates |
| 238 | // |output_object| if valid. Returns true if we should continue the parsing. |
| 239 | // False otherwise, in which case it sets any error code using |completer|. |
David Zeuthen | e8ed863 | 2014-07-24 13:38:10 -0400 | [diff] [blame] | 240 | bool ParseParams(OmahaParserData* parser_data, |
Jay Srinivasan | 23b92a5 | 2012-10-27 02:00:21 -0700 | [diff] [blame] | 241 | OmahaResponse* output_object, |
| 242 | ScopedActionCompleter* completer); |
Jay Srinivasan | 480ddfa | 2012-06-01 19:15:26 -0700 | [diff] [blame] | 243 | |
David Zeuthen | 8f191b2 | 2013-08-06 12:27:50 -0700 | [diff] [blame] | 244 | // Called by TransferComplete() to complete processing, either |
| 245 | // asynchronously after looking up resources via p2p or directly. |
| 246 | void CompleteProcessing(); |
| 247 | |
| 248 | // Helper to asynchronously look up payload on the LAN. |
| 249 | void LookupPayloadViaP2P(const OmahaResponse& response); |
| 250 | |
| 251 | // Callback used by LookupPayloadViaP2P(). |
| 252 | void OnLookupPayloadViaP2PCompleted(const std::string& url); |
| 253 | |
Chris Sosa | 77f79e8 | 2014-06-02 18:16:24 -0700 | [diff] [blame] | 254 | // Returns true if the current update should be ignored. |
| 255 | bool ShouldIgnoreUpdate(const OmahaResponse& response) const; |
| 256 | |
| 257 | // Returns true if updates are allowed over the current type of connection. |
| 258 | // False otherwise. |
| 259 | bool IsUpdateAllowedOverCurrentConnection() const; |
| 260 | |
Jay Srinivasan | 6f6ea00 | 2012-12-14 11:26:28 -0800 | [diff] [blame] | 261 | // Global system context. |
| 262 | SystemState* system_state_; |
Darin Petkov | 1cbd78f | 2010-07-29 12:38:34 -0700 | [diff] [blame] | 263 | |
Jay Srinivasan | 480ddfa | 2012-06-01 19:15:26 -0700 | [diff] [blame] | 264 | // Contains state that is relevant in the processing of the Omaha request. |
| 265 | OmahaRequestParams* params_; |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 266 | |
Darin Petkov | 0dc8e9a | 2010-07-14 14:51:57 -0700 | [diff] [blame] | 267 | // Pointer to the OmahaEvent info. This is an UpdateCheck request if NULL. |
| 268 | scoped_ptr<OmahaEvent> event_; |
| 269 | |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 270 | // pointer to the HttpFetcher that does the http work |
| 271 | scoped_ptr<HttpFetcher> http_fetcher_; |
| 272 | |
Thieu Le | 116fda3 | 2011-04-19 11:01:54 -0700 | [diff] [blame] | 273 | // If true, only include the <ping> element in the request. |
| 274 | bool ping_only_; |
| 275 | |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 276 | // Stores the response from the omaha server |
| 277 | std::vector<char> response_buffer_; |
| 278 | |
Darin Petkov | 1cbd78f | 2010-07-29 12:38:34 -0700 | [diff] [blame] | 279 | // Initialized by InitPingDays to values that may be sent to Omaha |
| 280 | // as part of a ping message. Note that only positive values and -1 |
| 281 | // are sent to Omaha. |
| 282 | int ping_active_days_; |
| 283 | int ping_roll_call_days_; |
| 284 | |
Darin Petkov | 6a5b322 | 2010-07-13 14:55:28 -0700 | [diff] [blame] | 285 | DISALLOW_COPY_AND_ASSIGN(OmahaRequestAction); |
rspangler@google.com | 49fdf18 | 2009-10-10 00:57:34 +0000 | [diff] [blame] | 286 | }; |
| 287 | |
| 288 | } // namespace chromeos_update_engine |
| 289 | |
Gilad Arnold | cf175a0 | 2014-07-10 16:48:47 -0700 | [diff] [blame] | 290 | #endif // UPDATE_ENGINE_OMAHA_REQUEST_ACTION_H_ |