| 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 #include "ipc/ipc_channel_nacl.h" | 5 #include "ipc/ipc_channel_nacl.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <sys/nacl_imc_api.h> | 9 #include <sys/nacl_imc_api.h> |
| 10 #include <sys/nacl_syscalls.h> | 10 #include <sys/nacl_syscalls.h> |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 | 186 |
| 187 bool Channel::ChannelImpl::Send(Message* message) { | 187 bool Channel::ChannelImpl::Send(Message* message) { |
| 188 DVLOG(2) << "sending message @" << message << " on channel @" << this | 188 DVLOG(2) << "sending message @" << message << " on channel @" << this |
| 189 << " with type " << message->type(); | 189 << " with type " << message->type(); |
| 190 scoped_ptr<Message> message_ptr(message); | 190 scoped_ptr<Message> message_ptr(message); |
| 191 | 191 |
| 192 #ifdef IPC_MESSAGE_LOG_ENABLED | 192 #ifdef IPC_MESSAGE_LOG_ENABLED |
| 193 Logging::GetInstance()->OnSendMessage(message_ptr.get(), ""); | 193 Logging::GetInstance()->OnSendMessage(message_ptr.get(), ""); |
| 194 #endif // IPC_MESSAGE_LOG_ENABLED | 194 #endif // IPC_MESSAGE_LOG_ENABLED |
| 195 | 195 |
| 196 message->TraceMessageStep(); |
| 196 output_queue_.push_back(linked_ptr<Message>(message_ptr.release())); | 197 output_queue_.push_back(linked_ptr<Message>(message_ptr.release())); |
| 197 if (!waiting_connect_) | 198 if (!waiting_connect_) |
| 198 return ProcessOutgoingMessages(); | 199 return ProcessOutgoingMessages(); |
| 199 | 200 |
| 200 return true; | 201 return true; |
| 201 } | 202 } |
| 202 | 203 |
| 203 void Channel::ChannelImpl::DidRecvMsg(scoped_ptr<MessageContents> contents) { | 204 void Channel::ChannelImpl::DidRecvMsg(scoped_ptr<MessageContents> contents) { |
| 204 // Close sets the pipe to -1. It's possible we'll get a buffer sent to us from | 205 // Close sets the pipe to -1. It's possible we'll get a buffer sent to us from |
| 205 // the reader thread after Close is called. If so, we ignore it. | 206 // the reader thread after Close is called. If so, we ignore it. |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 // A random name is sufficient validation on posix systems, so we don't need | 388 // A random name is sufficient validation on posix systems, so we don't need |
| 388 // an additional shared secret. | 389 // an additional shared secret. |
| 389 std::string id = prefix; | 390 std::string id = prefix; |
| 390 if (!id.empty()) | 391 if (!id.empty()) |
| 391 id.append("."); | 392 id.append("."); |
| 392 | 393 |
| 393 return id.append(GenerateUniqueRandomChannelID()); | 394 return id.append(GenerateUniqueRandomChannelID()); |
| 394 } | 395 } |
| 395 | 396 |
| 396 } // namespace IPC | 397 } // namespace IPC |
| OLD | NEW |