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 #include "chrome/browser/component_updater/ev_whitelist_component_installer.h" | 5 #include "chrome/browser/component_updater/ev_whitelist_component_installer.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 } | 101 } |
102 | 102 |
103 void EVWhitelistComponentInstallerTraits::ComponentReady( | 103 void EVWhitelistComponentInstallerTraits::ComponentReady( |
104 const base::Version& version, | 104 const base::Version& version, |
105 const base::FilePath& install_dir, | 105 const base::FilePath& install_dir, |
106 std::unique_ptr<base::DictionaryValue> manifest) { | 106 std::unique_ptr<base::DictionaryValue> manifest) { |
107 VLOG(1) << "Component ready, version " << version.GetString() << " in " | 107 VLOG(1) << "Component ready, version " << version.GetString() << " in " |
108 << install_dir.value(); | 108 << install_dir.value(); |
109 | 109 |
110 base::PostTaskWithTraits(FROM_HERE, | 110 base::PostTaskWithTraits(FROM_HERE, |
111 base::TaskTraits().MayBlock().WithPriority( | 111 {base::MayBlock(), base::TaskPriority::BACKGROUND}, |
112 base::TaskPriority::BACKGROUND), | |
113 base::Bind(&LoadWhitelistFromDisk, | 112 base::Bind(&LoadWhitelistFromDisk, |
114 GetInstalledPath(install_dir), version)); | 113 GetInstalledPath(install_dir), version)); |
115 } | 114 } |
116 | 115 |
117 // Called during startup and installation before ComponentReady(). | 116 // Called during startup and installation before ComponentReady(). |
118 bool EVWhitelistComponentInstallerTraits::VerifyInstallation( | 117 bool EVWhitelistComponentInstallerTraits::VerifyInstallation( |
119 const base::DictionaryValue& manifest, | 118 const base::DictionaryValue& manifest, |
120 const base::FilePath& install_dir) const { | 119 const base::FilePath& install_dir) const { |
121 return base::PathExists(GetInstalledPath(install_dir)); | 120 return base::PathExists(GetInstalledPath(install_dir)); |
122 } | 121 } |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 DefaultComponentInstaller* installer = | 155 DefaultComponentInstaller* installer = |
157 new DefaultComponentInstaller(std::move(traits)); | 156 new DefaultComponentInstaller(std::move(traits)); |
158 installer->Register(cus, base::Closure()); | 157 installer->Register(cus, base::Closure()); |
159 | 158 |
160 content::BrowserThread::PostAfterStartupTask( | 159 content::BrowserThread::PostAfterStartupTask( |
161 FROM_HERE, content::BrowserThread::GetBlockingPool(), | 160 FROM_HERE, content::BrowserThread::GetBlockingPool(), |
162 base::Bind(&DeleteWhitelistCopy, user_data_dir)); | 161 base::Bind(&DeleteWhitelistCopy, user_data_dir)); |
163 } | 162 } |
164 | 163 |
165 } // namespace component_updater | 164 } // namespace component_updater |
OLD | NEW |