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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 main_task_runner_->PostTask(FROM_HERE, failure_callback_); | 116 main_task_runner_->PostTask(FROM_HERE, failure_callback_); |
117 // Because the read failed, we know we're going to quit. Don't bother | 117 // Because the read failed, we know we're going to quit. Don't bother |
118 // trying to read again. | 118 // trying to read again. |
119 return; | 119 return; |
120 } | 120 } |
121 } | 121 } |
122 } | 122 } |
123 | 123 |
124 ChannelNacl::ChannelNacl(const IPC::ChannelHandle& channel_handle, | 124 ChannelNacl::ChannelNacl(const IPC::ChannelHandle& channel_handle, |
125 Mode mode, | 125 Mode mode, |
126 Listener* listener, | 126 Listener* listener) |
127 AttachmentBroker* broker) | |
128 : ChannelReader(listener), | 127 : ChannelReader(listener), |
129 mode_(mode), | 128 mode_(mode), |
130 waiting_connect_(true), | 129 waiting_connect_(true), |
131 pipe_(-1), | 130 pipe_(-1), |
132 pipe_name_(channel_handle.name), | 131 pipe_name_(channel_handle.name), |
133 weak_ptr_factory_(this) { | 132 weak_ptr_factory_(this) { |
134 if (!CreatePipe(channel_handle)) { | 133 if (!CreatePipe(channel_handle)) { |
135 // The pipe may have been closed already. | 134 // The pipe may have been closed already. |
136 const char *modestr = (mode_ & MODE_SERVER_FLAG) ? "server" : "client"; | 135 const char *modestr = (mode_ & MODE_SERVER_FLAG) ? "server" : "client"; |
137 LOG(WARNING) << "Unable to create pipe named \"" << channel_handle.name | 136 LOG(WARNING) << "Unable to create pipe named \"" << channel_handle.name |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 | 390 |
392 bool ChannelNacl::IsAttachmentBrokerEndpoint() { | 391 bool ChannelNacl::IsAttachmentBrokerEndpoint() { |
393 return is_attachment_broker_endpoint(); | 392 return is_attachment_broker_endpoint(); |
394 } | 393 } |
395 | 394 |
396 // Channel's methods | 395 // Channel's methods |
397 | 396 |
398 // static | 397 // static |
399 scoped_ptr<Channel> Channel::Create(const IPC::ChannelHandle& channel_handle, | 398 scoped_ptr<Channel> Channel::Create(const IPC::ChannelHandle& channel_handle, |
400 Mode mode, | 399 Mode mode, |
401 Listener* listener, | 400 Listener* listener) { |
402 AttachmentBroker* broker) { | 401 return scoped_ptr<Channel>(new ChannelNacl(channel_handle, mode, listener)); |
403 return scoped_ptr<Channel>( | |
404 new ChannelNacl(channel_handle, mode, listener, broker)); | |
405 } | 402 } |
406 | 403 |
407 } // namespace IPC | 404 } // namespace IPC |
OLD | NEW |