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_INTERNAL_H_ | 5 #ifndef COMPONENTS_UPDATE_CLIENT_UPDATE_CLIENT_INTERNAL_H_ |
6 #define COMPONENTS_UPDATE_CLIENT_UPDATE_CLIENT_INTERNAL_H_ | 6 #define COMPONENTS_UPDATE_CLIENT_UPDATE_CLIENT_INTERNAL_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <queue> | 9 #include <queue> |
10 #include <set> | 10 #include <set> |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
55 private: | 55 private: |
56 ~UpdateClientImpl() override; | 56 ~UpdateClientImpl() override; |
57 | 57 |
58 void RunTask(std::unique_ptr<Task> task); | 58 void RunTask(std::unique_ptr<Task> task); |
59 void OnTaskComplete(const Callback& callback, Task* task, Error error); | 59 void OnTaskComplete(const Callback& callback, Task* task, Error error); |
60 | 60 |
61 void NotifyObservers(Observer::Events event, const std::string& id); | 61 void NotifyObservers(Observer::Events event, const std::string& id); |
62 | 62 |
63 base::ThreadChecker thread_checker_; | 63 base::ThreadChecker thread_checker_; |
64 | 64 |
65 // True is Stop method has been called. | 65 // True is Stop method has been called. |
waffles
2017/04/24 18:57:22
is→if
Sorin Jianu
2017/04/24 23:26:45
Done.
| |
66 bool is_stopped_; | 66 bool is_stopped_ = false; |
67 | 67 |
68 scoped_refptr<Configurator> config_; | 68 scoped_refptr<Configurator> config_; |
69 | 69 |
70 // Contains the tasks that are pending. In the current implementation, | 70 // Contains the tasks that are pending. In the current implementation, |
71 // only update tasks (background tasks) are queued up. These tasks are | 71 // only update tasks (background tasks) are queued up. These tasks are |
72 // pending while they are in this queue. They have not been picked up yet | 72 // pending while they are in this queue. They have not been picked up yet |
73 // by the update engine. | 73 // by the update engine. |
74 std::queue<Task*> task_queue_; | 74 std::queue<Task*> task_queue_; |
75 | 75 |
76 // Contains all tasks in progress. These are the tasks that the update engine | 76 // Contains all tasks in progress. These are the tasks that the update engine |
77 // is executing at one moment. Install tasks are run concurrently, update | 77 // is executing at one moment. Install tasks are run concurrently, update |
78 // tasks are always serialized, and update tasks are queued up if install | 78 // tasks are always serialized, and update tasks are queued up if install |
79 // tasks are running. In addition, concurrent install tasks for the same id | 79 // tasks are running. In addition, concurrent install tasks for the same id |
80 // are not allowed. | 80 // are not allowed. |
81 std::set<Task*> tasks_; | 81 std::set<Task*> tasks_; |
82 | 82 |
83 // TODO(sorin): try to make the ping manager an observer of the service. | 83 // TODO(sorin): try to make the ping manager an observer of the service. |
84 std::unique_ptr<PingManager> ping_manager_; | 84 std::unique_ptr<PingManager> ping_manager_; |
85 std::unique_ptr<UpdateEngine> update_engine_; | 85 std::unique_ptr<UpdateEngine> update_engine_; |
86 | 86 |
87 base::ObserverList<Observer> observer_list_; | 87 base::ObserverList<Observer> observer_list_; |
88 | 88 |
89 DISALLOW_COPY_AND_ASSIGN(UpdateClientImpl); | 89 DISALLOW_COPY_AND_ASSIGN(UpdateClientImpl); |
90 }; | 90 }; |
91 | 91 |
92 } // namespace update_client | 92 } // namespace update_client |
93 | 93 |
94 #endif // COMPONENTS_UPDATE_CLIENT_UPDATE_CLIENT_INTERNAL_H_ | 94 #endif // COMPONENTS_UPDATE_CLIENT_UPDATE_CLIENT_INTERNAL_H_ |
OLD | NEW |