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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 std::string Type() const { return StaticType(); } | 143 std::string Type() const { return StaticType(); } |
144 | 144 |
145 // Delegate methods (see http_fetcher.h) | 145 // Delegate methods (see http_fetcher.h) |
146 virtual void ReceivedBytes(HttpFetcher *fetcher, | 146 virtual void ReceivedBytes(HttpFetcher *fetcher, |
147 const char* bytes, int length); | 147 const char* bytes, int length); |
148 virtual void TransferComplete(HttpFetcher *fetcher, bool successful); | 148 virtual void TransferComplete(HttpFetcher *fetcher, bool successful); |
149 | 149 |
150 // Returns true if this is an Event request, false if it's an UpdateCheck. | 150 // Returns true if this is an Event request, false if it's an UpdateCheck. |
151 bool IsEvent() const { return event_.get() != NULL; } | 151 bool IsEvent() const { return event_.get() != NULL; } |
152 | 152 |
| 153 void set_should_skip(bool should_skip) { should_skip_ = should_skip; } |
| 154 |
153 private: | 155 private: |
154 // If this is an update check request, initializes | 156 // If this is an update check request, initializes |
155 // |ping_active_days_| and |ping_roll_call_days_| to values that may | 157 // |ping_active_days_| and |ping_roll_call_days_| to values that may |
156 // be sent as pings to Omaha. | 158 // be sent as pings to Omaha. |
157 void InitPingDays(); | 159 void InitPingDays(); |
158 | 160 |
159 // Based on the persistent preference store values, calculates the | 161 // Based on the persistent preference store values, calculates the |
160 // number of days since the last ping sent for |key|. | 162 // number of days since the last ping sent for |key|. |
161 int CalculatePingDays(const std::string& key); | 163 int CalculatePingDays(const std::string& key); |
162 | 164 |
(...skipping 11 matching lines...) Expand all Loading... |
174 | 176 |
175 // Stores the response from the omaha server | 177 // Stores the response from the omaha server |
176 std::vector<char> response_buffer_; | 178 std::vector<char> response_buffer_; |
177 | 179 |
178 // Initialized by InitPingDays to values that may be sent to Omaha | 180 // Initialized by InitPingDays to values that may be sent to Omaha |
179 // as part of a ping message. Note that only positive values and -1 | 181 // as part of a ping message. Note that only positive values and -1 |
180 // are sent to Omaha. | 182 // are sent to Omaha. |
181 int ping_active_days_; | 183 int ping_active_days_; |
182 int ping_roll_call_days_; | 184 int ping_roll_call_days_; |
183 | 185 |
| 186 // If true, this action should be a noop. |
| 187 bool should_skip_; |
| 188 |
184 DISALLOW_COPY_AND_ASSIGN(OmahaRequestAction); | 189 DISALLOW_COPY_AND_ASSIGN(OmahaRequestAction); |
185 }; | 190 }; |
186 | 191 |
187 } // namespace chromeos_update_engine | 192 } // namespace chromeos_update_engine |
188 | 193 |
189 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_OMAHA_REQUEST_ACTION_H__ | 194 #endif // CHROMEOS_PLATFORM_UPDATE_ENGINE_OMAHA_REQUEST_ACTION_H__ |
OLD | NEW |