Commit 71746349 authored by Ken Rockot's avatar Ken Rockot Committed by Commit Bot

Fix histogram + tracing collection from plugins

The refactoring in r715377 failed to expose general-purpose child
process interfaces to the browser from plugin processes. As a result,
histogram collection and tracing don't function as expected in plugin
processes.

This fixes that.

Fixed: 1043019
Change-Id: I7d32e0d4de091cd3e6a343d7cf1604ff65a2ff8f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2037345
Commit-Queue: Ken Rockot <rockot@google.com>
Auto-Submit: Ken Rockot <rockot@google.com>
Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#738423}
parent 97e6c2b3
...@@ -243,13 +243,11 @@ class ChildThreadImpl::IOThreadState ...@@ -243,13 +243,11 @@ class ChildThreadImpl::IOThreadState
base::WeakPtr<ChildThreadImpl> weak_main_thread, base::WeakPtr<ChildThreadImpl> weak_main_thread,
base::RepeatingClosure quit_closure, base::RepeatingClosure quit_closure,
ChildThreadImpl::Options::ServiceBinder service_binder, ChildThreadImpl::Options::ServiceBinder service_binder,
bool wait_for_interface_binders,
mojo::PendingReceiver<mojom::ChildProcessHost> host_receiver) mojo::PendingReceiver<mojom::ChildProcessHost> host_receiver)
: main_thread_task_runner_(std::move(main_thread_task_runner)), : main_thread_task_runner_(std::move(main_thread_task_runner)),
weak_main_thread_(std::move(weak_main_thread)), weak_main_thread_(std::move(weak_main_thread)),
quit_closure_(std::move(quit_closure)), quit_closure_(std::move(quit_closure)),
service_binder_(std::move(service_binder)), service_binder_(std::move(service_binder)),
wait_for_interface_binders_(wait_for_interface_binders),
host_receiver_(std::move(host_receiver)) {} host_receiver_(std::move(host_receiver)) {}
// Used only in the deprecated Service Manager IPC mode. // Used only in the deprecated Service Manager IPC mode.
...@@ -396,7 +394,7 @@ class ChildThreadImpl::IOThreadState ...@@ -396,7 +394,7 @@ class ChildThreadImpl::IOThreadState
ChildThreadImpl::Options::ServiceBinder service_binder_; ChildThreadImpl::Options::ServiceBinder service_binder_;
mojo::BinderMap interface_binders_; mojo::BinderMap interface_binders_;
bool wait_for_interface_binders_; bool wait_for_interface_binders_ = true;
mojo::Receiver<mojom::ChildProcess> receiver_{this}; mojo::Receiver<mojom::ChildProcess> receiver_{this};
mojo::PendingReceiver<mojom::ChildProcessHost> host_receiver_; mojo::PendingReceiver<mojom::ChildProcessHost> host_receiver_;
...@@ -511,7 +509,16 @@ ChildThreadImpl::ChildThreadImpl(base::RepeatingClosure quit_closure, ...@@ -511,7 +509,16 @@ ChildThreadImpl::ChildThreadImpl(base::RepeatingClosure quit_closure,
io_thread_state_ = base::MakeRefCounted<IOThreadState>( io_thread_state_ = base::MakeRefCounted<IOThreadState>(
base::ThreadTaskRunnerHandle::Get(), weak_factory_.GetWeakPtr(), base::ThreadTaskRunnerHandle::Get(), weak_factory_.GetWeakPtr(),
quit_closure_, std::move(options.service_binder), quit_closure_, std::move(options.service_binder),
options.exposes_interfaces_to_browser, std::move(host_receiver)); std::move(host_receiver));
// |ExposeInterfacesToBrowser()| must be called exactly once. Subclasses which
// set |exposes_interfaces_to_browser| in Options signify that they take
// responsibility for calling it.
//
// For other process types, we call it to expose only the basic set of
// interfaces common to all child process types.
if (!options.exposes_interfaces_to_browser)
ExposeInterfacesToBrowser(mojo::BinderMap());
Init(options); Init(options);
} }
......
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