Commit 8dbe47eb authored by kcwu's avatar kcwu Committed by Commit bot

Utilize new mojo::UnwrapPlatformFile function

Migrate to public api, which should be more stable than embedder api.

BUG=none
TEST=arc video still works

Review-Url: https://codereview.chromium.org/2026533002
Cr-Commit-Position: refs/heads/master@{#396782}
parent ea6426fc
......@@ -10,8 +10,8 @@
#include "base/logging.h"
#include "base/threading/thread_task_runner_handle.h"
#include "chrome/gpu/arc_gpu_video_decode_accelerator.h"
#include "mojo/edk/embedder/embedder.h"
#include "mojo/public/cpp/bindings/type_converter.h"
#include "mojo/public/cpp/system/platform_handle.h"
namespace {
void OnConnectionError() {
......@@ -153,17 +153,17 @@ base::ScopedFD GpuArcVideoService::UnwrapFdFromMojoHandle(
return base::ScopedFD();
}
mojo::edk::ScopedPlatformHandle scoped_platform_handle;
MojoResult mojo_result = mojo::edk::PassWrappedPlatformHandle(
handle.release().value(), &scoped_platform_handle);
base::PlatformFile platform_file;
MojoResult mojo_result =
mojo::UnwrapPlatformFile(std::move(handle), &platform_file);
if (mojo_result != MOJO_RESULT_OK) {
LOG(ERROR) << "PassWrappedPlatformHandle failed: " << mojo_result;
LOG(ERROR) << "UnwrapPlatformFile failed: " << mojo_result;
client_->OnError(
::arc::mojom::VideoAcceleratorServiceClient::Error::PLATFORM_FAILURE);
return base::ScopedFD();
}
return base::ScopedFD(scoped_platform_handle.release().handle);
return base::ScopedFD(platform_file);
}
void GpuArcVideoService::BindSharedMemory(::arc::mojom::PortType port,
......
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