Index: ipc/handle_attachment_win.h |
diff --git a/ipc/handle_attachment_win.h b/ipc/handle_attachment_win.h |
index b539907e8283e48f32b28bdfd98b0b892b551a31..7dd898ad54be0f3440732f2038c425b11fd3424c 100644 |
--- a/ipc/handle_attachment_win.h |
+++ b/ipc/handle_attachment_win.h |
@@ -5,6 +5,9 @@ |
#ifndef IPC_HANDLE_ATTACHMENT_WIN_H_ |
#define IPC_HANDLE_ATTACHMENT_WIN_H_ |
+#include <stdint.h> |
+ |
+#include "base/process/process_handle.h" |
#include "ipc/brokerable_attachment.h" |
#include "ipc/ipc_export.h" |
@@ -13,8 +16,30 @@ namespace internal { |
// This class represents a Windows HANDLE attached to a Chrome IPC message. |
class IPC_EXPORT HandleAttachmentWin : public BrokerableAttachment { |
+ public: |
+ // The wire format for this handle. |
+ struct IPC_EXPORT WireFormat { |
+ // The HANDLE that is intended for duplication, or the HANDLE that has been |
+ // duplicated, depending on context. |
+ // The type is int32_t instead of HANDLE because HANDLE gets typedefed to |
+ // void*, whose size varies between 32 and 64-bit processes. Using a |
+ // int32_t means that 64-bit processes will need to perform both up-casting |
+ // and down-casting. This is performed using the appropriate Windows apis. |
+ int32_t handle; |
+ // The id of the destination process that the handle is duplicated into. |
+ base::ProcessId destination_process; |
+ AttachmentId attachment_id; |
+ }; |
+ |
+ HandleAttachmentWin(const HANDLE& handle); |
+ |
+ BrokerableType GetBrokerableType() const override; |
+ |
+ // Returns the wire format of this attachment. |
+ WireFormat GetWireFormat(const base::ProcessId& destination) const; |
+ |
private: |
- Type GetType() const override { return TYPE_WIN_HANDLE; } |
+ ~HandleAttachmentWin() override; |
HANDLE handle_; |
}; |