| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_DEFAULT_COMPONENT_INSTALLER_H_ | 5 #ifndef COMPONENTS_COMPONENT_UPDATER_DEFAULT_COMPONENT_INSTALLER_H_ |
| 6 #define COMPONENTS_COMPONENT_UPDATER_DEFAULT_COMPONENT_INSTALLER_H_ | 6 #define COMPONENTS_COMPONENT_UPDATER_DEFAULT_COMPONENT_INSTALLER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> |
| 8 #include <string> | 9 #include <string> |
| 9 #include <vector> | 10 #include <vector> |
| 10 | 11 |
| 11 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/threading/thread_checker.h" | 16 #include "base/threading/thread_checker.h" |
| 15 #include "base/values.h" | 17 #include "base/values.h" |
| 16 #include "base/version.h" | 18 #include "base/version.h" |
| 17 #include "components/component_updater/component_updater_service.h" | 19 #include "components/component_updater/component_updater_service.h" |
| 18 | 20 |
| 19 namespace base { | 21 namespace base { |
| 20 class FilePath; | 22 class FilePath; |
| 21 class SequencedTaskRunner; | 23 class SequencedTaskRunner; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 // |manifest| is the manifest for this version of the component. | 64 // |manifest| is the manifest for this version of the component. |
| 63 virtual void ComponentReady(const base::Version& version, | 65 virtual void ComponentReady(const base::Version& version, |
| 64 const base::FilePath& install_dir, | 66 const base::FilePath& install_dir, |
| 65 scoped_ptr<base::DictionaryValue> manifest) = 0; | 67 scoped_ptr<base::DictionaryValue> manifest) = 0; |
| 66 | 68 |
| 67 // Returns the directory that the installer will place versioned installs of | 69 // Returns the directory that the installer will place versioned installs of |
| 68 // the component into. | 70 // the component into. |
| 69 virtual base::FilePath GetBaseDirectory() const = 0; | 71 virtual base::FilePath GetBaseDirectory() const = 0; |
| 70 | 72 |
| 71 // Returns the component's SHA2 hash as raw bytes. | 73 // Returns the component's SHA2 hash as raw bytes. |
| 72 virtual void GetHash(std::vector<uint8>* hash) const = 0; | 74 virtual void GetHash(std::vector<uint8_t>* hash) const = 0; |
| 73 | 75 |
| 74 // Returns the human-readable name of the component. | 76 // Returns the human-readable name of the component. |
| 75 virtual std::string GetName() const = 0; | 77 virtual std::string GetName() const = 0; |
| 76 }; | 78 }; |
| 77 | 79 |
| 78 // A DefaultComponentInstaller is intended to be final, and not derived from. | 80 // A DefaultComponentInstaller is intended to be final, and not derived from. |
| 79 // Customization must be provided by passing a ComponentInstallerTraits object | 81 // Customization must be provided by passing a ComponentInstallerTraits object |
| 80 // to the constructor. | 82 // to the constructor. |
| 81 class DefaultComponentInstaller : public ComponentInstaller { | 83 class DefaultComponentInstaller : public ComponentInstaller { |
| 82 public: | 84 public: |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; | 116 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
| 115 | 117 |
| 116 base::ThreadChecker thread_checker_; | 118 base::ThreadChecker thread_checker_; |
| 117 | 119 |
| 118 DISALLOW_COPY_AND_ASSIGN(DefaultComponentInstaller); | 120 DISALLOW_COPY_AND_ASSIGN(DefaultComponentInstaller); |
| 119 }; | 121 }; |
| 120 | 122 |
| 121 } // namespace component_updater | 123 } // namespace component_updater |
| 122 | 124 |
| 123 #endif // COMPONENTS_COMPONENT_UPDATER_DEFAULT_COMPONENT_INSTALLER_H_ | 125 #endif // COMPONENTS_COMPONENT_UPDATER_DEFAULT_COMPONENT_INSTALLER_H_ |
| OLD | NEW |