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_ENGINE_H_ | 5 #ifndef COMPONENTS_UPDATE_CLIENT_UPDATE_ENGINE_H_ |
6 #define COMPONENTS_UPDATE_CLIENT_UPDATE_ENGINE_H_ | 6 #define COMPONENTS_UPDATE_CLIENT_UPDATE_ENGINE_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <queue> | 9 #include <queue> |
10 #include <set> | 10 #include <set> |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 const std::string& id)>; | 46 const std::string& id)>; |
47 using CrxDataCallback = UpdateClient::CrxDataCallback; | 47 using CrxDataCallback = UpdateClient::CrxDataCallback; |
48 | 48 |
49 UpdateEngine(const scoped_refptr<Configurator>& config, | 49 UpdateEngine(const scoped_refptr<Configurator>& config, |
50 UpdateChecker::Factory update_checker_factory, | 50 UpdateChecker::Factory update_checker_factory, |
51 CrxDownloader::Factory crx_downloader_factory, | 51 CrxDownloader::Factory crx_downloader_factory, |
52 PingManager* ping_manager, | 52 PingManager* ping_manager, |
53 const NotifyObserversCallback& notify_observers_callback); | 53 const NotifyObserversCallback& notify_observers_callback); |
54 ~UpdateEngine(); | 54 ~UpdateEngine(); |
55 | 55 |
56 // Returns true is the CRX identified by the given |id| is being updated. | |
57 bool IsUpdating(const std::string& id) const; | |
58 | |
59 bool GetUpdateState(const std::string& id, CrxUpdateItem* update_state); | 56 bool GetUpdateState(const std::string& id, CrxUpdateItem* update_state); |
60 | 57 |
61 void Update(bool is_foreground, | 58 void Update(bool is_foreground, |
62 const std::vector<std::string>& ids, | 59 const std::vector<std::string>& ids, |
63 const UpdateClient::CrxDataCallback& crx_data_callback, | 60 const UpdateClient::CrxDataCallback& crx_data_callback, |
64 const CompletionCallback& update_callback); | 61 const CompletionCallback& update_callback); |
65 | 62 |
66 private: | 63 private: |
67 void UpdateComplete(UpdateContext* update_context, int error); | 64 void UpdateComplete(UpdateContext* update_context, int error); |
68 | 65 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 // TODO(sorin): use a map instead of vector. | 133 // TODO(sorin): use a map instead of vector. |
137 std::vector<CrxUpdateItem*> update_items; | 134 std::vector<CrxUpdateItem*> update_items; |
138 | 135 |
139 // Contains the ids of the items to update. | 136 // Contains the ids of the items to update. |
140 std::queue<std::string> queue; | 137 std::queue<std::string> queue; |
141 }; | 138 }; |
142 | 139 |
143 } // namespace update_client | 140 } // namespace update_client |
144 | 141 |
145 #endif // COMPONENTS_UPDATE_CLIENT_UPDATE_ENGINE_H_ | 142 #endif // COMPONENTS_UPDATE_CLIENT_UPDATE_ENGINE_H_ |
OLD | NEW |