Commit 8755beb8 authored by Ken Rockot's avatar Ken Rockot Committed by Commit Bot

[content] Remove Child mojom interface

This interface is no longer used.

Bug: 977637
Change-Id: I69f7fe7aac89c2da60fdb3cf8844712de90e9455
Tbr: nasko@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1707815
Commit-Queue: Ken Rockot <rockot@google.com>
Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#678744}
parent a66547d2
...@@ -467,7 +467,6 @@ mojom("mojo_bindings") { ...@@ -467,7 +467,6 @@ mojom("mojo_bindings") {
sources = [ sources = [
"associated_interfaces.mojom", "associated_interfaces.mojom",
"child.mojom",
"child_process.mojom", "child_process.mojom",
"document_scoped_interface_bundle.mojom", "document_scoped_interface_bundle.mojom",
"download/mhtml_file_writer.mojom", "download/mhtml_file_writer.mojom",
......
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module content.mojom;
// This interface encapsulates a pipe between a child and browser processes
// that each side uses to monitor the lifetime of the connection.
interface Child {};
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include "base/process/process.h" #include "base/process/process.h"
#include "base/rand_util.h" #include "base/rand_util.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "content/common/child.mojom.h"
#include "content/public/common/service_manager_connection.h" #include "content/public/common/service_manager_connection.h"
#include "mojo/public/cpp/bindings/remote.h" #include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/system/message_pipe.h" #include "mojo/public/cpp/system/message_pipe.h"
...@@ -88,7 +87,6 @@ class ChildConnection::IOThreadContext ...@@ -88,7 +87,6 @@ class ChildConnection::IOThreadContext
mojo::PendingRemote<service_manager::mojom::Service>( mojo::PendingRemote<service_manager::mojom::Service>(
std::move(service_pipe), 0), std::move(service_pipe), 0),
std::move(metadata_receiver)); std::move(metadata_receiver));
connector_->BindInterface(child_identity, &child_);
} }
} }
...@@ -108,8 +106,6 @@ class ChildConnection::IOThreadContext ...@@ -108,8 +106,6 @@ class ChildConnection::IOThreadContext
// Usable from the IO thread only. // Usable from the IO thread only.
std::unique_ptr<service_manager::Connector> connector_; std::unique_ptr<service_manager::Connector> connector_;
service_manager::Identity child_identity_; service_manager::Identity child_identity_;
// ServiceManagerConnection in the child monitors the lifetime of this pipe.
mojom::ChildPtr child_;
mojo::Remote<service_manager::mojom::ProcessMetadata> remote_metadata_; mojo::Remote<service_manager::mojom::ProcessMetadata> remote_metadata_;
// Hold onto the process, and thus its process handle, so that the pid will // Hold onto the process, and thus its process handle, so that the pid will
// remain valid. // remain valid.
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
#include "base/threading/thread_checker.h" #include "base/threading/thread_checker.h"
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "content/common/child.mojom.h"
#include "content/public/common/connection_filter.h" #include "content/public/common/connection_filter.h"
#include "content/public/common/service_names.mojom.h" #include "content/public/common/service_names.mojom.h"
#include "mojo/public/cpp/system/message_pipe.h" #include "mojo/public/cpp/system/message_pipe.h"
...@@ -49,16 +48,14 @@ ServiceManagerConnection::Factory* service_manager_connection_factory = nullptr; ...@@ -49,16 +48,14 @@ ServiceManagerConnection::Factory* service_manager_connection_factory = nullptr;
// bindings. // bindings.
class ServiceManagerConnectionImpl::IOThreadContext class ServiceManagerConnectionImpl::IOThreadContext
: public base::RefCountedThreadSafe<IOThreadContext>, : public base::RefCountedThreadSafe<IOThreadContext>,
public service_manager::Service, public service_manager::Service {
public mojom::Child {
public: public:
IOThreadContext(service_manager::mojom::ServiceRequest service_request, IOThreadContext(service_manager::mojom::ServiceRequest service_request,
scoped_refptr<base::SequencedTaskRunner> io_task_runner, scoped_refptr<base::SequencedTaskRunner> io_task_runner,
service_manager::mojom::ConnectorRequest connector_request) service_manager::mojom::ConnectorRequest connector_request)
: pending_service_request_(std::move(service_request)), : pending_service_request_(std::move(service_request)),
io_task_runner_(io_task_runner), io_task_runner_(io_task_runner),
pending_connector_request_(std::move(connector_request)), pending_connector_request_(std::move(connector_request)) {
child_binding_(this) {
// This will be reattached by any of the IO thread functions on first call. // This will be reattached by any of the IO thread functions on first call.
io_thread_checker_.DetachFromThread(); io_thread_checker_.DetachFromThread();
} }
...@@ -215,7 +212,6 @@ class ServiceManagerConnectionImpl::IOThreadContext ...@@ -215,7 +212,6 @@ class ServiceManagerConnectionImpl::IOThreadContext
ClearConnectionFiltersOnIOThread(); ClearConnectionFiltersOnIOThread();
request_handlers_.clear(); request_handlers_.clear();
child_binding_.Close();
} }
void ClearConnectionFiltersOnIOThread() { void ClearConnectionFiltersOnIOThread() {
...@@ -248,12 +244,6 @@ class ServiceManagerConnectionImpl::IOThreadContext ...@@ -248,12 +244,6 @@ class ServiceManagerConnectionImpl::IOThreadContext
const std::string& interface_name, const std::string& interface_name,
mojo::ScopedMessagePipeHandle interface_pipe) override { mojo::ScopedMessagePipeHandle interface_pipe) override {
DCHECK(io_thread_checker_.CalledOnValidThread()); DCHECK(io_thread_checker_.CalledOnValidThread());
if ((source_info.identity.name() == mojom::kBrowserServiceName ||
source_info.identity.name() == mojom::kSystemServiceName) &&
interface_name == mojom::Child::Name_) {
DCHECK(!child_binding_.is_bound());
child_binding_.Bind(mojom::ChildRequest(std::move(interface_pipe)));
} else {
base::AutoLock lock(lock_); base::AutoLock lock(lock_);
for (auto& entry : connection_filters_) { for (auto& entry : connection_filters_) {
entry.second->OnBindInterface(source_info, interface_name, entry.second->OnBindInterface(source_info, interface_name,
...@@ -264,7 +254,6 @@ class ServiceManagerConnectionImpl::IOThreadContext ...@@ -264,7 +254,6 @@ class ServiceManagerConnectionImpl::IOThreadContext
return; return;
} }
} }
}
void CreatePackagedServiceInstance( void CreatePackagedServiceInstance(
const std::string& service_name, const std::string& service_name,
...@@ -325,8 +314,6 @@ class ServiceManagerConnectionImpl::IOThreadContext ...@@ -325,8 +314,6 @@ class ServiceManagerConnectionImpl::IOThreadContext
std::map<std::string, ServiceRequestHandlerWithCallback> request_handlers_; std::map<std::string, ServiceRequestHandlerWithCallback> request_handlers_;
mojo::Binding<mojom::Child> child_binding_;
base::WeakPtrFactory<IOThreadContext> weak_factory_{this}; base::WeakPtrFactory<IOThreadContext> weak_factory_{this};
DISALLOW_COPY_AND_ASSIGN(IOThreadContext); DISALLOW_COPY_AND_ASSIGN(IOThreadContext);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment