Commit 7fd508ee authored by Robert Sesek's avatar Robert Sesek Committed by Commit Bot

[fuchsia] Convert fidl_interface_request_mojom_traits.h and its users to handle<platform>

Bug: 778317
Change-Id: I9d9ab96a40d9ba664428d7e514ba3fcc314a9a0f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2065317
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Reviewed-by: default avatarWez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#743136}
parent b6ab169a
...@@ -7,5 +7,5 @@ module fuchsia.test.mojom; ...@@ -7,5 +7,5 @@ module fuchsia.test.mojom;
// Mojo struct of fidl::InterfaceRequest<TestInterface>. |request| is a // Mojo struct of fidl::InterfaceRequest<TestInterface>. |request| is a
// channel handle. // channel handle.
struct TestInterfaceRequest { struct TestInterfaceRequest {
handle request; handle<platform> request;
}; };
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include <lib/fidl/cpp/interface_request.h> #include <lib/fidl/cpp/interface_request.h>
#include "mojo/public/cpp/platform/platform_handle.h" #include "mojo/public/cpp/platform/platform_handle.h"
#include "mojo/public/cpp/system/platform_handle.h"
namespace mojo { namespace mojo {
...@@ -17,19 +16,13 @@ namespace mojo { ...@@ -17,19 +16,13 @@ namespace mojo {
// this struct. Read test_request_interface_mojom_traits.h for an example. // this struct. Read test_request_interface_mojom_traits.h for an example.
template <typename DataView, typename Interface> template <typename DataView, typename Interface>
struct FidlInterfaceRequestStructTraits { struct FidlInterfaceRequestStructTraits {
static ScopedHandle request(fidl::InterfaceRequest<Interface>& request) { static PlatformHandle request(fidl::InterfaceRequest<Interface>& request) {
DCHECK(request.is_valid()); DCHECK(request.is_valid());
PlatformHandle handle(request.TakeChannel()); return PlatformHandle(request.TakeChannel());
return WrapPlatformHandle(std::move(handle));
} }
static bool Read(DataView input, fidl::InterfaceRequest<Interface>* output) { static bool Read(DataView input, fidl::InterfaceRequest<Interface>* output) {
ScopedHandle input_request = input.TakeRequest(); PlatformHandle handle = input.TakeRequest();
if (!input_request.is_valid())
return false;
PlatformHandle handle =
mojo::UnwrapPlatformHandle(std::move(input_request));
if (!handle.is_valid_handle()) if (!handle.is_valid_handle())
return false; return false;
......
...@@ -6,7 +6,7 @@ module media.mojom; ...@@ -6,7 +6,7 @@ module media.mojom;
// Mojo struct for fidl::InterfaceRequest<fuchsia::media::AudioConsumer>. // Mojo struct for fidl::InterfaceRequest<fuchsia::media::AudioConsumer>.
struct AudioConsumerRequest { struct AudioConsumerRequest {
handle request; handle<platform> request;
}; };
// Interface used by FuchsiaAudioRenderer to create AudioConsumer. // Interface used by FuchsiaAudioRenderer to create AudioConsumer.
......
...@@ -7,7 +7,7 @@ module media.mojom; ...@@ -7,7 +7,7 @@ module media.mojom;
// Mojo struct for // Mojo struct for
// fidl::InterfaceRequest<fuchsia::media::drm::ContentDecryptionModule>. // fidl::InterfaceRequest<fuchsia::media::drm::ContentDecryptionModule>.
struct CdmRequest { struct CdmRequest {
handle request; handle<platform> request;
}; };
// Interface for asking privileged process to create connection to // Interface for asking privileged process to create connection to
......
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