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_MESSAGE_PIPE_READER_H_ | 5 #ifndef IPC_IPC_MESSAGE_PIPE_READER_H_ |
6 #define IPC_IPC_MESSAGE_PIPE_READER_H_ | 6 #define IPC_IPC_MESSAGE_PIPE_READER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 | 88 |
89 base::ProcessId GetPeerPid() const { return peer_pid_; } | 89 base::ProcessId GetPeerPid() const { return peer_pid_; } |
90 | 90 |
91 protected: | 91 protected: |
92 void OnPipeClosed(); | 92 void OnPipeClosed(); |
93 void OnPipeError(MojoResult error); | 93 void OnPipeError(MojoResult error); |
94 | 94 |
95 private: | 95 private: |
96 // mojom::Channel: | 96 // mojom::Channel: |
97 void SetPeerPid(int32_t peer_pid) override; | 97 void SetPeerPid(int32_t peer_pid) override; |
98 void Receive(mojo::Array<uint8_t> data, | 98 void Receive( |
99 mojo::Array<mojom::SerializedHandlePtr> handles) override; | 99 const std::vector<uint8_t>& data, |
| 100 base::Optional<std::vector<mojom::SerializedHandlePtr>> handles) override; |
100 void GetAssociatedInterface( | 101 void GetAssociatedInterface( |
101 const mojo::String& name, | 102 const std::string& name, |
102 mojom::GenericInterfaceAssociatedRequest request) override; | 103 mojom::GenericInterfaceAssociatedRequest request) override; |
103 | 104 |
104 // |delegate_| is null once the message pipe is closed. | 105 // |delegate_| is null once the message pipe is closed. |
105 Delegate* delegate_; | 106 Delegate* delegate_; |
106 base::ProcessId peer_pid_ = base::kNullProcessId; | 107 base::ProcessId peer_pid_ = base::kNullProcessId; |
107 mojom::ChannelAssociatedPtr sender_; | 108 mojom::ChannelAssociatedPtr sender_; |
108 mojo::AssociatedBinding<mojom::Channel> binding_; | 109 mojo::AssociatedBinding<mojom::Channel> binding_; |
109 | 110 |
110 // Raw message pipe handle and interface ID we use to send legacy IPC messages | 111 // Raw message pipe handle and interface ID we use to send legacy IPC messages |
111 // over the associated pipe. | 112 // over the associated pipe. |
112 const uint32_t sender_interface_id_; | 113 const uint32_t sender_interface_id_; |
113 const mojo::MessagePipeHandle sender_pipe_; | 114 const mojo::MessagePipeHandle sender_pipe_; |
114 | 115 |
115 base::ThreadChecker thread_checker_; | 116 base::ThreadChecker thread_checker_; |
116 | 117 |
117 DISALLOW_COPY_AND_ASSIGN(MessagePipeReader); | 118 DISALLOW_COPY_AND_ASSIGN(MessagePipeReader); |
118 }; | 119 }; |
119 | 120 |
120 } // namespace internal | 121 } // namespace internal |
121 } // namespace IPC | 122 } // namespace IPC |
122 | 123 |
123 #endif // IPC_IPC_MESSAGE_PIPE_READER_H_ | 124 #endif // IPC_IPC_MESSAGE_PIPE_READER_H_ |
OLD | NEW |