| 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_ATTACHMENT_BROKER_PRIVILEGED_WIN_H_ | 5 #ifndef IPC_ATTACHMENT_BROKER_PRIVILEGED_WIN_H_ |
| 6 #define IPC_ATTACHMENT_BROKER_PRIVILEGED_WIN_H_ | 6 #define IPC_ATTACHMENT_BROKER_PRIVILEGED_WIN_H_ |
| 7 | 7 |
| 8 #include "ipc/attachment_broker_privileged.h" | 8 #include "ipc/attachment_broker_privileged.h" |
| 9 #include "ipc/handle_attachment_win.h" | 9 #include "ipc/handle_attachment_win.h" |
| 10 #include "ipc/ipc_export.h" | 10 #include "ipc/ipc_export.h" |
| 11 | 11 |
| 12 namespace IPC { | 12 namespace IPC { |
| 13 | 13 |
| 14 // This class is a concrete subclass of AttachmentBrokerPrivileged for the | 14 // This class is a concrete subclass of AttachmentBrokerPrivileged for the |
| 15 // Windows platform. | 15 // Windows platform. |
| 16 class IPC_EXPORT AttachmentBrokerPrivilegedWin | 16 class IPC_EXPORT AttachmentBrokerPrivilegedWin |
| 17 : public AttachmentBrokerPrivileged { | 17 : public AttachmentBrokerPrivileged { |
| 18 public: | 18 public: |
| 19 AttachmentBrokerPrivilegedWin(); | 19 AttachmentBrokerPrivilegedWin(); |
| 20 ~AttachmentBrokerPrivilegedWin() override; | 20 ~AttachmentBrokerPrivilegedWin() override; |
| 21 | 21 |
| 22 // IPC::AttachmentBroker overrides. | 22 // IPC::AttachmentBroker overrides. |
| 23 bool SendAttachmentToProcess(BrokerableAttachment* attachment, | 23 bool SendAttachmentToProcess( |
| 24 base::ProcessId destination_process) override; | 24 const scoped_refptr<IPC::BrokerableAttachment>& attachment, |
| 25 base::ProcessId destination_process) override; |
| 25 | 26 |
| 26 // IPC::Listener overrides. | 27 // IPC::Listener overrides. |
| 27 bool OnMessageReceived(const Message& message) override; | 28 bool OnMessageReceived(const Message& message) override; |
| 28 | 29 |
| 29 private: | 30 private: |
| 30 using HandleWireFormat = internal::HandleAttachmentWin::WireFormat; | 31 using HandleWireFormat = internal::HandleAttachmentWin::WireFormat; |
| 31 // IPC message handlers. | 32 // IPC message handlers. |
| 32 void OnDuplicateWinHandle(const Message& message); | 33 void OnDuplicateWinHandle(const Message& message); |
| 33 | 34 |
| 34 // Duplicates |wire_Format| from |source_process| into its destination | 35 // Duplicates |wire_Format| from |source_process| into its destination |
| 35 // process. | 36 // process. |
| 36 HandleWireFormat DuplicateWinHandle(const HandleWireFormat& wire_format, | 37 HandleWireFormat DuplicateWinHandle(const HandleWireFormat& wire_format, |
| 37 base::ProcessId source_process); | 38 base::ProcessId source_process); |
| 38 | 39 |
| 39 // Copies an existing |wire_format|, but substitutes in a different handle. | 40 // Copies an existing |wire_format|, but substitutes in a different handle. |
| 40 HandleWireFormat CopyWireFormat(const HandleWireFormat& wire_format, | 41 HandleWireFormat CopyWireFormat(const HandleWireFormat& wire_format, |
| 41 int handle); | 42 int handle); |
| 42 | 43 |
| 43 // If the HANDLE's destination is this process, queue it and notify the | 44 // If the HANDLE's destination is this process, queue it and notify the |
| 44 // observers. Otherwise, send it in an IPC to its destination. | 45 // observers. Otherwise, send it in an IPC to its destination. |
| 45 void RouteDuplicatedHandle(const HandleWireFormat& wire_format); | 46 void RouteDuplicatedHandle(const HandleWireFormat& wire_format); |
| 46 | 47 |
| 47 DISALLOW_COPY_AND_ASSIGN(AttachmentBrokerPrivilegedWin); | 48 DISALLOW_COPY_AND_ASSIGN(AttachmentBrokerPrivilegedWin); |
| 48 }; | 49 }; |
| 49 | 50 |
| 50 } // namespace IPC | 51 } // namespace IPC |
| 51 | 52 |
| 52 #endif // IPC_ATTACHMENT_BROKER_PRIVILEGED_WIN_H_ | 53 #endif // IPC_ATTACHMENT_BROKER_PRIVILEGED_WIN_H_ |
| OLD | NEW |