Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1317)

Unified Diff: ui/gfx/mojo/buffer_types_struct_traits.cc

Issue 2843113002: make base::SharedMemoryHandle a class on POSIX. (Closed)
Patch Set: Fix test error. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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)
}

Powered by Google App Engine
This is Rietveld 408576698