Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef IPC_HANDLE_ATTACHMENT_WIN_H_ | 5 #ifndef IPC_HANDLE_ATTACHMENT_WIN_H_ |
| 6 #define IPC_HANDLE_ATTACHMENT_WIN_H_ | 6 #define IPC_HANDLE_ATTACHMENT_WIN_H_ |
| 7 | 7 |
| 8 #include "base/process/process_handle.h" | |
| 8 #include "ipc/brokerable_attachment.h" | 9 #include "ipc/brokerable_attachment.h" |
| 9 #include "ipc/ipc_export.h" | 10 #include "ipc/ipc_export.h" |
| 10 | 11 |
| 11 namespace IPC { | 12 namespace IPC { |
| 12 namespace internal { | 13 namespace internal { |
| 13 | 14 |
| 14 // This class represents a Windows HANDLE attached to a Chrome IPC message. | 15 // This class represents a Windows HANDLE attached to a Chrome IPC message. |
| 15 class IPC_EXPORT HandleAttachmentWin : public BrokerableAttachment { | 16 class IPC_EXPORT HandleAttachmentWin : public BrokerableAttachment { |
| 17 public: | |
| 18 // The wire format for this handle. | |
| 19 struct IPC_EXPORT WireFormat { | |
| 20 // The HANDLE that is intended for duplication, or the HANDLE that has been | |
| 21 // duplicated, depending on context. | |
| 22 HANDLE handle; | |
| 23 // The id of the destination process that the handle is duplicated into. | |
| 24 base::ProcessId destination_process; | |
| 25 // The id of the attachment. | |
|
Tom Sepez
2015/06/19 18:04:11
nit: this comment doesn't add much value.
erikchen
2015/06/23 22:37:00
Removed it.
| |
| 26 AttachmentId attachment_id; | |
| 27 }; | |
| 28 | |
| 29 HandleAttachmentWin(const HANDLE& handle); | |
| 30 | |
| 31 BrokerableType GetBrokerableType() const override; | |
| 32 | |
| 33 // Returns the wire format of this attachment. | |
| 34 WireFormat GetWireFormat(const base::ProcessId& destination); | |
| 35 | |
| 16 private: | 36 private: |
| 17 Type GetType() const override { return TYPE_WIN_HANDLE; } | 37 ~HandleAttachmentWin() override; |
| 18 HANDLE handle_; | 38 HANDLE handle_; |
| 19 }; | 39 }; |
| 20 | 40 |
| 21 } // namespace internal | 41 } // namespace internal |
| 22 } // namespace IPC | 42 } // namespace IPC |
| 23 | 43 |
| 24 #endif // IPC_HANDLE_ATTACHMENT_WIN_H_ | 44 #endif // IPC_HANDLE_ATTACHMENT_WIN_H_ |
| OLD | NEW |