Revert of ui: Clean up damaged rects and clear them after painting. (patchset #2...
[chromium-blink-merge.git] / components / update_client / task_update.h
blob7a91c280fe509bce6c90eeef050aeb33ef088e13
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_
8 #include <queue>
9 #include <string>
10 #include <vector>
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 {
20 class UpdateEngine;
22 // Defines a specialized task for updating a group of CRXs.
23 class TaskUpdate : public Task {
24 public:
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;
32 private:
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 .
45 Callback callback_;
47 DISALLOW_COPY_AND_ASSIGN(TaskUpdate);
50 } // namespace update_client
52 #endif // COMPONENTS_UPDATE_CLIENT_TASK_UPDATE_H_