Index: ipc/ipc_channel_handle.h |
diff --git a/ipc/ipc_channel_handle.h b/ipc/ipc_channel_handle.h |
index ba034cca23b87b51557d6f3e53ab992ee0716e79..129df77abc22d7f169c485b6d4718cbab8a9700f 100644 |
--- a/ipc/ipc_channel_handle.h |
+++ b/ipc/ipc_channel_handle.h |
@@ -10,6 +10,9 @@ |
#include "build/build_config.h" |
+#if defined(OS_WIN) |
+#include "base/win/scoped_handle.h" |
+#endif |
#if defined(OS_POSIX) |
#include "base/file_descriptor_posix.h" |
#endif |
@@ -35,6 +38,15 @@ struct ChannelHandle { |
// processes with different working directories. |
ChannelHandle(const std::string& n) : name(n) {} |
ChannelHandle(const char* n) : name(n) {} |
+#if defined(OS_WIN) |
+ ChannelHandle(HANDLE h) : pipe(h) {} |
sanjeevr
2012/01/19 15:36:33
A channel handle that is created with only a handl
|
+ ChannelHandle(const ChannelHandle& other) : name(other.name), pipe(NULL) { |
+ HANDLE copy = NULL; |
+ DuplicateHandle(GetCurrentProcess(), other.pipe, GetCurrentProcess(), |
+ ©, 0, FALSE, DUPLICATE_SAME_ACCESS); |
+ pipe.Set(copy); |
+ } |
+#endif |
#if defined(OS_POSIX) |
ChannelHandle(const std::string& n, const base::FileDescriptor& s) |
: name(n), socket(s) {} |
@@ -44,6 +56,9 @@ struct ChannelHandle { |
#if defined(OS_POSIX) |
base::FileDescriptor socket; |
#endif // defined(OS_POSIX) |
+#if defined(OS_WIN) |
+ base::win::ScopedHandle pipe; |
+#endif |
}; |