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

Unified Diff: ipc/handle_attachment_win.h

Issue 1188923003: Stub in more IPC attachment brokering functionality. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase properly. Created 5 years, 5 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/brokerable_attachment.cc ('k') | ipc/handle_attachment_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
};
« no previous file with comments | « ipc/brokerable_attachment.cc ('k') | ipc/handle_attachment_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698