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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 83 |
84 static scoped_ptr<ChannelFactory> CreateClientFactory( | 84 static scoped_ptr<ChannelFactory> CreateClientFactory( |
85 const ChannelHandle& channel_handle); | 85 const ChannelHandle& channel_handle); |
86 | 86 |
87 virtual ~ChannelMojo(); | 87 virtual ~ChannelMojo(); |
88 | 88 |
89 // ChannelMojoHost tells the client handle using this API. | 89 // ChannelMojoHost tells the client handle using this API. |
90 void OnClientLaunched(base::ProcessHandle handle); | 90 void OnClientLaunched(base::ProcessHandle handle); |
91 | 91 |
92 // Channel implementation | 92 // Channel implementation |
93 virtual bool Connect() OVERRIDE; | 93 virtual bool Connect() override; |
94 virtual void Close() OVERRIDE; | 94 virtual void Close() override; |
95 virtual bool Send(Message* message) OVERRIDE; | 95 virtual bool Send(Message* message) override; |
96 virtual base::ProcessId GetPeerPID() const OVERRIDE; | 96 virtual base::ProcessId GetPeerPID() const override; |
97 virtual base::ProcessId GetSelfPID() const OVERRIDE; | 97 virtual base::ProcessId GetSelfPID() const override; |
98 | 98 |
99 #if defined(OS_POSIX) && !defined(OS_NACL) | 99 #if defined(OS_POSIX) && !defined(OS_NACL) |
100 virtual int GetClientFileDescriptor() const OVERRIDE; | 100 virtual int GetClientFileDescriptor() const override; |
101 virtual int TakeClientFileDescriptor() OVERRIDE; | 101 virtual int TakeClientFileDescriptor() override; |
102 | 102 |
103 // These access protected API of IPC::Message, which has ChannelMojo | 103 // These access protected API of IPC::Message, which has ChannelMojo |
104 // as a friend class. | 104 // as a friend class. |
105 static MojoResult WriteToFileDescriptorSet( | 105 static MojoResult WriteToFileDescriptorSet( |
106 const std::vector<MojoHandle>& handle_buffer, | 106 const std::vector<MojoHandle>& handle_buffer, |
107 Message* message); | 107 Message* message); |
108 static MojoResult ReadFromFileDescriptorSet(Message* message, | 108 static MojoResult ReadFromFileDescriptorSet(Message* message, |
109 std::vector<MojoHandle>* handles); | 109 std::vector<MojoHandle>* handles); |
110 | 110 |
111 #endif // defined(OS_POSIX) && !defined(OS_NACL) | 111 #endif // defined(OS_POSIX) && !defined(OS_NACL) |
112 | 112 |
113 // MojoBootstrapDelegate implementation | 113 // MojoBootstrapDelegate implementation |
114 virtual void OnPipeAvailable( | 114 virtual void OnPipeAvailable( |
115 mojo::embedder::ScopedPlatformHandle handle) OVERRIDE; | 115 mojo::embedder::ScopedPlatformHandle handle) override; |
116 virtual void OnBootstrapError() OVERRIDE; | 116 virtual void OnBootstrapError() override; |
117 | 117 |
118 // Called from MessagePipeReader implementations | 118 // Called from MessagePipeReader implementations |
119 void OnMessageReceived(Message& message); | 119 void OnMessageReceived(Message& message); |
120 void OnConnected(mojo::ScopedMessagePipeHandle pipe); | 120 void OnConnected(mojo::ScopedMessagePipeHandle pipe); |
121 void OnPipeClosed(internal::MessagePipeReader* reader); | 121 void OnPipeClosed(internal::MessagePipeReader* reader); |
122 void OnPipeError(internal::MessagePipeReader* reader); | 122 void OnPipeError(internal::MessagePipeReader* reader); |
123 void set_peer_pid(base::ProcessId pid) { peer_pid_ = pid; } | 123 void set_peer_pid(base::ProcessId pid) { peer_pid_ = pid; } |
124 | 124 |
125 protected: | 125 protected: |
126 ChannelMojo(Delegate* delegate, | 126 ChannelMojo(Delegate* delegate, |
(...skipping 27 matching lines...) Expand all Loading... |
154 ScopedVector<Message> pending_messages_; | 154 ScopedVector<Message> pending_messages_; |
155 | 155 |
156 base::WeakPtrFactory<ChannelMojo> weak_factory_; | 156 base::WeakPtrFactory<ChannelMojo> weak_factory_; |
157 | 157 |
158 DISALLOW_COPY_AND_ASSIGN(ChannelMojo); | 158 DISALLOW_COPY_AND_ASSIGN(ChannelMojo); |
159 }; | 159 }; |
160 | 160 |
161 } // namespace IPC | 161 } // namespace IPC |
162 | 162 |
163 #endif // IPC_IPC_CHANNEL_MOJO_H_ | 163 #endif // IPC_IPC_CHANNEL_MOJO_H_ |
OLD | NEW |