| 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( | 98 void Receive(mojo::Array<uint8_t> data, |
| 99 const std::vector<uint8_t>& data, | 99 mojo::Array<mojom::SerializedHandlePtr> handles) override; |
| 100 base::Optional<std::vector<mojom::SerializedHandlePtr>> handles) override; | |
| 101 void GetAssociatedInterface( | 100 void GetAssociatedInterface( |
| 102 const std::string& name, | 101 const mojo::String& name, |
| 103 mojom::GenericInterfaceAssociatedRequest request) override; | 102 mojom::GenericInterfaceAssociatedRequest request) override; |
| 104 | 103 |
| 105 // |delegate_| is null once the message pipe is closed. | 104 // |delegate_| is null once the message pipe is closed. |
| 106 Delegate* delegate_; | 105 Delegate* delegate_; |
| 107 base::ProcessId peer_pid_ = base::kNullProcessId; | 106 base::ProcessId peer_pid_ = base::kNullProcessId; |
| 108 mojom::ChannelAssociatedPtr sender_; | 107 mojom::ChannelAssociatedPtr sender_; |
| 109 mojo::AssociatedBinding<mojom::Channel> binding_; | 108 mojo::AssociatedBinding<mojom::Channel> binding_; |
| 110 | 109 |
| 111 // Raw message pipe handle and interface ID we use to send legacy IPC messages | 110 // Raw message pipe handle and interface ID we use to send legacy IPC messages |
| 112 // over the associated pipe. | 111 // over the associated pipe. |
| 113 const uint32_t sender_interface_id_; | 112 const uint32_t sender_interface_id_; |
| 114 const mojo::MessagePipeHandle sender_pipe_; | 113 const mojo::MessagePipeHandle sender_pipe_; |
| 115 | 114 |
| 116 base::ThreadChecker thread_checker_; | 115 base::ThreadChecker thread_checker_; |
| 117 | 116 |
| 118 DISALLOW_COPY_AND_ASSIGN(MessagePipeReader); | 117 DISALLOW_COPY_AND_ASSIGN(MessagePipeReader); |
| 119 }; | 118 }; |
| 120 | 119 |
| 121 } // namespace internal | 120 } // namespace internal |
| 122 } // namespace IPC | 121 } // namespace IPC |
| 123 | 122 |
| 124 #endif // IPC_IPC_MESSAGE_PIPE_READER_H_ | 123 #endif // IPC_IPC_MESSAGE_PIPE_READER_H_ |
| OLD | NEW |