| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "ipc/ipc_channel.h" | 9 #include "ipc/ipc_channel.h" |
| 10 | 10 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 virtual ~ChannelImpl(); | 55 virtual ~ChannelImpl(); |
| 56 bool Connect(); | 56 bool Connect(); |
| 57 void Close(); | 57 void Close(); |
| 58 void set_listener(Listener* listener) { listener_ = listener; } | 58 void set_listener(Listener* listener) { listener_ = listener; } |
| 59 bool Send(Message* message); | 59 bool Send(Message* message); |
| 60 int GetClientFileDescriptor() const; | 60 int GetClientFileDescriptor() const; |
| 61 bool AcceptsConnections() const; | 61 bool AcceptsConnections() const; |
| 62 bool HasAcceptedConnection() const; | 62 bool HasAcceptedConnection() const; |
| 63 bool GetClientEuid(uid_t* client_euid) const; | 63 bool GetClientEuid(uid_t* client_euid) const; |
| 64 void ResetToAcceptingConnectionState(); | 64 void ResetToAcceptingConnectionState(); |
| 65 static bool IsNamedServerInitialized(const std::string& channel_id); |
| 65 | 66 |
| 66 private: | 67 private: |
| 67 bool CreatePipe(const IPC::ChannelHandle& channel_handle); | 68 bool CreatePipe(const IPC::ChannelHandle& channel_handle); |
| 68 | 69 |
| 69 bool ProcessIncomingMessages(); | 70 bool ProcessIncomingMessages(); |
| 70 bool ProcessOutgoingMessages(); | 71 bool ProcessOutgoingMessages(); |
| 71 | 72 |
| 72 bool AcceptConnection(); | 73 bool AcceptConnection(); |
| 73 void ClosePipeOnError(); | 74 void ClosePipeOnError(); |
| 74 void QueueHelloMessage(); | 75 void QueueHelloMessage(); |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 152 |
| 152 // The maximum length of the name of a pipe for MODE_NAMED_SERVER or | 153 // The maximum length of the name of a pipe for MODE_NAMED_SERVER or |
| 153 // MODE_NAMED_CLIENT if you want to pass in your own socket. | 154 // MODE_NAMED_CLIENT if you want to pass in your own socket. |
| 154 // The standard size on linux is 108, mac is 104. To maintain consistency | 155 // The standard size on linux is 108, mac is 104. To maintain consistency |
| 155 // across platforms we standardize on the smaller value. | 156 // across platforms we standardize on the smaller value. |
| 156 static const size_t kMaxPipeNameLength = 104; | 157 static const size_t kMaxPipeNameLength = 104; |
| 157 | 158 |
| 158 } // namespace IPC | 159 } // namespace IPC |
| 159 | 160 |
| 160 #endif // IPC_IPC_CHANNEL_POSIX_H_ | 161 #endif // IPC_IPC_CHANNEL_POSIX_H_ |
| OLD | NEW |