OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "nacl_io/ossocket.h" | 5 #include "nacl_io/ossocket.h" |
6 #ifdef PROVIDES_SOCKET_API | 6 #ifdef PROVIDES_SOCKET_API |
7 | 7 |
8 #include <assert.h> | 8 #include <assert.h> |
9 #include <string.h> | 9 #include <string.h> |
10 #include <algorithm> | 10 #include <algorithm> |
11 | 11 |
12 #include "nacl_io/socket/unix_event_emitter.h" | 12 #include "nacl_io/socket/unix_event_emitter.h" |
13 #include "nacl_io/socket/unix_node.h" | 13 #include "nacl_io/socket/unix_node.h" |
14 | 14 |
15 namespace nacl_io { | 15 namespace nacl_io { |
16 | 16 |
17 UnixNode::UnixNode(Filesystem* filesystem) | 17 UnixNode::UnixNode(Filesystem* filesystem, int type) |
18 : SocketNode(SOCK_STREAM, filesystem), | 18 : SocketNode(SOCK_STREAM, filesystem), |
19 emitter_(UnixEventEmitter::MakeUnixEventEmitter(65536)) { | 19 emitter_(UnixEventEmitter::MakeUnixEventEmitter(65536, type)) { |
20 emitter_->AttachStream(this); | 20 emitter_->AttachStream(this); |
21 } | 21 } |
22 | 22 |
23 UnixNode::UnixNode(Filesystem* filesystem, const UnixNode& peer) | 23 UnixNode::UnixNode(Filesystem* filesystem, const UnixNode& peer) |
24 : SocketNode(SOCK_STREAM, filesystem), | 24 : SocketNode(SOCK_STREAM, filesystem), |
25 emitter_(peer.emitter_->GetPeerEmitter()) { | 25 emitter_(peer.emitter_->GetPeerEmitter()) { |
26 emitter_->AttachStream(this); | 26 emitter_->AttachStream(this); |
27 } | 27 } |
28 | 28 |
29 EventEmitter* UnixNode::GetEventEmitter() { | 29 EventEmitter* UnixNode::GetEventEmitter() { |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 const struct sockaddr* dest_addr, | 86 const struct sockaddr* dest_addr, |
87 socklen_t addrlen, | 87 socklen_t addrlen, |
88 int* out_len) { | 88 int* out_len) { |
89 PP_Resource addr = 0; | 89 PP_Resource addr = 0; |
90 return SendHelper(attr, buf, len, flags, addr, out_len); | 90 return SendHelper(attr, buf, len, flags, addr, out_len); |
91 } | 91 } |
92 | 92 |
93 } // namespace nacl_io | 93 } // namespace nacl_io |
94 | 94 |
95 #endif // PROVIDES_SOCKET_API | 95 #endif // PROVIDES_SOCKET_API |
OLD | NEW |