| OLD | NEW |
| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 // TODO(erikchen): Remove default parameter for |broker|. It exists only to | 162 // TODO(erikchen): Remove default parameter for |broker|. It exists only to |
| 163 // make the upcoming refactor decomposable into smaller CLs. | 163 // make the upcoming refactor decomposable into smaller CLs. |
| 164 // http://crbug.com/493414. | 164 // http://crbug.com/493414. |
| 165 static scoped_ptr<Channel> CreateServer( | 165 static scoped_ptr<Channel> CreateServer( |
| 166 const IPC::ChannelHandle& channel_handle, | 166 const IPC::ChannelHandle& channel_handle, |
| 167 Listener* listener, | 167 Listener* listener, |
| 168 AttachmentBroker* broker = nullptr); | 168 AttachmentBroker* broker = nullptr); |
| 169 | 169 |
| 170 ~Channel() override; | 170 ~Channel() override; |
| 171 | 171 |
| 172 // TODO(erikchen): Temporary code to help track http://crbug.com/527588. | |
| 173 using MessageVerifier = void (*)(const Message*); | |
| 174 static void SetMessageVerifier(MessageVerifier verifier); | |
| 175 static MessageVerifier GetMessageVerifier(); | |
| 176 | |
| 177 // Connect the pipe. On the server side, this will initiate | 172 // Connect the pipe. On the server side, this will initiate |
| 178 // waiting for connections. On the client, it attempts to | 173 // waiting for connections. On the client, it attempts to |
| 179 // connect to a pre-existing pipe. Note, calling Connect() | 174 // connect to a pre-existing pipe. Note, calling Connect() |
| 180 // will not block the calling thread and may complete | 175 // will not block the calling thread and may complete |
| 181 // asynchronously. | 176 // asynchronously. |
| 182 virtual bool Connect() WARN_UNUSED_RESULT = 0; | 177 virtual bool Connect() WARN_UNUSED_RESULT = 0; |
| 183 | 178 |
| 184 // Close this Channel explicitly. May be called multiple times. | 179 // Close this Channel explicitly. May be called multiple times. |
| 185 // On POSIX calling close on an IPC channel that listens for connections will | 180 // On POSIX calling close on an IPC channel that listens for connections will |
| 186 // cause it to close any accepted connections, and it will stop listening for | 181 // cause it to close any accepted connections, and it will stop listening for |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 | 267 |
| 273 #if defined(OS_POSIX) | 268 #if defined(OS_POSIX) |
| 274 // SocketPair() creates a pair of socket FDs suitable for using with | 269 // SocketPair() creates a pair of socket FDs suitable for using with |
| 275 // IPC::Channel. | 270 // IPC::Channel. |
| 276 IPC_EXPORT bool SocketPair(int* fd1, int* fd2); | 271 IPC_EXPORT bool SocketPair(int* fd1, int* fd2); |
| 277 #endif | 272 #endif |
| 278 | 273 |
| 279 } // namespace IPC | 274 } // namespace IPC |
| 280 | 275 |
| 281 #endif // IPC_IPC_CHANNEL_H_ | 276 #endif // IPC_IPC_CHANNEL_H_ |
| OLD | NEW |