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
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_UPDATE_CLIENT_TASK_UPDATE_H_
6 #define COMPONENTS_UPDATE_CLIENT_TASK_UPDATE_H_
12 #include "base/callback.h"
13 #include "base/macros.h"
14 #include "base/threading/thread_checker.h"
15 #include "components/update_client/task.h"
16 #include "components/update_client/update_client.h"
18 namespace update_client
{
22 // Defines a specialized task for updating a group of CRXs.
23 class TaskUpdate
: public Task
{
25 TaskUpdate(UpdateEngine
* update_engine
,
26 const std::vector
<std::string
>& ids
,
27 const UpdateClient::CrxDataCallback
& crx_data_callback
);
28 ~TaskUpdate() override
;
30 void Run(const Callback
& callback
) override
;
33 // Called when the Run function associated with this task has completed.
34 void RunComplete(int error
);
36 base::ThreadChecker thread_checker_
;
38 UpdateEngine
* update_engine_
; // Not owned by this class.
40 const std::vector
<std::string
> ids_
;
41 const UpdateClient::CrxDataCallback crx_data_callback_
;
43 // Called to return the execution flow back to the caller of the
44 // Run function when this task has completed .
47 DISALLOW_COPY_AND_ASSIGN(TaskUpdate
);
50 } // namespace update_client
52 #endif // COMPONENTS_UPDATE_CLIENT_TASK_UPDATE_H_