OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 COMPONENTS_UPDATE_CLIENT_UPDATE_CLIENT_H_ | 5 #ifndef COMPONENTS_UPDATE_CLIENT_UPDATE_CLIENT_H_ |
6 #define COMPONENTS_UPDATE_CLIENT_UPDATE_CLIENT_H_ | 6 #define COMPONENTS_UPDATE_CLIENT_UPDATE_CLIENT_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 // update is attempted to give the caller the opportunity to provide the | 282 // update is attempted to give the caller the opportunity to provide the |
283 // instances of CrxComponent to be used for this update. The |Update| function | 283 // instances of CrxComponent to be used for this update. The |Update| function |
284 // is intended to be used for background updates of several CRXs. Overlapping | 284 // is intended to be used for background updates of several CRXs. Overlapping |
285 // calls to this function result in a queuing behavior, and the execution | 285 // calls to this function result in a queuing behavior, and the execution |
286 // of each call is serialized. In addition, updates are always queued up when | 286 // of each call is serialized. In addition, updates are always queued up when |
287 // installs are running. | 287 // installs are running. |
288 virtual void Update(const std::vector<std::string>& ids, | 288 virtual void Update(const std::vector<std::string>& ids, |
289 const CrxDataCallback& crx_data_callback, | 289 const CrxDataCallback& crx_data_callback, |
290 const CompletionCallback& completion_callback) = 0; | 290 const CompletionCallback& completion_callback) = 0; |
291 | 291 |
| 292 // Sends an uninstall ping for the CRX identified by |id| and |version|. The |
| 293 // |reason| parameter is defined by the caller. The current implementation of |
| 294 // this function only sends a best-effort, fire-and-forget ping. It has no |
| 295 // other side effects regarding installs or updates done through an instance |
| 296 // of this class. |
| 297 virtual void SendUninstallPing(const std::string& id, |
| 298 const Version& version, |
| 299 int reason) = 0; |
| 300 |
292 // Returns status details about a CRX update. The function returns true in | 301 // Returns status details about a CRX update. The function returns true in |
293 // case of success and false in case of errors, such as |id| was | 302 // case of success and false in case of errors, such as |id| was |
294 // invalid or not known. | 303 // invalid or not known. |
295 virtual bool GetCrxUpdateState(const std::string& id, | 304 virtual bool GetCrxUpdateState(const std::string& id, |
296 CrxUpdateItem* update_item) const = 0; | 305 CrxUpdateItem* update_item) const = 0; |
297 | 306 |
298 // Returns true if the |id| is found in any running task. | 307 // Returns true if the |id| is found in any running task. |
299 virtual bool IsUpdating(const std::string& id) const = 0; | 308 virtual bool IsUpdating(const std::string& id) const = 0; |
300 | 309 |
301 // Cancels the queued updates and makes a best effort to stop updates in | 310 // Cancels the queued updates and makes a best effort to stop updates in |
302 // progress as soon as possible. Some updates may not be stopped, in which | 311 // progress as soon as possible. Some updates may not be stopped, in which |
303 // case, the updates will run to completion. Calling this function has no | 312 // case, the updates will run to completion. Calling this function has no |
304 // effect if updates are not currently executed or queued up. | 313 // effect if updates are not currently executed or queued up. |
305 virtual void Stop() = 0; | 314 virtual void Stop() = 0; |
306 | 315 |
307 protected: | 316 protected: |
308 friend class base::RefCounted<UpdateClient>; | 317 friend class base::RefCounted<UpdateClient>; |
309 | 318 |
310 virtual ~UpdateClient() {} | 319 virtual ~UpdateClient() {} |
311 }; | 320 }; |
312 | 321 |
313 // Creates an instance of the update client. | 322 // Creates an instance of the update client. |
314 scoped_refptr<UpdateClient> UpdateClientFactory( | 323 scoped_refptr<UpdateClient> UpdateClientFactory( |
315 const scoped_refptr<Configurator>& config); | 324 const scoped_refptr<Configurator>& config); |
316 | 325 |
317 } // namespace update_client | 326 } // namespace update_client |
318 | 327 |
319 #endif // COMPONENTS_UPDATE_CLIENT_UPDATE_CLIENT_H_ | 328 #endif // COMPONENTS_UPDATE_CLIENT_UPDATE_CLIENT_H_ |
OLD | NEW |