Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Side by Side Diff: components/component_updater/default_component_installer.h

Issue 897873002: Make ComponentInstaller refcounted. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@2015_01_19_component_installer
Patch Set: fix Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stdint.h>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // Registers the component for update checks and installs. 92 // Registers the component for update checks and installs.
93 void Register(ComponentUpdateService* cus); 93 void Register(ComponentUpdateService* cus);
94 94
95 // Overridden from ComponentInstaller: 95 // Overridden from ComponentInstaller:
96 void OnUpdateError(int error) override; 96 void OnUpdateError(int error) override;
97 bool Install(const base::DictionaryValue& manifest, 97 bool Install(const base::DictionaryValue& manifest,
98 const base::FilePath& unpack_path) override; 98 const base::FilePath& unpack_path) override;
99 bool GetInstalledFile(const std::string& file, 99 bool GetInstalledFile(const std::string& file,
100 base::FilePath* installed_file) override; 100 base::FilePath* installed_file) override;
101 101
102 private:
102 ~DefaultComponentInstaller() override; 103 ~DefaultComponentInstaller() override;
103 104
104 private:
105 base::FilePath GetInstallDirectory(); 105 base::FilePath GetInstallDirectory();
106 bool InstallHelper(const base::DictionaryValue& manifest, 106 bool InstallHelper(const base::DictionaryValue& manifest,
107 const base::FilePath& unpack_path, 107 const base::FilePath& unpack_path,
108 const base::FilePath& install_path); 108 const base::FilePath& install_path);
109 void StartRegistration(ComponentUpdateService* cus); 109 void StartRegistration(ComponentUpdateService* cus);
110 void FinishRegistration(ComponentUpdateService* cus); 110 void FinishRegistration(ComponentUpdateService* cus);
111 void ComponentReady(scoped_ptr<base::DictionaryValue> manifest);
111 112
112 base::Version current_version_; 113 base::Version current_version_;
113 std::string current_fingerprint_; 114 std::string current_fingerprint_;
114 scoped_ptr<base::DictionaryValue> current_manifest_; 115 scoped_ptr<base::DictionaryValue> current_manifest_;
115 scoped_ptr<ComponentInstallerTraits> installer_traits_; 116 scoped_ptr<ComponentInstallerTraits> installer_traits_;
116 scoped_refptr<base::SequencedTaskRunner> task_runner_; 117 scoped_refptr<base::SequencedTaskRunner> task_runner_;
117 118
118 // Used to post responses back to the main thread. Initialized on the main 119 // Used to post responses back to the main thread. Initialized on the main
119 // loop but accessed from the task runner. 120 // loop but accessed from the task runner.
120 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; 121 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
121 122
122 base::ThreadChecker thread_checker_; 123 base::ThreadChecker thread_checker_;
123 124
124 DISALLOW_COPY_AND_ASSIGN(DefaultComponentInstaller); 125 DISALLOW_COPY_AND_ASSIGN(DefaultComponentInstaller);
125 }; 126 };
126 127
127 } // namespace component_updater 128 } // namespace component_updater
128 129
129 #endif // COMPONENTS_COMPONENT_UPDATER_DEFAULT_COMPONENT_INSTALLER_H_ 130 #endif // COMPONENTS_COMPONENT_UPDATER_DEFAULT_COMPONENT_INSTALLER_H_
OLDNEW
« no previous file with comments | « components/component_updater/component_updater_service.cc ('k') | components/component_updater/default_component_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698