OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/raw_channel.h" | 5 #include "mojo/edk/system/raw_channel.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <sys/socket.h> | 8 #include <sys/socket.h> |
9 #include <sys/stat.h> | 9 #include <sys/stat.h> |
10 #include <sys/types.h> | 10 #include <sys/types.h> |
11 #include <sys/uio.h> | 11 #include <sys/uio.h> |
12 #include <unistd.h> | 12 #include <unistd.h> |
13 | 13 |
14 #include <algorithm> | 14 #include <algorithm> |
15 #include <deque> | 15 #include <deque> |
16 | 16 |
17 #include "base/bind.h" | 17 #include "base/bind.h" |
18 #include "base/location.h" | 18 #include "base/location.h" |
19 #include "base/logging.h" | 19 #include "base/logging.h" |
20 #include "base/memory/scoped_ptr.h" | 20 #include "base/memory/scoped_ptr.h" |
21 #include "base/memory/weak_ptr.h" | 21 #include "base/memory/weak_ptr.h" |
22 #include "base/message_loop/message_loop.h" | 22 #include "base/message_loop/message_loop.h" |
23 #include "base/synchronization/lock.h" | 23 #include "base/synchronization/lock.h" |
24 #include "mojo/edk/embedder/embedder_internal.h" | 24 #include "mojo/edk/embedder/embedder_internal.h" |
25 #include "mojo/edk/embedder/platform_channel_utils_posix.h" | 25 #include "mojo/edk/embedder/platform_channel_utils_posix.h" |
26 #include "mojo/edk/embedder/platform_handle.h" | 26 #include "mojo/edk/embedder/platform_handle.h" |
27 #include "mojo/edk/embedder/platform_handle_vector.h" | 27 #include "mojo/edk/embedder/platform_handle_vector.h" |
28 #include "mojo/edk/system/transport_data.h" | 28 #include "mojo/edk/system/transport_data.h" |
29 #include "mojo/public/cpp/system/macros.h" | 29 #include "third_party/mojo/src/mojo/public/cpp/system/macros.h" |
30 | 30 |
31 #if !defined(SO_PEEK_OFF) | 31 #if !defined(SO_PEEK_OFF) |
32 #define SO_PEEK_OFF 42 | 32 #define SO_PEEK_OFF 42 |
33 #endif | 33 #endif |
34 | 34 |
35 namespace mojo { | 35 namespace mojo { |
36 namespace edk { | 36 namespace edk { |
37 | 37 |
38 namespace { | 38 namespace { |
39 | 39 |
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 int id1 = 0; | 576 int id1 = 0; |
577 int id2 = 1; | 577 int id2 = 1; |
578 socklen_t peek_off_size = sizeof(id1); | 578 socklen_t peek_off_size = sizeof(id1); |
579 getsockopt(this_handle.fd, SOL_SOCKET, SO_PEEK_OFF, &id1, &peek_off_size); | 579 getsockopt(this_handle.fd, SOL_SOCKET, SO_PEEK_OFF, &id1, &peek_off_size); |
580 getsockopt(other_handle.fd, SOL_SOCKET, SO_PEEK_OFF, &id2, &peek_off_size); | 580 getsockopt(other_handle.fd, SOL_SOCKET, SO_PEEK_OFF, &id2, &peek_off_size); |
581 return id1 == id2; | 581 return id1 == id2; |
582 } | 582 } |
583 | 583 |
584 } // namespace edk | 584 } // namespace edk |
585 } // namespace mojo | 585 } // namespace mojo |
OLD | NEW |