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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 #if defined(OS_POSIX) && !defined(OS_NACL) | 81 #if defined(OS_POSIX) && !defined(OS_NACL) |
82 virtual int GetClientFileDescriptor() const OVERRIDE; | 82 virtual int GetClientFileDescriptor() const OVERRIDE; |
83 virtual int TakeClientFileDescriptor() OVERRIDE; | 83 virtual int TakeClientFileDescriptor() OVERRIDE; |
84 | 84 |
85 // These access protected API of IPC::Message, which has ChannelMojo | 85 // These access protected API of IPC::Message, which has ChannelMojo |
86 // as a friend class. | 86 // as a friend class. |
87 static MojoResult WriteToFileDescriptorSet( | 87 static MojoResult WriteToFileDescriptorSet( |
88 const std::vector<MojoHandle>& handle_buffer, | 88 const std::vector<MojoHandle>& handle_buffer, |
89 Message* message); | 89 Message* message); |
90 static MojoResult ReadFromFileDescriptorSet(const Message& message, | 90 static MojoResult ReadFromFileDescriptorSet(Message* message, |
91 std::vector<MojoHandle>* handles); | 91 std::vector<MojoHandle>* handles); |
92 | 92 |
93 #endif // defined(OS_POSIX) && !defined(OS_NACL) | 93 #endif // defined(OS_POSIX) && !defined(OS_NACL) |
94 | 94 |
95 // Called from MessagePipeReader implementations | 95 // Called from MessagePipeReader implementations |
96 void OnMessageReceived(Message& message); | 96 void OnMessageReceived(Message& message); |
97 void OnConnected(mojo::ScopedMessagePipeHandle pipe); | 97 void OnConnected(mojo::ScopedMessagePipeHandle pipe); |
98 void OnPipeClosed(internal::MessagePipeReader* reader); | 98 void OnPipeClosed(internal::MessagePipeReader* reader); |
99 void OnPipeError(internal::MessagePipeReader* reader); | 99 void OnPipeError(internal::MessagePipeReader* reader); |
100 void set_peer_pid(base::ProcessId pid) { peer_pid_ = pid; } | 100 void set_peer_pid(base::ProcessId pid) { peer_pid_ = pid; } |
(...skipping 28 matching lines...) Expand all Loading... |
129 ScopedVector<Message> pending_messages_; | 129 ScopedVector<Message> pending_messages_; |
130 | 130 |
131 base::WeakPtrFactory<ChannelMojo> weak_factory_; | 131 base::WeakPtrFactory<ChannelMojo> weak_factory_; |
132 | 132 |
133 DISALLOW_COPY_AND_ASSIGN(ChannelMojo); | 133 DISALLOW_COPY_AND_ASSIGN(ChannelMojo); |
134 }; | 134 }; |
135 | 135 |
136 } // namespace IPC | 136 } // namespace IPC |
137 | 137 |
138 #endif // IPC_IPC_CHANNEL_MOJO_H_ | 138 #endif // IPC_IPC_CHANNEL_MOJO_H_ |
OLD | NEW |