Index: ui/gfx/mojo/buffer_types_struct_traits.cc |
diff --git a/ui/gfx/mojo/buffer_types_struct_traits.cc b/ui/gfx/mojo/buffer_types_struct_traits.cc |
index 52be89b5a1e3b1fb6a4b299b78596e98a502aa32..14a98a8606fdc4fd89103397f07c5a3362b38a9a 100644 |
--- a/ui/gfx/mojo/buffer_types_struct_traits.cc |
+++ b/ui/gfx/mojo/buffer_types_struct_traits.cc |
@@ -75,12 +75,7 @@ mojo::ScopedHandle StructTraits<gfx::mojom::GpuMemoryBufferHandleDataView, |
mojo::Handle mojo_handle = scoped_handle.release(); |
return mojo::MakeScopedHandle(mojo_handle); |
#else // defined(OS_MACOSX) |
- base::PlatformFile platform_file = base::kInvalidPlatformFile; |
-#if defined(OS_WIN) |
- platform_file = handle.handle.GetHandle(); |
-#else |
- platform_file = handle.handle.fd; |
-#endif |
+ base::PlatformFile platform_file = handle.handle.GetHandle(); |
return mojo::WrapPlatformFile(platform_file); |
#endif // defined(OS_MACOSX) |
} |
@@ -137,7 +132,8 @@ bool StructTraits<gfx::mojom::GpuMemoryBufferHandleDataView, |
out->handle = |
base::SharedMemoryHandle(platform_file, base::GetCurrentProcId()); |
#else |
- out->handle = base::SharedMemoryHandle(platform_file, true); |
+ out->handle = |
+ base::SharedMemoryHandle(base::FileDescriptor(platform_file, true)); |
#endif |
#endif // defined(OS_MACOSX) |
} |