| 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_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_INTERNAL_H_ | 5 #ifndef COMPONENTS_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_INTERNAL_H_ |
| 6 #define COMPONENTS_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_INTERNAL_H_ | 6 #define COMPONENTS_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_INTERNAL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 void MaybeThrottle(const std::string& id, | 49 void MaybeThrottle(const std::string& id, |
| 50 const base::Closure& callback) override; | 50 const base::Closure& callback) override; |
| 51 scoped_refptr<base::SequencedTaskRunner> GetSequencedTaskRunner() override; | 51 scoped_refptr<base::SequencedTaskRunner> GetSequencedTaskRunner() override; |
| 52 bool GetComponentDetails(const std::string& id, | 52 bool GetComponentDetails(const std::string& id, |
| 53 CrxUpdateItem* item) const override; | 53 CrxUpdateItem* item) const override; |
| 54 | 54 |
| 55 // Overrides for Observer. | 55 // Overrides for Observer. |
| 56 void OnEvent(Events event, const std::string& id) override; | 56 void OnEvent(Events event, const std::string& id) override; |
| 57 | 57 |
| 58 // Overrides for OnDemandUpdater. | 58 // Overrides for OnDemandUpdater. |
| 59 bool OnDemandUpdate(const std::string& id) override; | 59 void OnDemandUpdate(const std::string& id, |
| 60 CompletionCallback callback) override; |
| 60 | 61 |
| 61 private: | 62 private: |
| 62 void Start(); | 63 void Start(); |
| 63 void Stop(); | 64 void Stop(); |
| 64 | 65 |
| 65 bool CheckForUpdates(); | 66 bool CheckForUpdates(); |
| 66 | 67 |
| 67 bool OnDemandUpdateInternal(const std::string& id); | 68 void OnDemandUpdateInternal(const std::string& id, |
| 69 CompletionCallback callback); |
| 68 bool OnDemandUpdateWithCooldown(const std::string& id); | 70 bool OnDemandUpdateWithCooldown(const std::string& id); |
| 69 | 71 |
| 70 bool DoUnregisterComponent(const CrxComponent& component); | 72 bool DoUnregisterComponent(const CrxComponent& component); |
| 71 | 73 |
| 72 const CrxComponent* GetComponent(const std::string& id) const; | 74 const CrxComponent* GetComponent(const std::string& id) const; |
| 73 | 75 |
| 74 const CrxUpdateItem* GetComponentState(const std::string& id) const; | 76 const CrxUpdateItem* GetComponentState(const std::string& id) const; |
| 75 | 77 |
| 76 void OnUpdate(const std::vector<std::string>& ids, | 78 void OnUpdate(const std::vector<std::string>& ids, |
| 77 std::vector<CrxComponent>* components); | 79 std::vector<CrxComponent>* components); |
| 78 void OnUpdateComplete(const base::TimeTicks& start_time, int error); | 80 void OnUpdateComplete(CompletionCallback callback, |
| 81 const base::TimeTicks& start_time, |
| 82 int error); |
| 79 | 83 |
| 80 base::ThreadChecker thread_checker_; | 84 base::ThreadChecker thread_checker_; |
| 81 | 85 |
| 82 scoped_refptr<Configurator> config_; | 86 scoped_refptr<Configurator> config_; |
| 83 | 87 |
| 84 scoped_refptr<UpdateClient> update_client_; | 88 scoped_refptr<UpdateClient> update_client_; |
| 85 | 89 |
| 86 Timer timer_; | 90 Timer timer_; |
| 87 | 91 |
| 88 // A collection of every registered component. | 92 // A collection of every registered component. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 115 std::map<std::string, std::string> component_ids_by_mime_type_; | 119 std::map<std::string, std::string> component_ids_by_mime_type_; |
| 116 | 120 |
| 117 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; | 121 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; |
| 118 | 122 |
| 119 DISALLOW_COPY_AND_ASSIGN(CrxUpdateService); | 123 DISALLOW_COPY_AND_ASSIGN(CrxUpdateService); |
| 120 }; | 124 }; |
| 121 | 125 |
| 122 } // namespace component_updater | 126 } // namespace component_updater |
| 123 | 127 |
| 124 #endif // COMPONENTS_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_INTERNAL_H_ | 128 #endif // COMPONENTS_COMPONENT_UPDATER_COMPONENT_UPDATER_SERVICE_INTERNAL_H_ |
| OLD | NEW |