OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/file_type_policies_component_installe
r.h" | 5 #include "chrome/browser/component_updater/file_type_policies_component_installe
r.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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 } | 79 } |
80 | 80 |
81 void FileTypePoliciesComponentInstallerTraits::ComponentReady( | 81 void FileTypePoliciesComponentInstallerTraits::ComponentReady( |
82 const base::Version& version, | 82 const base::Version& version, |
83 const base::FilePath& install_dir, | 83 const base::FilePath& install_dir, |
84 std::unique_ptr<base::DictionaryValue> manifest) { | 84 std::unique_ptr<base::DictionaryValue> manifest) { |
85 VLOG(1) << "Component ready, version " << version.GetString() << " in " | 85 VLOG(1) << "Component ready, version " << version.GetString() << " in " |
86 << install_dir.value(); | 86 << install_dir.value(); |
87 | 87 |
88 base::PostTaskWithTraits( | 88 base::PostTaskWithTraits( |
89 FROM_HERE, | 89 FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND}, |
90 base::TaskTraits().MayBlock().WithPriority( | |
91 base::TaskPriority::BACKGROUND), | |
92 base::Bind(&LoadFileTypesFromDisk, GetInstalledPath(install_dir))); | 90 base::Bind(&LoadFileTypesFromDisk, GetInstalledPath(install_dir))); |
93 } | 91 } |
94 | 92 |
95 // Called during startup and installation before ComponentReady(). | 93 // Called during startup and installation before ComponentReady(). |
96 bool FileTypePoliciesComponentInstallerTraits::VerifyInstallation( | 94 bool FileTypePoliciesComponentInstallerTraits::VerifyInstallation( |
97 const base::DictionaryValue& manifest, | 95 const base::DictionaryValue& manifest, |
98 const base::FilePath& install_dir) const { | 96 const base::FilePath& install_dir) const { |
99 // No need to actually validate the proto here, since we'll do the checking | 97 // No need to actually validate the proto here, since we'll do the checking |
100 // in PopulateFromDynamicUpdate(). | 98 // in PopulateFromDynamicUpdate(). |
101 return base::PathExists(GetInstalledPath(install_dir)); | 99 return base::PathExists(GetInstalledPath(install_dir)); |
(...skipping 30 matching lines...) Expand all Loading... |
132 | 130 |
133 std::unique_ptr<ComponentInstallerTraits> traits( | 131 std::unique_ptr<ComponentInstallerTraits> traits( |
134 new FileTypePoliciesComponentInstallerTraits()); | 132 new FileTypePoliciesComponentInstallerTraits()); |
135 // |cus| will take ownership of |installer| during installer->Register(cus). | 133 // |cus| will take ownership of |installer| during installer->Register(cus). |
136 DefaultComponentInstaller* installer = | 134 DefaultComponentInstaller* installer = |
137 new DefaultComponentInstaller(std::move(traits)); | 135 new DefaultComponentInstaller(std::move(traits)); |
138 installer->Register(cus, base::Closure()); | 136 installer->Register(cus, base::Closure()); |
139 } | 137 } |
140 | 138 |
141 } // namespace component_updater | 139 } // namespace component_updater |
OLD | NEW |