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

Unified Diff: ipc/ipc_platform_file.h

Issue 1830853002: Make PlatformFileForTransit a class on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from mseaborn. Created 4 years, 9 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
« no previous file with comments | « ipc/ipc_message_utils.cc ('k') | ipc/ipc_platform_file.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_platform_file.h
diff --git a/ipc/ipc_platform_file.h b/ipc/ipc_platform_file.h
index fb4d0e423de026f3250f74c35905c498ec4acfb4..045655a15769120838a16792b142aa3c2b9da7ef 100644
--- a/ipc/ipc_platform_file.h
+++ b/ipc/ipc_platform_file.h
@@ -14,17 +14,24 @@
#include "base/file_descriptor_posix.h"
#endif
+#if defined(OS_WIN)
+#include "base/memory/shared_memory_handle.h"
+#endif
+
namespace IPC {
#if defined(OS_WIN)
-typedef base::PlatformFile PlatformFileForTransit;
+// The semantics for IPC transfer of a SharedMemoryHandle are exactly the same
+// as for a PlatformFileForTransit. The object wraps a HANDLE, and has some
+// metadata that indicates the process to which the HANDLE belongs.
+using PlatformFileForTransit = base::SharedMemoryHandle;
#elif defined(OS_POSIX)
typedef base::FileDescriptor PlatformFileForTransit;
#endif
inline PlatformFileForTransit InvalidPlatformFileForTransit() {
#if defined(OS_WIN)
- return INVALID_HANDLE_VALUE;
+ return PlatformFileForTransit();
#elif defined(OS_POSIX)
return base::FileDescriptor();
#endif
@@ -33,7 +40,7 @@ inline PlatformFileForTransit InvalidPlatformFileForTransit() {
inline base::PlatformFile PlatformFileForTransitToPlatformFile(
const PlatformFileForTransit& transit) {
#if defined(OS_WIN)
- return transit;
+ return transit.GetHandle();
#elif defined(OS_POSIX)
return transit.fd;
#endif
@@ -42,7 +49,7 @@ inline base::PlatformFile PlatformFileForTransitToPlatformFile(
inline base::File PlatformFileForTransitToFile(
const PlatformFileForTransit& transit) {
#if defined(OS_WIN)
- return base::File(transit);
+ return base::File(transit.GetHandle());
#elif defined(OS_POSIX)
return base::File(transit.fd);
#endif
« no previous file with comments | « ipc/ipc_message_utils.cc ('k') | ipc/ipc_platform_file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698