Commit 70a1b0b3 authored by Henrique Ferreiro's avatar Henrique Ferreiro Committed by Commit Bot

Migrate fake_drivefs_launcher.mojom to the new Mojo types

Convert all users of the drivefs::mojom::FakeDriveFsLauncher interface.

Bug: 955171
Change-Id: Iad4d70615c78b699ac1cf078b5bdbc658245ce10
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1859781Reviewed-by: default avatarSergei Datsenko <dats@chromium.org>
Reviewed-by: default avatarOksana Zhuravlova <oksamyt@chromium.org>
Commit-Queue: Henrique Ferreiro <hferreiro@igalia.com>
Cr-Commit-Position: refs/heads/master@{#706821}
parent 12331eda
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "chromeos/components/drivefs/pending_connection_manager.h" #include "chromeos/components/drivefs/pending_connection_manager.h"
#include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/fake_cros_disks_client.h" #include "chromeos/dbus/fake_cros_disks_client.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/platform/named_platform_channel.h" #include "mojo/public/cpp/platform/named_platform_channel.h"
#include "mojo/public/cpp/platform/platform_channel.h" #include "mojo/public/cpp/platform/platform_channel.h"
#include "mojo/public/cpp/platform/platform_channel_endpoint.h" #include "mojo/public/cpp/platform/platform_channel_endpoint.h"
...@@ -24,7 +25,7 @@ ...@@ -24,7 +25,7 @@
namespace drivefs { namespace drivefs {
namespace { namespace {
void ConnectAsync(mojom::FakeDriveFsLauncherRequest request, void ConnectAsync(mojo::PendingReceiver<mojom::FakeDriveFsLauncher> receiver,
mojo::NamedPlatformChannel::ServerName server_name) { mojo::NamedPlatformChannel::ServerName server_name) {
mojo::PlatformChannelEndpoint endpoint = mojo::PlatformChannelEndpoint endpoint =
mojo::NamedPlatformChannel::ConnectToServer(server_name); mojo::NamedPlatformChannel::ConnectToServer(server_name);
...@@ -33,7 +34,7 @@ void ConnectAsync(mojom::FakeDriveFsLauncherRequest request, ...@@ -33,7 +34,7 @@ void ConnectAsync(mojom::FakeDriveFsLauncherRequest request,
mojo::OutgoingInvitation invitation; mojo::OutgoingInvitation invitation;
mojo::FuseMessagePipes(invitation.AttachMessagePipe("drivefs-launcher"), mojo::FuseMessagePipes(invitation.AttachMessagePipe("drivefs-launcher"),
request.PassMessagePipe()); receiver.PassPipe());
mojo::OutgoingInvitation::Send(std::move(invitation), mojo::OutgoingInvitation::Send(std::move(invitation),
base::kNullProcessHandle, std::move(endpoint)); base::kNullProcessHandle, std::move(endpoint));
} }
...@@ -59,7 +60,7 @@ FakeDriveFsLauncherClient::FakeDriveFsLauncherClient( ...@@ -59,7 +60,7 @@ FakeDriveFsLauncherClient::FakeDriveFsLauncherClient(
base::PostTask( base::PostTask(
FROM_HERE, FROM_HERE,
{base::ThreadPool(), base::MayBlock(), base::TaskPriority::BEST_EFFORT}, {base::ThreadPool(), base::MayBlock(), base::TaskPriority::BEST_EFFORT},
base::BindOnce(&ConnectAsync, mojo::MakeRequest(&launcher_), base::BindOnce(&ConnectAsync, launcher_.BindNewPipeAndPassReceiver(),
socket_path_.value())); socket_path_.value()));
chromeos::DBusThreadManager* dbus_thread_manager = chromeos::DBusThreadManager* dbus_thread_manager =
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "base/macros.h" #include "base/macros.h"
#include "base/no_destructor.h" #include "base/no_destructor.h"
#include "chromeos/components/drivefs/mojom/fake_drivefs_launcher.mojom.h" #include "chromeos/components/drivefs/mojom/fake_drivefs_launcher.mojom.h"
#include "mojo/public/cpp/bindings/remote.h"
namespace drivefs { namespace drivefs {
...@@ -33,7 +34,7 @@ class FakeDriveFsLauncherClient { ...@@ -33,7 +34,7 @@ class FakeDriveFsLauncherClient {
const base::FilePath chroot_path_; const base::FilePath chroot_path_;
const base::FilePath socket_path_; const base::FilePath socket_path_;
mojom::FakeDriveFsLauncherPtr launcher_; mojo::Remote<mojom::FakeDriveFsLauncher> launcher_;
DISALLOW_COPY_AND_ASSIGN(FakeDriveFsLauncherClient); DISALLOW_COPY_AND_ASSIGN(FakeDriveFsLauncherClient);
}; };
......
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