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