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 "services/catalog/reader.h" | 5 #include "services/catalog/reader.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file_enumerator.h" | 8 #include "base/files/file_enumerator.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/json/json_file_value_serializer.h" | 10 #include "base/json/json_file_value_serializer.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 base::Bind(&ProcessManifest, base::Passed(&manifest_root), | 176 base::Bind(&ProcessManifest, base::Passed(&manifest_root), |
177 system_package_dir_), | 177 system_package_dir_), |
178 base::Bind(&Reader::OnReadManifest, weak_factory_.GetWeakPtr(), | 178 base::Bind(&Reader::OnReadManifest, weak_factory_.GetWeakPtr(), |
179 cache, entry_created_callback)); | 179 cache, entry_created_callback)); |
180 } else { | 180 } else { |
181 base::PostTaskAndReplyWithResult( | 181 base::PostTaskAndReplyWithResult( |
182 file_task_runner_, FROM_HERE, | 182 file_task_runner_, FROM_HERE, |
183 base::Bind(&ReadManifest, system_package_dir_, mojo_name), | 183 base::Bind(&ReadManifest, system_package_dir_, mojo_name), |
184 base::Bind(&Reader::OnReadManifest, weak_factory_.GetWeakPtr(), | 184 base::Bind(&Reader::OnReadManifest, weak_factory_.GetWeakPtr(), |
185 cache, entry_created_callback)); | 185 cache, entry_created_callback)); |
186 | |
187 } | 186 } |
188 } | 187 } |
189 | 188 |
190 void Reader::OnReadManifest( | 189 void Reader::OnReadManifest( |
191 EntryCache* cache, | 190 EntryCache* cache, |
192 const CreateEntryForNameCallback& entry_created_callback, | 191 const CreateEntryForNameCallback& entry_created_callback, |
193 std::unique_ptr<Entry> entry) { | 192 std::unique_ptr<Entry> entry) { |
194 shell::mojom::ResolveResultPtr result = | 193 shell::mojom::ResolveResultPtr result = |
195 shell::mojom::ResolveResult::From(*entry); | 194 shell::mojom::ResolveResult::From(*entry); |
196 AddEntryToCache(cache, std::move(entry)); | 195 AddEntryToCache(cache, std::move(entry)); |
197 entry_created_callback.Run(std::move(result)); | 196 entry_created_callback.Run(std::move(result)); |
198 } | 197 } |
199 | 198 |
200 } // namespace catalog | 199 } // namespace catalog |
OLD | NEW |