Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(733)

Unified Diff: content/browser/service_manager/service_manager_context.cc

Issue 2684433003: Files required by a service now listed in manifest. (Closed)
Patch Set: Addressed dchen@'s comments. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/service_manager/service_manager_context.cc
diff --git a/content/browser/service_manager/service_manager_context.cc b/content/browser/service_manager/service_manager_context.cc
index 0cad78c8a54fbce6dde976f6c5948d6b269c2fc6..60146a7811f57737322f65466db1c2c45617695c 100644
--- a/content/browser/service_manager/service_manager_context.cc
+++ b/content/browser/service_manager/service_manager_context.cc
@@ -15,6 +15,7 @@
#include "base/memory/ptr_util.h"
#include "base/single_thread_task_runner.h"
#include "base/strings/utf_string_conversions.h"
+#include "content/browser/child_process_launcher.h"
#include "content/browser/gpu/gpu_process_host.h"
#include "content/browser/service_manager/merge_dictionary.h"
#include "content/common/service_manager/service_manager_connection_impl.h"
@@ -29,6 +30,7 @@
#include "mojo/edk/embedder/embedder.h"
#include "services/catalog/catalog.h"
#include "services/catalog/manifest_provider.h"
+#include "services/catalog/public/cpp/manifest_parsing_util.h"
#include "services/catalog/public/interfaces/constants.mojom.h"
#include "services/catalog/store.h"
#include "services/device/device_service.h"
@@ -140,6 +142,13 @@ class BuiltinManifestProvider : public catalog::ManifestProvider {
MergeDictionary(manifest_dictionary, overlay_dictionary);
}
+ base::Optional<catalog::RequiredFileMap> required_files =
+ catalog::RetrieveRequiredFiles(*manifest_value);
+ if (required_files) {
+ ChildProcessLauncher::SetRegisteredFilesForService(
+ name.as_string(), std::move(required_files.value()));
+ }
+
auto result = manifests_.insert(
std::make_pair(name.as_string(), std::move(manifest_value)));
DCHECK(result.second) << "Duplicate manifest entry: " << name;
@@ -304,9 +313,8 @@ ServiceManagerContext::ServiceManagerContext() {
->RegisterOutOfProcessServices(&sandboxed_services);
for (const auto& service : sandboxed_services) {
ServiceManagerConnection::GetForProcess()->AddServiceRequestHandler(
- service.first,
- base::Bind(&StartServiceInUtilityProcess, service.first, service.second,
- true /* use_sandbox */));
+ service.first, base::Bind(&StartServiceInUtilityProcess, service.first,
+ service.second, true /* use_sandbox */));
}
ContentBrowserClient::OutOfProcessServiceMap unsandboxed_services;

Powered by Google App Engine
This is Rietveld 408576698