| 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_POSIX_H_ | 5 #ifndef IPC_IPC_CHANNEL_POSIX_H_ |
| 6 #define IPC_IPC_CHANNEL_POSIX_H_ | 6 #define IPC_IPC_CHANNEL_POSIX_H_ |
| 7 | 7 |
| 8 #include "ipc/ipc_channel.h" | 8 #include "ipc/ipc_channel.h" |
| 9 | 9 |
| 10 #include <sys/socket.h> // for CMSG macros | 10 #include <sys/socket.h> // for CMSG macros |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 void QueueHelloMessage(); | 76 void QueueHelloMessage(); |
| 77 void CloseFileDescriptors(Message* msg); | 77 void CloseFileDescriptors(Message* msg); |
| 78 void QueueCloseFDMessage(int fd, int hops); | 78 void QueueCloseFDMessage(int fd, int hops); |
| 79 | 79 |
| 80 // ChannelReader implementation. | 80 // ChannelReader implementation. |
| 81 ReadState ReadData(char* buffer, int buffer_len, int* bytes_read) override; | 81 ReadState ReadData(char* buffer, int buffer_len, int* bytes_read) override; |
| 82 bool ShouldDispatchInputMessage(Message* msg) override; | 82 bool ShouldDispatchInputMessage(Message* msg) override; |
| 83 bool GetNonBrokeredAttachments(Message* msg) override; | 83 bool GetNonBrokeredAttachments(Message* msg) override; |
| 84 bool DidEmptyInputBuffers() override; | 84 bool DidEmptyInputBuffers() override; |
| 85 void HandleInternalMessage(const Message& msg) override; | 85 void HandleInternalMessage(const Message& msg) override; |
| 86 base::ProcessId GetSenderPID() override; |
| 86 | 87 |
| 87 // Finds the set of file descriptors in the given message. On success, | 88 // Finds the set of file descriptors in the given message. On success, |
| 88 // appends the descriptors to the input_fds_ member and returns true | 89 // appends the descriptors to the input_fds_ member and returns true |
| 89 // | 90 // |
| 90 // Returns false if the message was truncated. In this case, any handles that | 91 // Returns false if the message was truncated. In this case, any handles that |
| 91 // were sent will be closed. | 92 // were sent will be closed. |
| 92 bool ExtractFileDescriptorsFromMsghdr(msghdr* msg); | 93 bool ExtractFileDescriptorsFromMsghdr(msghdr* msg); |
| 93 | 94 |
| 94 // Closes all handles in the input_fds_ list and clears the list. This is | 95 // Closes all handles in the input_fds_ list and clears the list. This is |
| 95 // used to clean up handles in error conditions to avoid leaking the handles. | 96 // used to clean up handles in error conditions to avoid leaking the handles. |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 | 183 |
| 183 // |broker_| must outlive this instance. | 184 // |broker_| must outlive this instance. |
| 184 AttachmentBroker* broker_; | 185 AttachmentBroker* broker_; |
| 185 | 186 |
| 186 DISALLOW_IMPLICIT_CONSTRUCTORS(ChannelPosix); | 187 DISALLOW_IMPLICIT_CONSTRUCTORS(ChannelPosix); |
| 187 }; | 188 }; |
| 188 | 189 |
| 189 } // namespace IPC | 190 } // namespace IPC |
| 190 | 191 |
| 191 #endif // IPC_IPC_CHANNEL_POSIX_H_ | 192 #endif // IPC_IPC_CHANNEL_POSIX_H_ |
| OLD | NEW |