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 <sys/types.h> | 10 #include <sys/types.h> |
10 | 11 |
11 #include <algorithm> | 12 #include <algorithm> |
12 | 13 |
13 #include "base/bind.h" | 14 #include "base/bind.h" |
14 #include "base/logging.h" | 15 #include "base/logging.h" |
15 #include "base/single_thread_task_runner.h" | 16 #include "base/single_thread_task_runner.h" |
16 #include "base/synchronization/lock.h" | 17 #include "base/synchronization/lock.h" |
17 #include "base/task_runner_util.h" | 18 #include "base/task_runner_util.h" |
18 #include "base/thread_task_runner_handle.h" | 19 #include "base/thread_task_runner_handle.h" |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 } | 352 } |
352 } | 353 } |
353 return READ_SUCCEEDED; | 354 return READ_SUCCEEDED; |
354 } | 355 } |
355 | 356 |
356 bool ChannelNacl::ShouldDispatchInputMessage(Message* msg) { | 357 bool ChannelNacl::ShouldDispatchInputMessage(Message* msg) { |
357 return true; | 358 return true; |
358 } | 359 } |
359 | 360 |
360 bool ChannelNacl::GetNonBrokeredAttachments(Message* msg) { | 361 bool ChannelNacl::GetNonBrokeredAttachments(Message* msg) { |
361 uint16 header_fds = msg->header()->num_fds; | 362 uint16_t header_fds = msg->header()->num_fds; |
362 CHECK(header_fds == input_fds_.size()); | 363 CHECK(header_fds == input_fds_.size()); |
363 if (header_fds == 0) | 364 if (header_fds == 0) |
364 return true; // Nothing to do. | 365 return true; // Nothing to do. |
365 | 366 |
366 // The shenaniganery below with &foo.front() requires input_fds_ to have | 367 // The shenaniganery below with &foo.front() requires input_fds_ to have |
367 // contiguous underlying storage (such as a simple array or a std::vector). | 368 // contiguous underlying storage (such as a simple array or a std::vector). |
368 // This is why the header warns not to make input_fds_ a deque<>. | 369 // This is why the header warns not to make input_fds_ a deque<>. |
369 msg->attachment_set()->AddDescriptorsToOwn(&input_fds_.front(), header_fds); | 370 msg->attachment_set()->AddDescriptorsToOwn(&input_fds_.front(), header_fds); |
370 input_fds_.clear(); | 371 input_fds_.clear(); |
371 return true; | 372 return true; |
(...skipping 25 matching lines...) Expand all Loading... |
397 // static | 398 // static |
398 scoped_ptr<Channel> Channel::Create(const IPC::ChannelHandle& channel_handle, | 399 scoped_ptr<Channel> Channel::Create(const IPC::ChannelHandle& channel_handle, |
399 Mode mode, | 400 Mode mode, |
400 Listener* listener, | 401 Listener* listener, |
401 AttachmentBroker* broker) { | 402 AttachmentBroker* broker) { |
402 return scoped_ptr<Channel>( | 403 return scoped_ptr<Channel>( |
403 new ChannelNacl(channel_handle, mode, listener, broker)); | 404 new ChannelNacl(channel_handle, mode, listener, broker)); |
404 } | 405 } |
405 | 406 |
406 } // namespace IPC | 407 } // namespace IPC |
OLD | NEW |