Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Side by Side Diff: ipc/ipc_channel.h

Issue 382333002: Introduce ChannelMojo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Renamed ChanelBuilder to ChannelFactory Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_H_ 5 #ifndef IPC_IPC_CHANNEL_H_
6 #define IPC_IPC_CHANNEL_H_ 6 #define IPC_IPC_CHANNEL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #if defined(OS_POSIX) 10 #if defined(OS_POSIX)
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 // 163 //
164 // Returns base::kNullProcessId if the peer is not connected yet. Watch out 164 // Returns base::kNullProcessId if the peer is not connected yet. Watch out
165 // for race conditions. You can easily get a channel to another process, but 165 // for race conditions. You can easily get a channel to another process, but
166 // if your process has not yet processed the "hello" message from the remote 166 // if your process has not yet processed the "hello" message from the remote
167 // side, this will fail. You should either make sure calling this is either 167 // side, this will fail. You should either make sure calling this is either
168 // in response to a message from the remote side (which guarantees that it's 168 // in response to a message from the remote side (which guarantees that it's
169 // been connected), or you wait for the "connected" notification on the 169 // been connected), or you wait for the "connected" notification on the
170 // listener. 170 // listener.
171 virtual base::ProcessId GetPeerPID() const = 0; 171 virtual base::ProcessId GetPeerPID() const = 0;
172 172
173 // Get its own process id. This value is told to the peer.
174 virtual base::ProcessId GetSelfPID() const = 0;
175
176 // Get connected ChannelHandle which the channel owns.
darin (slow to review) 2014/07/23 23:03:33 you might mention that ownership is transferred to
Hajime Morrita 2014/07/24 00:38:44 Done.
177 virtual ChannelHandle TakePipeHandle() = 0;
178
173 // Send a message over the Channel to the listener on the other end. 179 // Send a message over the Channel to the listener on the other end.
174 // 180 //
175 // |message| must be allocated using operator new. This object will be 181 // |message| must be allocated using operator new. This object will be
176 // deleted once the contents of the Message have been sent. 182 // deleted once the contents of the Message have been sent.
177 virtual bool Send(Message* message) = 0; 183 virtual bool Send(Message* message) = 0;
178 184
179 #if defined(OS_POSIX) && !defined(OS_NACL) 185 #if defined(OS_POSIX) && !defined(OS_NACL)
180 // On POSIX an IPC::Channel wraps a socketpair(), this method returns the 186 // On POSIX an IPC::Channel wraps a socketpair(), this method returns the
181 // FD # for the client end of the socket. 187 // FD # for the client end of the socket.
182 // This method may only be called on the server side of a channel. 188 // This method may only be called on the server side of a channel.
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 229
224 #if defined(OS_POSIX) 230 #if defined(OS_POSIX)
225 // SocketPair() creates a pair of socket FDs suitable for using with 231 // SocketPair() creates a pair of socket FDs suitable for using with
226 // IPC::Channel. 232 // IPC::Channel.
227 IPC_EXPORT bool SocketPair(int* fd1, int* fd2); 233 IPC_EXPORT bool SocketPair(int* fd1, int* fd2);
228 #endif 234 #endif
229 235
230 } // namespace IPC 236 } // namespace IPC
231 237
232 #endif // IPC_IPC_CHANNEL_H_ 238 #endif // IPC_IPC_CHANNEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698