Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Side by Side Diff: native_client_sdk/src/libraries/nacl_io/socket/unix_node.cc

Issue 1679643002: nacl_io: Add SOCK_DGRAM support to socketpair() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: code review feedback Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « native_client_sdk/src/libraries/nacl_io/socket/unix_node.h ('k') | native_client_sdk/src/tests/nacl_io_test/socket_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698