OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_IPC_CHANNEL_MOJO_H_ | 5 #ifndef IPC_IPC_CHANNEL_MOJO_H_ |
6 #define IPC_IPC_CHANNEL_MOJO_H_ | 6 #define IPC_IPC_CHANNEL_MOJO_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 | 66 |
67 ~ChannelMojo() override; | 67 ~ChannelMojo() override; |
68 | 68 |
69 // Channel implementation | 69 // Channel implementation |
70 bool Connect() override; | 70 bool Connect() override; |
71 void Pause() override; | 71 void Pause() override; |
72 void Unpause(bool flush) override; | 72 void Unpause(bool flush) override; |
73 void Flush() override; | 73 void Flush() override; |
74 void Close() override; | 74 void Close() override; |
75 bool Send(Message* message) override; | 75 bool Send(Message* message) override; |
76 base::ProcessId GetPeerPID() const override; | |
77 Channel::AssociatedInterfaceSupport* GetAssociatedInterfaceSupport() override; | 76 Channel::AssociatedInterfaceSupport* GetAssociatedInterfaceSupport() override; |
78 | 77 |
79 base::ProcessId GetSelfPID() const; | |
80 | |
81 // These access protected API of IPC::Message, which has ChannelMojo | 78 // These access protected API of IPC::Message, which has ChannelMojo |
82 // as a friend class. | 79 // as a friend class. |
83 static MojoResult WriteToMessageAttachmentSet( | 80 static MojoResult WriteToMessageAttachmentSet( |
84 base::Optional<std::vector<mojom::SerializedHandlePtr>> handle_buffer, | 81 base::Optional<std::vector<mojom::SerializedHandlePtr>> handle_buffer, |
85 Message* message); | 82 Message* message); |
86 static MojoResult ReadFromMessageAttachmentSet( | 83 static MojoResult ReadFromMessageAttachmentSet( |
87 Message* message, | 84 Message* message, |
88 base::Optional<std::vector<mojom::SerializedHandlePtr>>* handles); | 85 base::Optional<std::vector<mojom::SerializedHandlePtr>>* handles); |
89 | 86 |
90 // MojoBootstrapDelegate implementation | 87 // MojoBootstrapDelegate implementation |
91 void OnPipesAvailable(mojom::ChannelAssociatedPtr sender, | 88 void OnPipesAvailable(mojom::ChannelAssociatedPtr sender, |
92 mojom::ChannelAssociatedRequest receiver) override; | 89 mojom::ChannelAssociatedRequest receiver) override; |
93 | 90 |
94 // MessagePipeReader::Delegate | 91 // MessagePipeReader::Delegate |
95 void OnPeerPidReceived() override; | 92 void OnPeerPidReceived(int32_t peer_pid) override; |
96 void OnMessageReceived(const Message& message) override; | 93 void OnMessageReceived(const Message& message) override; |
97 void OnPipeError() override; | 94 void OnPipeError() override; |
98 void OnAssociatedInterfaceRequest( | 95 void OnAssociatedInterfaceRequest( |
99 const std::string& name, | 96 const std::string& name, |
100 mojo::ScopedInterfaceEndpointHandle handle) override; | 97 mojo::ScopedInterfaceEndpointHandle handle) override; |
101 | 98 |
102 private: | 99 private: |
103 ChannelMojo( | 100 ChannelMojo( |
104 mojo::ScopedMessagePipeHandle handle, | 101 mojo::ScopedMessagePipeHandle handle, |
105 Mode mode, | 102 Mode mode, |
(...skipping 23 matching lines...) Expand all Loading... |
129 associated_interfaces_; | 126 associated_interfaces_; |
130 | 127 |
131 base::WeakPtrFactory<ChannelMojo> weak_factory_; | 128 base::WeakPtrFactory<ChannelMojo> weak_factory_; |
132 | 129 |
133 DISALLOW_COPY_AND_ASSIGN(ChannelMojo); | 130 DISALLOW_COPY_AND_ASSIGN(ChannelMojo); |
134 }; | 131 }; |
135 | 132 |
136 } // namespace IPC | 133 } // namespace IPC |
137 | 134 |
138 #endif // IPC_IPC_CHANNEL_MOJO_H_ | 135 #endif // IPC_IPC_CHANNEL_MOJO_H_ |
OLD | NEW |