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/instance.h" | 5 #include "services/catalog/instance.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "services/catalog/entry.h" | 8 #include "services/catalog/entry.h" |
9 #include "services/catalog/manifest_provider.h" | 9 #include "services/catalog/manifest_provider.h" |
10 #include "services/catalog/reader.h" | 10 #include "services/catalog/reader.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 } | 56 } |
57 | 57 |
58 //////////////////////////////////////////////////////////////////////////////// | 58 //////////////////////////////////////////////////////////////////////////////// |
59 // Instance, shell::mojom::Resolver: | 59 // Instance, shell::mojom::Resolver: |
60 | 60 |
61 void Instance::ResolveMojoName(const std::string& mojo_name, | 61 void Instance::ResolveMojoName(const std::string& mojo_name, |
62 const ResolveMojoNameCallback& callback) { | 62 const ResolveMojoNameCallback& callback) { |
63 DCHECK(system_cache_); | 63 DCHECK(system_cache_); |
64 | 64 |
65 std::string type = shell::GetNameType(mojo_name); | 65 std::string type = shell::GetNameType(mojo_name); |
66 if (type != shell::kNameType_Mojo && type != shell::kNameType_Exe) { | 66 if (type != shell::kNameType_Service && type != shell::kNameType_Exe) { |
67 std::unique_ptr<Entry> entry(new Entry(mojo_name)); | 67 std::unique_ptr<Entry> entry(new Entry(mojo_name)); |
68 shell::mojom::ResolveResultPtr result = | 68 shell::mojom::ResolveResultPtr result = |
69 shell::mojom::ResolveResult::From(*entry); | 69 shell::mojom::ResolveResult::From(*entry); |
70 result->capabilities = base::nullopt; | 70 result->capabilities = base::nullopt; |
71 callback.Run(std::move(result)); | 71 callback.Run(std::move(result)); |
72 return; | 72 return; |
73 } | 73 } |
74 | 74 |
75 // TODO(beng): per-user catalogs. | 75 // TODO(beng): per-user catalogs. |
76 auto entry = system_cache_->find(mojo_name); | 76 auto entry = system_cache_->find(mojo_name); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 void Instance::OnReadManifest(base::WeakPtr<Instance> instance, | 170 void Instance::OnReadManifest(base::WeakPtr<Instance> instance, |
171 const std::string& mojo_name, | 171 const std::string& mojo_name, |
172 const ResolveMojoNameCallback& callback, | 172 const ResolveMojoNameCallback& callback, |
173 shell::mojom::ResolveResultPtr result) { | 173 shell::mojom::ResolveResultPtr result) { |
174 callback.Run(std::move(result)); | 174 callback.Run(std::move(result)); |
175 if (instance) | 175 if (instance) |
176 instance->SerializeCatalog(); | 176 instance->SerializeCatalog(); |
177 } | 177 } |
178 | 178 |
179 } // namespace catalog | 179 } // namespace catalog |
OLD | NEW |