| 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 16 matching lines...) Expand all Loading... |
| 27 const std::string& package_name_override) { | 27 const std::string& package_name_override) { |
| 28 // TODO(beng): think more about how this should be done for exe targets. | 28 // TODO(beng): think more about how this should be done for exe targets. |
| 29 std::string package_name = | 29 std::string package_name = |
| 30 package_name_override.empty() ? name : package_name_override; | 30 package_name_override.empty() ? name : package_name_override; |
| 31 return package_dir.AppendASCII(kPackagesDirName).AppendASCII( | 31 return package_dir.AppendASCII(kPackagesDirName).AppendASCII( |
| 32 package_name + "/manifest.json"); | 32 package_name + "/manifest.json"); |
| 33 } | 33 } |
| 34 | 34 |
| 35 base::FilePath GetExecutablePath(const base::FilePath& package_dir, | 35 base::FilePath GetExecutablePath(const base::FilePath& package_dir, |
| 36 const std::string& name) { | 36 const std::string& name) { |
| 37 return package_dir.AppendASCII(name + "/" + name + ".service"); | 37 return package_dir.AppendASCII(name + "/" + name + ".library"); |
| 38 } | 38 } |
| 39 | 39 |
| 40 std::unique_ptr<Entry> ProcessManifest( | 40 std::unique_ptr<Entry> ProcessManifest( |
| 41 std::unique_ptr<base::Value> manifest_root, | 41 std::unique_ptr<base::Value> manifest_root, |
| 42 const base::FilePath& package_dir) { | 42 const base::FilePath& package_dir) { |
| 43 // Manifest was malformed or did not exist. | 43 // Manifest was malformed or did not exist. |
| 44 if (!manifest_root) | 44 if (!manifest_root) |
| 45 return nullptr; | 45 return nullptr; |
| 46 | 46 |
| 47 const base::DictionaryValue* dictionary = nullptr; | 47 const base::DictionaryValue* dictionary = nullptr; |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 std::unique_ptr<Entry> entry) { | 228 std::unique_ptr<Entry> entry) { |
| 229 if (!entry) | 229 if (!entry) |
| 230 return; | 230 return; |
| 231 service_manager::mojom::ResolveResultPtr result = | 231 service_manager::mojom::ResolveResultPtr result = |
| 232 service_manager::mojom::ResolveResult::From(*entry); | 232 service_manager::mojom::ResolveResult::From(*entry); |
| 233 AddEntryToCache(cache, std::move(entry)); | 233 AddEntryToCache(cache, std::move(entry)); |
| 234 entry_created_callback.Run(std::move(result)); | 234 entry_created_callback.Run(std::move(result)); |
| 235 } | 235 } |
| 236 | 236 |
| 237 } // namespace catalog | 237 } // namespace catalog |
| OLD | NEW |