Commit 8f699777 authored by Julie Kim's avatar Julie Kim Committed by Commit Bot

Revert "Convert nacl.mojom to new Mojo types"

This reverts commit d6027891.

Reason for revert: Suspect for crbug.com/1008178

Original change's description:
> Convert nacl.mojom to new Mojo types
>
> This CL converts NaClRendererHost and NaClExitControl
> to new Mojo types.
>
> It also updates ProvideExitControl from nacl.mojom
> and methods and members which implement it.
>
> Bug: 955171
> Change-Id: Ie6b875e07796b08818825474e8493e5f48072c3f
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1810509
> Reviewed-by: Bill Budge <bbudge@chromium.org>
> Reviewed-by: Derek Schuff <dschuff@chromium.org>
> Reviewed-by: Oksana Zhuravlova <oksamyt@chromium.org>
> Reviewed-by: Sam McNally <sammc@chromium.org>
> Commit-Queue: Julie Kim <jkim@igalia.com>
> Cr-Commit-Position: refs/heads/master@{#697852}

TBR=dschuff@chromium.org,bbudge@chromium.org,sammc@chromium.org,oksamyt@chromium.org,jkim@igalia.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 955171,1008178
Change-Id: I8bdeb5bdd842ffa95ca41fd009717d46c843c3fa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1829619
Commit-Queue: Jeongeun Kim <je_julie.kim@chromium.org>
Reviewed-by: default avatarJeongeun Kim <je_julie.kim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#700929}
parent 7899619f
......@@ -18,7 +18,7 @@ interface NaClRendererHost {
[Sync]
ReportLoadStatus(NaClErrorCode load_status) => ();
ProvideExitControl(pending_remote<NaClExitControl> exit_control);
ProvideExitControl(NaClExitControl exit_control);
};
// When this interface is closed, it indicates that the NaCl loader process
......
......@@ -36,7 +36,6 @@
#include "ipc/ipc_channel_handle.h"
#include "ipc/ipc_sync_channel.h"
#include "ipc/ipc_sync_message_filter.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "native_client/src/public/chrome_main.h"
#include "native_client/src/public/nacl_app.h"
#include "native_client/src/public/nacl_desc.h"
......@@ -333,10 +332,10 @@ void NaClListener::OnStart(nacl::NaClStartParams params) {
base::Bind(&NaClListener::ResolveFileToken, base::Unretained(this)),
base::Bind(&NaClListener::OnOpenResource, base::Unretained(this)));
mojo::PendingRemote<nacl::mojom::NaClRendererHost> renderer_host;
nacl::mojom::NaClRendererHostPtr renderer_host;
if (!Send(new NaClProcessHostMsg_PpapiChannelsCreated(
browser_handle, ppapi_renderer_handle,
renderer_host.InitWithNewPipeAndPassReceiver().PassPipe().release(),
MakeRequest(&renderer_host).PassMessagePipe().release(),
manifest_service_handle, ro_shmem_region)))
LOG(FATAL) << "Failed to send IPC channel handle to NaClProcessHost.";
......
......@@ -10,8 +10,7 @@
#include "base/bind.h"
#include "base/single_thread_task_runner.h"
#include "build/build_config.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "native_client/src/public/chrome_main.h"
namespace {
......@@ -37,25 +36,24 @@ class NaClExitControlImpl : public nacl::mojom::NaClExitControl {
}
};
void CreateExitControl(
mojo::PendingReceiver<nacl::mojom::NaClExitControl> receiver) {
mojo::MakeSelfOwnedReceiver(std::make_unique<NaClExitControlImpl>(),
std::move(receiver));
void CreateExitControl(nacl::mojom::NaClExitControlRequest request) {
mojo::MakeStrongBinding(std::make_unique<NaClExitControlImpl>(),
std::move(request));
}
} // namespace
NaClTrustedListener::NaClTrustedListener(
mojo::PendingRemote<nacl::mojom::NaClRendererHost> renderer_host,
nacl::mojom::NaClRendererHostPtr renderer_host,
base::SingleThreadTaskRunner* io_task_runner)
: renderer_host_(std::move(renderer_host)) {
mojo::PendingRemote<nacl::mojom::NaClExitControl> exit_control;
nacl::mojom::NaClExitControlPtr exit_control;
// The exit control binding must run on the IO thread. The main thread used
// by NaClListener is busy in NaClChromeMainAppStart(), so it can't be used
// for servicing messages.
io_task_runner->PostTask(
FROM_HERE, base::BindOnce(&CreateExitControl,
exit_control.InitWithNewPipeAndPassReceiver()));
FROM_HERE,
base::BindOnce(&CreateExitControl, mojo::MakeRequest(&exit_control)));
renderer_host_->ProvideExitControl(std::move(exit_control));
}
......
......@@ -7,8 +7,6 @@
#include "base/macros.h"
#include "components/nacl/common/nacl.mojom.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/remote.h"
namespace base {
class SingleThreadTaskRunner;
......@@ -16,8 +14,7 @@ class SingleThreadTaskRunner;
class NaClTrustedListener {
public:
NaClTrustedListener(
mojo::PendingRemote<nacl::mojom::NaClRendererHost> renderer_host,
NaClTrustedListener(nacl::mojom::NaClRendererHostPtr renderer_host,
base::SingleThreadTaskRunner* io_task_runner);
~NaClTrustedListener();
......@@ -26,7 +23,7 @@ class NaClTrustedListener {
}
private:
mojo::Remote<nacl::mojom::NaClRendererHost> renderer_host_;
nacl::mojom::NaClRendererHostPtr renderer_host_;
DISALLOW_COPY_AND_ASSIGN(NaClTrustedListener);
};
......
......@@ -24,7 +24,6 @@
#include "ipc/ipc_channel.h"
#include "ipc/ipc_channel_handle.h"
#include "ipc/ipc_sync_channel.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "native_client/src/public/nonsfi/irt_random.h"
#include "ppapi/nacl_irt/irt_manifest.h"
#include "ppapi/nacl_irt/plugin_startup.h"
......@@ -107,10 +106,10 @@ void NonSfiListener::OnStart(const nacl::NaClStartParams& params) {
ppapi::StartUpPlugin();
trusted_listener_ = std::make_unique<NaClTrustedListener>(
mojo::PendingRemote<nacl::mojom::NaClRendererHost>(
mojo::MakeProxy(nacl::mojom::NaClRendererHostPtrInfo(
mojo::ScopedMessagePipeHandle(
params.trusted_service_channel_handle.mojo_handle),
nacl::mojom::NaClRendererHost::Version_),
nacl::mojom::NaClRendererHost::Version_)),
io_thread_.task_runner().get());
// Ensure that the validation cache key (used as an extra input to the
......
......@@ -51,7 +51,6 @@
#include "content/public/renderer/render_thread.h"
#include "content/public/renderer/render_view.h"
#include "content/public/renderer/renderer_ppapi_host.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "net/base/data_url.h"
#include "net/base/net_errors.h"
#include "net/http/http_util.h"
......@@ -534,8 +533,7 @@ void PPBNaClPrivate::LaunchSelLdr(
std::unique_ptr<TrustedPluginChannel> trusted_plugin_channel(
new TrustedPluginChannel(
load_manager,
mojo::PendingReceiver<mojom::NaClRendererHost>(
mojo::ScopedMessagePipeHandle(
mojom::NaClRendererHostRequest(mojo::ScopedMessagePipeHandle(
launch_result.trusted_ipc_channel_handle.mojo_handle)),
is_helper_nexe));
load_manager->set_trusted_plugin_channel(std::move(trusted_plugin_channel));
......
......@@ -16,12 +16,12 @@ namespace nacl {
TrustedPluginChannel::TrustedPluginChannel(
NexeLoadManager* nexe_load_manager,
mojo::PendingReceiver<mojom::NaClRendererHost> receiver,
mojom::NaClRendererHostRequest request,
bool is_helper_nexe)
: nexe_load_manager_(nexe_load_manager),
receiver_(this, std::move(receiver)),
binding_(this, std::move(request)),
is_helper_nexe_(is_helper_nexe) {
receiver_.set_disconnect_handler(base::BindOnce(
binding_.set_connection_error_handler(base::BindOnce(
&TrustedPluginChannel::OnChannelError, base::Unretained(this)));
}
......@@ -64,8 +64,8 @@ void TrustedPluginChannel::ReportLoadStatus(NaClErrorCode load_status,
}
void TrustedPluginChannel::ProvideExitControl(
mojo::PendingRemote<mojom::NaClExitControl> exit_control) {
exit_control_.Bind(std::move(exit_control));
mojom::NaClExitControlPtr exit_control) {
exit_control_ = std::move(exit_control);
}
} // namespace nacl
......@@ -10,10 +10,7 @@
#include "base/callback.h"
#include "base/macros.h"
#include "components/nacl/common/nacl.mojom.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/bindings/binding.h"
#include "native_client/src/trusted/service_runtime/nacl_error_code.h"
#include "ppapi/c/pp_instance.h"
......@@ -23,7 +20,7 @@ class NexeLoadManager;
class TrustedPluginChannel : public mojom::NaClRendererHost {
public:
TrustedPluginChannel(NexeLoadManager* nexe_load_manager,
mojo::PendingReceiver<mojom::NaClRendererHost> receiver,
mojom::NaClRendererHostRequest request,
bool is_helper_nexe);
~TrustedPluginChannel() override;
......@@ -35,14 +32,13 @@ class TrustedPluginChannel : public mojom::NaClRendererHost {
ReportExitStatusCallback callback) override;
void ReportLoadStatus(NaClErrorCode load_status,
ReportLoadStatusCallback callback) override;
void ProvideExitControl(
mojo::PendingRemote<mojom::NaClExitControl> exit_control) override;
void ProvideExitControl(mojom::NaClExitControlPtr exit_control) override;
// Non-owning pointer. This is safe because the TrustedPluginChannel is owned
// by the NexeLoadManager pointed to here.
NexeLoadManager* nexe_load_manager_;
mojo::Receiver<mojom::NaClRendererHost> receiver_;
mojo::Remote<mojom::NaClExitControl> exit_control_;
mojo::Binding<mojom::NaClRendererHost> binding_;
mojom::NaClExitControlPtr exit_control_;
const bool is_helper_nexe_;
DISALLOW_COPY_AND_ASSIGN(TrustedPluginChannel);
......
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