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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 | 201 |
202 Reader::Reader(ManifestProvider* manifest_provider) | 202 Reader::Reader(ManifestProvider* manifest_provider) |
203 : manifest_provider_(manifest_provider), weak_factory_(this) { | 203 : manifest_provider_(manifest_provider), weak_factory_(this) { |
204 PathService::Get(base::DIR_MODULE, &system_package_dir_); | 204 PathService::Get(base::DIR_MODULE, &system_package_dir_); |
205 } | 205 } |
206 | 206 |
207 void Reader::OnReadManifest( | 207 void Reader::OnReadManifest( |
208 EntryCache* cache, | 208 EntryCache* cache, |
209 const CreateEntryForNameCallback& entry_created_callback, | 209 const CreateEntryForNameCallback& entry_created_callback, |
210 std::unique_ptr<Entry> entry) { | 210 std::unique_ptr<Entry> entry) { |
| 211 if (!entry) |
| 212 return; |
211 shell::mojom::ResolveResultPtr result = | 213 shell::mojom::ResolveResultPtr result = |
212 shell::mojom::ResolveResult::From(*entry); | 214 shell::mojom::ResolveResult::From(*entry); |
213 AddEntryToCache(cache, std::move(entry)); | 215 AddEntryToCache(cache, std::move(entry)); |
214 entry_created_callback.Run(std::move(result)); | 216 entry_created_callback.Run(std::move(result)); |
215 } | 217 } |
216 | 218 |
217 } // namespace catalog | 219 } // namespace catalog |
OLD | NEW |