| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "mojo/edk/system/channel.h" | 5 #include "mojo/edk/system/channel.h" |
| 6 | 6 |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <sys/uio.h> | 8 #include <sys/socket.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| 11 #include <deque> | 11 #include <deque> |
| 12 #include <limits> | 12 #include <limits> |
| 13 #include <memory> | 13 #include <memory> |
| 14 | 14 |
| 15 #include "base/bind.h" | 15 #include "base/bind.h" |
| 16 #include "base/location.h" | 16 #include "base/location.h" |
| 17 #include "base/macros.h" | 17 #include "base/macros.h" |
| 18 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
| 19 #include "base/message_loop/message_loop.h" | 19 #include "base/message_loop/message_loop.h" |
| 20 #include "base/synchronization/lock.h" | 20 #include "base/synchronization/lock.h" |
| 21 #include "base/task_runner.h" | 21 #include "base/task_runner.h" |
| 22 #include "mojo/edk/embedder/platform_channel_utils_posix.h" | 22 #include "mojo/edk/embedder/platform_channel_utils_posix.h" |
| 23 #include "mojo/edk/embedder/platform_handle_vector.h" | 23 #include "mojo/edk/embedder/platform_handle_vector.h" |
| 24 | 24 |
| 25 #if !defined(OS_NACL) |
| 26 #include <sys/uio.h> |
| 27 #endif |
| 28 |
| 25 namespace mojo { | 29 namespace mojo { |
| 26 namespace edk { | 30 namespace edk { |
| 27 | 31 |
| 28 namespace { | 32 namespace { |
| 29 | 33 |
| 30 const size_t kMaxBatchReadCapacity = 256 * 1024; | 34 const size_t kMaxBatchReadCapacity = 256 * 1024; |
| 31 | 35 |
| 32 // A view over a Channel::Message object. The write queue uses these since | 36 // A view over a Channel::Message object. The write queue uses these since |
| 33 // large messages may need to be sent in chunks. | 37 // large messages may need to be sent in chunks. |
| 34 class MessageView { | 38 class MessageView { |
| (...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 // static | 502 // static |
| 499 scoped_refptr<Channel> Channel::Create( | 503 scoped_refptr<Channel> Channel::Create( |
| 500 Delegate* delegate, | 504 Delegate* delegate, |
| 501 ScopedPlatformHandle platform_handle, | 505 ScopedPlatformHandle platform_handle, |
| 502 scoped_refptr<base::TaskRunner> io_task_runner) { | 506 scoped_refptr<base::TaskRunner> io_task_runner) { |
| 503 return new ChannelPosix(delegate, std::move(platform_handle), io_task_runner); | 507 return new ChannelPosix(delegate, std::move(platform_handle), io_task_runner); |
| 504 } | 508 } |
| 505 | 509 |
| 506 } // namespace edk | 510 } // namespace edk |
| 507 } // namespace mojo | 511 } // namespace mojo |
| OLD | NEW |