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 <stdint.h> | 9 #include <stdint.h> |
10 #include <sys/types.h> | 10 #include <sys/types.h> |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 read_queue_.clear(); | 192 read_queue_.clear(); |
193 output_queue_.clear(); | 193 output_queue_.clear(); |
194 } | 194 } |
195 | 195 |
196 bool ChannelNacl::Send(Message* message) { | 196 bool ChannelNacl::Send(Message* message) { |
197 DCHECK(!message->HasAttachments()); | 197 DCHECK(!message->HasAttachments()); |
198 DVLOG(2) << "sending message @" << message << " on channel @" << this | 198 DVLOG(2) << "sending message @" << message << " on channel @" << this |
199 << " with type " << message->type(); | 199 << " with type " << message->type(); |
200 std::unique_ptr<Message> message_ptr(message); | 200 std::unique_ptr<Message> message_ptr(message); |
201 | 201 |
202 #if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) | 202 #ifdef IPC_MESSAGE_LOG_ENABLED |
203 Logging::GetInstance()->OnSendMessage(message_ptr.get()); | 203 Logging::GetInstance()->OnSendMessage(message_ptr.get()); |
204 #endif // BUILDFLAG(IPC_MESSAGE_LOG_ENABLED) | 204 #endif // IPC_MESSAGE_LOG_ENABLED |
205 | 205 |
206 TRACE_EVENT_WITH_FLOW0(TRACE_DISABLED_BY_DEFAULT("ipc.flow"), | 206 TRACE_EVENT_WITH_FLOW0(TRACE_DISABLED_BY_DEFAULT("ipc.flow"), |
207 "ChannelNacl::Send", | 207 "ChannelNacl::Send", |
208 message->header()->flags, | 208 message->header()->flags, |
209 TRACE_EVENT_FLAG_FLOW_OUT); | 209 TRACE_EVENT_FLAG_FLOW_OUT); |
210 output_queue_.push_back(std::move(message_ptr)); | 210 output_queue_.push_back(std::move(message_ptr)); |
211 if (!waiting_connect_) | 211 if (!waiting_connect_) |
212 return ProcessOutgoingMessages(); | 212 return ProcessOutgoingMessages(); |
213 | 213 |
214 return true; | 214 return true; |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 | 383 |
384 // static | 384 // static |
385 std::unique_ptr<Channel> Channel::Create( | 385 std::unique_ptr<Channel> Channel::Create( |
386 const IPC::ChannelHandle& channel_handle, | 386 const IPC::ChannelHandle& channel_handle, |
387 Mode mode, | 387 Mode mode, |
388 Listener* listener) { | 388 Listener* listener) { |
389 return base::MakeUnique<ChannelNacl>(channel_handle, mode, listener); | 389 return base::MakeUnique<ChannelNacl>(channel_handle, mode, listener); |
390 } | 390 } |
391 | 391 |
392 } // namespace IPC | 392 } // namespace IPC |
OLD | NEW |