| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 // this is an UpdateCheck request, otherwise it's an Event request. | 122 // this is an UpdateCheck request, otherwise it's an Event request. |
| 123 // Event requests always succeed. | 123 // Event requests always succeed. |
| 124 // | 124 // |
| 125 // A good calling pattern is: | 125 // A good calling pattern is: |
| 126 // OmahaRequestAction(..., new OmahaEvent(...), new WhateverHttpFetcher); | 126 // OmahaRequestAction(..., new OmahaEvent(...), new WhateverHttpFetcher); |
| 127 // or | 127 // or |
| 128 // OmahaRequestAction(..., NULL, new WhateverHttpFetcher); | 128 // OmahaRequestAction(..., NULL, new WhateverHttpFetcher); |
| 129 OmahaRequestAction(PrefsInterface* prefs, | 129 OmahaRequestAction(PrefsInterface* prefs, |
| 130 const OmahaRequestParams& params, | 130 const OmahaRequestParams& params, |
| 131 OmahaEvent* event, | 131 OmahaEvent* event, |
| 132 HttpFetcher* http_fetcher); | 132 HttpFetcher* http_fetcher, |
| 133 bool ping_only); |
| 133 virtual ~OmahaRequestAction(); | 134 virtual ~OmahaRequestAction(); |
| 134 typedef ActionTraits<OmahaRequestAction>::InputObjectType InputObjectType; | 135 typedef ActionTraits<OmahaRequestAction>::InputObjectType InputObjectType; |
| 135 typedef ActionTraits<OmahaRequestAction>::OutputObjectType OutputObjectType; | 136 typedef ActionTraits<OmahaRequestAction>::OutputObjectType OutputObjectType; |
| 136 void PerformAction(); | 137 void PerformAction(); |
| 137 void TerminateProcessing(); | 138 void TerminateProcessing(); |
| 138 | 139 |
| 139 int GetHTTPResponseCode() { return http_fetcher_->http_response_code(); } | 140 int GetHTTPResponseCode() { return http_fetcher_->http_response_code(); } |
| 140 | 141 |
| 141 // Debugging/logging | 142 // Debugging/logging |
| 142 static std::string StaticType() { return "OmahaRequestAction"; } | 143 static std::string StaticType() { return "OmahaRequestAction"; } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 167 | 168 |
| 168 // These are data that are passed in the request to the Omaha server. | 169 // These are data that are passed in the request to the Omaha server. |
| 169 const OmahaRequestParams& params_; | 170 const OmahaRequestParams& params_; |
| 170 | 171 |
| 171 // Pointer to the OmahaEvent info. This is an UpdateCheck request if NULL. | 172 // Pointer to the OmahaEvent info. This is an UpdateCheck request if NULL. |
| 172 scoped_ptr<OmahaEvent> event_; | 173 scoped_ptr<OmahaEvent> event_; |
| 173 | 174 |
| 174 // pointer to the HttpFetcher that does the http work | 175 // pointer to the HttpFetcher that does the http work |
| 175 scoped_ptr<HttpFetcher> http_fetcher_; | 176 scoped_ptr<HttpFetcher> http_fetcher_; |
| 176 | 177 |
| 178 // If true, only include the <ping> element in the request. |
| 179 bool ping_only_; |
| 180 |
| 177 // Stores the response from the omaha server | 181 // Stores the response from the omaha server |
| 178 std::vector<char> response_buffer_; | 182 std::vector<char> response_buffer_; |
| 179 | 183 |
| 180 // Initialized by InitPingDays to values that may be sent to Omaha | 184 // Initialized by InitPingDays to values that may be sent to Omaha |
| 181 // as part of a ping message. Note that only positive values and -1 | 185 // as part of a ping message. Note that only positive values and -1 |
| 182 // are sent to Omaha. | 186 // are sent to Omaha. |
| 183 int ping_active_days_; | 187 int ping_active_days_; |
| 184 int ping_roll_call_days_; | 188 int ping_roll_call_days_; |
| 185 | 189 |
| 186 // If true, this action should be a noop. | 190 // If true, this action should be a noop. |
| 187 bool should_skip_; | 191 bool should_skip_; |
| 188 | 192 |
| 189 DISALLOW_COPY_AND_ASSIGN(OmahaRequestAction); | 193 DISALLOW_COPY_AND_ASSIGN(OmahaRequestAction); |
| 190 }; | 194 }; |
| 191 | 195 |
| 192 } // namespace chromeos_update_engine | 196 } // namespace chromeos_update_engine |
| 193 | 197 |
| 194 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_OMAHA_REQUEST_ACTION_H__ | 198 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_OMAHA_REQUEST_ACTION_H__ |
| OLD | NEW |