| 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 <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ipc/attachment_broker.h" | 10 #include "ipc/attachment_broker.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 // Each unprivileged process should have one IPC channel on which it | 34 // Each unprivileged process should have one IPC channel on which it |
| 35 // communicates attachment information with this privileged process. These | 35 // communicates attachment information with this privileged process. These |
| 36 // channels must be registered and deregistered with the Attachment Broker as | 36 // channels must be registered and deregistered with the Attachment Broker as |
| 37 // they are created and destroyed. | 37 // they are created and destroyed. |
| 38 void RegisterCommunicationChannel(Channel* channel); | 38 void RegisterCommunicationChannel(Channel* channel); |
| 39 void DeregisterCommunicationChannel(Channel* channel); | 39 void DeregisterCommunicationChannel(Channel* channel); |
| 40 | 40 |
| 41 private: | 41 private: |
| 42 using HandleWireFormat = internal::HandleAttachmentWin::WireFormat; | 42 using HandleWireFormat = internal::HandleAttachmentWin::WireFormat; |
| 43 // IPC message handlers. | 43 // IPC message handlers. |
| 44 void OnDuplicateWinHandle(const HandleWireFormat& wire_format, | 44 void OnDuplicateWinHandle(const IPC::Message& message); |
| 45 base::ProcessId source_process); | |
| 46 | 45 |
| 47 // Duplicates |wire_Format| from |source_process| into its destination | 46 // Duplicates |wire_Format| from |source_process| into its destination |
| 48 // process. | 47 // process. |
| 49 HandleWireFormat DuplicateWinHandle(const HandleWireFormat& wire_format, | 48 HandleWireFormat DuplicateWinHandle(const HandleWireFormat& wire_format, |
| 50 base::ProcessId source_process); | 49 base::ProcessId source_process); |
| 51 | 50 |
| 52 // If the HANDLE's destination is this process, queue it and notify the | 51 // If the HANDLE's destination is this process, queue it and notify the |
| 53 // observers. Otherwise, send it in an IPC to its destination. | 52 // observers. Otherwise, send it in an IPC to its destination. |
| 54 void RouteDuplicatedHandle(const HandleWireFormat& wire_format); | 53 void RouteDuplicatedHandle(const HandleWireFormat& wire_format); |
| 55 | 54 |
| 56 std::vector<Channel*> channels_; | 55 std::vector<Channel*> channels_; |
| 57 DISALLOW_COPY_AND_ASSIGN(AttachmentBrokerPrivilegedWin); | 56 DISALLOW_COPY_AND_ASSIGN(AttachmentBrokerPrivilegedWin); |
| 58 }; | 57 }; |
| 59 | 58 |
| 60 } // namespace IPC | 59 } // namespace IPC |
| 61 | 60 |
| 62 #endif // IPC_ATTACHMENT_BROKER_PRIVILEGED_WIN_H_ | 61 #endif // IPC_ATTACHMENT_BROKER_PRIVILEGED_WIN_H_ |
| OLD | NEW |