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

Issue 23498015: [NaCl SDK] Support non blocking TCP/UDP (Closed)

Created:
7 years, 3 months ago by noelallen1
Modified:
7 years, 3 months ago
Reviewers:
binji, Sam Clegg
CC:
chromium-reviews, binji
Visibility:
Public.

Description

[NaCl SDK] Support non blocking TCP/UDP for NaCl IO library in NaCl SDK. Does not affect chrome itself. This change bring in support for non-blocking TCP and UDP send and recv. This requires rework of EventEmitter, EventListner splitting them out of the MountNode so that the MountNode (socket) could be de-ref'd and closed, while the Emitter (fifo) was still available to accept IO cancellations. Part of the split out, also simplified EventListener use. Now listeners are per thread and RefCount emitters (not Nodes) significantly simplifying lifetime issues and reducing emitter/listener code complexity. In addition, the simplified locking allows for one-to-one Listeners to share locks with the emitter, for cases like read from UDP, where multiple threads could legally block on RecvFrom, and must only make progress one at a time to ensure correct timeout. Adds 'pipe', 'packet' and 'signal' Emitters to support pipes, udp sockets, and IO interruption (EINTR) via 'kill'. * split out EventEmitter and EventListener from MountNode * Remove ScopedRef from EventListener * Remove EventInfo * Create EventEmitterPipe (Emitter + FIFOChar) * Create EventEmitterTCP (Emitter + FIFOChar * 2) * Create EventEmitterUDP (Emitter + FIFOPacket * 2) * Create MountNodeStream base class * Create MountNodeSocket from MountNodeStream * Create MountNodePipe * Rename MountSocket to MountStream * Add plumbing for pipe * select uses poll functionality * move all send/recv on sockets to MountStream thread. BUG=257723 R=binji@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=224603

Patch Set 1 #

Patch Set 2 : Pipe Support #

Patch Set 3 : Test pass #

Patch Set 4 : Cleaned up #

Patch Set 5 : Merge #

Patch Set 6 : Merge emitter changes #

Total comments: 17

Patch Set 7 : Update EmitterEventLock (remove AutoUnlock) #

Patch Set 8 : Remove event friends, rename EventListenerPoll #

Total comments: 126

Patch Set 9 : Fix issues, merge stream changes #

Patch Set 10 : Fix select TTY #

Patch Set 11 : Added Fifo Tests #

Total comments: 103

Patch Set 12 : Merge and fix Ben's issues #

Patch Set 13 : Fix SBC issues #

Patch Set 14 : Fix SBC issues #

Patch Set 15 : Merge #

Total comments: 16

Patch Set 16 : Disable TCP test bots #

Patch Set 17 : Fixed issues, UDP ok, dbing TCP #

Total comments: 28

Patch Set 18 : Fixed issues + TCP #

Patch Set 19 : Fix event test cleanup #

Patch Set 20 : Merge #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2918 lines, -1769 lines) Patch
M native_client_sdk/src/libraries/nacl_io/event_emitter.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +29 lines, -56 lines 0 comments Download
M native_client_sdk/src/libraries/nacl_io/event_emitter.cc View 1 2 3 4 5 6 7 8 1 chunk +30 lines, -30 lines 0 comments Download
A native_client_sdk/src/libraries/nacl_io/event_emitter_pipe.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +41 lines, -0 lines 0 comments Download
A native_client_sdk/src/libraries/nacl_io/event_emitter_pipe.cc View 1 2 3 4 5 6 7 8 1 chunk +33 lines, -0 lines 0 comments Download
A native_client_sdk/src/libraries/nacl_io/event_emitter_stream.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +43 lines, -0 lines 0 comments Download
A native_client_sdk/src/libraries/nacl_io/event_emitter_stream.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +45 lines, -0 lines 0 comments Download
A native_client_sdk/src/libraries/nacl_io/event_emitter_tcp.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +41 lines, -0 lines 0 comments Download
A native_client_sdk/src/libraries/nacl_io/event_emitter_tcp.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +53 lines, -0 lines 0 comments Download
A native_client_sdk/src/libraries/nacl_io/event_emitter_tty.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +43 lines, -0 lines 0 comments Download
A native_client_sdk/src/libraries/nacl_io/event_emitter_tty.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +33 lines, -0 lines 0 comments Download
A native_client_sdk/src/libraries/nacl_io/event_emitter_udp.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +42 lines, -0 lines 0 comments Download
A native_client_sdk/src/libraries/nacl_io/event_emitter_udp.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +49 lines, -0 lines 0 comments Download
M native_client_sdk/src/libraries/nacl_io/event_listener.h View 1 2 3 4 5 6 7 8 3 chunks +103 lines, -80 lines 0 comments Download
M native_client_sdk/src/libraries/nacl_io/event_listener.cc View 1 2 3 4 5 6 7 8 2 chunks +92 lines, -173 lines 0 comments Download
A native_client_sdk/src/libraries/nacl_io/fifo_char.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +54 lines, -0 lines 0 comments Download
A native_client_sdk/src/libraries/nacl_io/fifo_char.cc View 1 2 3 4 5 6 7 8 1 chunk +120 lines, -0 lines 0 comments Download
A native_client_sdk/src/libraries/nacl_io/fifo_interface.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +32 lines, -0 lines 0 comments Download
A native_client_sdk/src/libraries/nacl_io/fifo_null.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +29 lines, -0 lines 0 comments Download
A native_client_sdk/src/libraries/nacl_io/fifo_packet.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +59 lines, -0 lines 0 comments Download
A native_client_sdk/src/libraries/nacl_io/fifo_packet.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +72 lines, -0 lines 0 comments Download
M native_client_sdk/src/libraries/nacl_io/kernel_intercept.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M native_client_sdk/src/libraries/nacl_io/kernel_intercept.cc View 1 1 chunk +5 lines, -0 lines 0 comments Download
M native_client_sdk/src/libraries/nacl_io/kernel_object.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M native_client_sdk/src/libraries/nacl_io/kernel_proxy.h View 1 2 3 4 5 6 7 8 5 chunks +6 lines, -5 lines 0 comments Download
M native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 9 chunks +144 lines, -177 lines 0 comments Download
M native_client_sdk/src/libraries/nacl_io/library.dsc View 1 2 3 4 5 6 7 8 9 10 11 6 chunks +23 lines, -2 lines 0 comments Download
M native_client_sdk/src/libraries/nacl_io/mount_node.h View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -2 lines 0 comments Download
M native_client_sdk/src/libraries/nacl_io/mount_node.cc View 1 2 3 4 5 6 7 8 1 chunk +6 lines, -5 lines 0 comments Download
M native_client_sdk/src/libraries/nacl_io/mount_node_char.h View 1 1 chunk +0 lines, -4 lines 0 comments Download
A native_client_sdk/src/libraries/nacl_io/mount_node_pipe.h View 1 2 3 4 5 6 7 8 1 chunk +35 lines, -0 lines 0 comments Download
A native_client_sdk/src/libraries/nacl_io/mount_node_pipe.cc View 1 2 3 4 5 6 7 8 1 chunk +61 lines, -0 lines 0 comments Download
M native_client_sdk/src/libraries/nacl_io/mount_node_socket.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 6 chunks +45 lines, -7 lines 0 comments Download
M native_client_sdk/src/libraries/nacl_io/mount_node_socket.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 11 chunks +133 lines, -21 lines 0 comments Download
A native_client_sdk/src/libraries/nacl_io/mount_node_stream.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +62 lines, -0 lines 0 comments Download
A native_client_sdk/src/libraries/nacl_io/mount_node_stream.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +58 lines, -0 lines 0 comments Download
M native_client_sdk/src/libraries/nacl_io/mount_node_tcp.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +20 lines, -17 lines 0 comments Download
M native_client_sdk/src/libraries/nacl_io/mount_node_tcp.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 3 chunks +190 lines, -64 lines 0 comments Download
M native_client_sdk/src/libraries/nacl_io/mount_node_tty.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +4 lines, -10 lines 0 comments Download
M native_client_sdk/src/libraries/nacl_io/mount_node_tty.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 7 chunks +35 lines, -23 lines 0 comments Download
M native_client_sdk/src/libraries/nacl_io/mount_node_udp.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +20 lines, -29 lines 0 comments Download
M native_client_sdk/src/libraries/nacl_io/mount_node_udp.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 3 chunks +207 lines, -112 lines 0 comments Download
D native_client_sdk/src/libraries/nacl_io/mount_socket.h View 1 1 chunk +0 lines, -37 lines 0 comments Download
D native_client_sdk/src/libraries/nacl_io/mount_socket.cc View 1 1 chunk +0 lines, -28 lines 0 comments Download
A native_client_sdk/src/libraries/nacl_io/mount_stream.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +81 lines, -0 lines 0 comments Download
A native_client_sdk/src/libraries/nacl_io/mount_stream.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +102 lines, -0 lines 0 comments Download
A native_client_sdk/src/libraries/nacl_io/packet.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +45 lines, -0 lines 0 comments Download
A native_client_sdk/src/libraries/nacl_io/packet.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +41 lines, -0 lines 0 comments Download
M native_client_sdk/src/libraries/nacl_io/pepper/all_interfaces.h View 1 2 3 4 5 6 7 8 1 chunk +12 lines, -0 lines 0 comments Download
A + native_client_sdk/src/libraries/nacl_io/syscalls/pipe.c View 1 1 chunk +2 lines, -2 lines 0 comments Download
M native_client_sdk/src/libraries/sdk_util/simple_lock.h View 1 2 3 4 5 1 chunk +3 lines, -0 lines 0 comments Download
D native_client_sdk/src/tests/nacl_io_socket_test/event_test.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -480 lines 0 comments Download
M native_client_sdk/src/tests/nacl_io_socket_test/socket_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +49 lines, -4 lines 0 comments Download
M native_client_sdk/src/tests/nacl_io_test/event_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +220 lines, -390 lines 0 comments Download
M native_client_sdk/src/tests/nacl_io_test/example.dsc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
A native_client_sdk/src/tests/nacl_io_test/fifo_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +130 lines, -0 lines 0 comments Download
M native_client_sdk/src/tests/nacl_io_test/kernel_proxy_mock.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M native_client_sdk/src/tests/nacl_io_test/kernel_wrap_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +7 lines, -0 lines 0 comments Download
M native_client_sdk/src/tests/nacl_io_test/mount_node_tty_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 5 chunks +121 lines, -11 lines 0 comments Download

Messages

Total messages: 19 (0 generated)
noelallen1
ptal
7 years, 3 months ago (2013-09-06 22:47:19 UTC) #1
binji
sorry this took so long. :) https://codereview.chromium.org/23498015/diff/14001/native_client_sdk/src/libraries/nacl_io/event_emitter_packet.h File native_client_sdk/src/libraries/nacl_io/event_emitter_packet.h (right): https://codereview.chromium.org/23498015/diff/14001/native_client_sdk/src/libraries/nacl_io/event_emitter_packet.h#newcode24 native_client_sdk/src/libraries/nacl_io/event_emitter_packet.h:24: EventEmitterPacket(size_t rsize, size_t ...
7 years, 3 months ago (2013-09-12 01:47:56 UTC) #2
noelallen1
Fixed nits. Add EventEmitterStream as parent for: EventEmitterUDP (EventEmitterPacket) EventEmitterTCP (New) EventEmitterPipe Added FifoInterface as ...
7 years, 3 months ago (2013-09-12 23:19:02 UTC) #3
noelallen1
ptal - final merge, contains test, tty fixes, and event/socket changes.
7 years, 3 months ago (2013-09-13 22:51:39 UTC) #4
binji
https://codereview.chromium.org/23498015/diff/47001/native_client_sdk/src/libraries/nacl_io/event_emitter.h File native_client_sdk/src/libraries/nacl_io/event_emitter.h (right): https://codereview.chromium.org/23498015/diff/47001/native_client_sdk/src/libraries/nacl_io/event_emitter.h#newcode44 native_client_sdk/src/libraries/nacl_io/event_emitter.h:44: // This returns a snapshot, to ensure the status ...
7 years, 3 months ago (2013-09-15 22:18:58 UTC) #5
Sam Clegg
I get two compile errors trying to build with this CL: kDefaultFifoSize not used. ~EventEmitterTCP() ...
7 years, 3 months ago (2013-09-16 12:59:05 UTC) #6
Sam Clegg
On 2013/09/16 12:59:05, Sam Clegg wrote: > I get two compile errors trying to build ...
7 years, 3 months ago (2013-09-16 16:50:05 UTC) #7
Sam Clegg
On 2013/09/16 16:50:05, Sam Clegg wrote: > On 2013/09/16 12:59:05, Sam Clegg wrote: > > ...
7 years, 3 months ago (2013-09-16 18:03:32 UTC) #8
Sam Clegg
On 2013/09/16 18:03:32, Sam Clegg wrote: > On 2013/09/16 16:50:05, Sam Clegg wrote: > > ...
7 years, 3 months ago (2013-09-17 14:45:12 UTC) #9
noelallen1
Thanks Sam, I came to the same conclusion. ptal https://codereview.chromium.org/23498015/diff/47001/native_client_sdk/src/libraries/nacl_io/event_emitter.h File native_client_sdk/src/libraries/nacl_io/event_emitter.h (right): https://codereview.chromium.org/23498015/diff/47001/native_client_sdk/src/libraries/nacl_io/event_emitter.h#newcode44 native_client_sdk/src/libraries/nacl_io/event_emitter.h:44: ...
7 years, 3 months ago (2013-09-17 21:21:53 UTC) #10
binji
https://codereview.chromium.org/23498015/diff/47001/native_client_sdk/src/libraries/nacl_io/mount_node_tcp.cc File native_client_sdk/src/libraries/nacl_io/mount_node_tcp.cc (right): https://codereview.chromium.org/23498015/diff/47001/native_client_sdk/src/libraries/nacl_io/mount_node_tcp.cc#newcode157 native_client_sdk/src/libraries/nacl_io/mount_node_tcp.cc:157: On 2013/09/17 21:21:54, noelallen1 wrote: > On 2013/09/15 22:18:58, ...
7 years, 3 months ago (2013-09-19 00:48:54 UTC) #11
noelallen1
Consolidated Send/Recv locking, waiting, and errors into MountNodeSocket. Updated error handling in UDP & TCP ...
7 years, 3 months ago (2013-09-19 21:29:26 UTC) #12
binji
https://codereview.chromium.org/23498015/diff/1029/native_client_sdk/src/libraries/nacl_io/mount_node_udp.cc File native_client_sdk/src/libraries/nacl_io/mount_node_udp.cc (right): https://codereview.chromium.org/23498015/diff/1029/native_client_sdk/src/libraries/nacl_io/mount_node_udp.cc#newcode295 native_client_sdk/src/libraries/nacl_io/mount_node_udp.cc:295: bool same = IsEquivalentAddress(addr, remote_addr_); This behavior is gone ...
7 years, 3 months ago (2013-09-19 22:40:25 UTC) #13
noelallen1
ptal I'm going to circle back on Packet constructor thing on another CL when I ...
7 years, 3 months ago (2013-09-20 00:51:26 UTC) #14
binji
OK, lgtm. :)
7 years, 3 months ago (2013-09-20 00:59:32 UTC) #15
binji
Oh, BTW. Take a look at the CL description -- it seems like it may ...
7 years, 3 months ago (2013-09-20 01:00:22 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/noelallen@chromium.org/23498015/133001
7 years, 3 months ago (2013-09-20 19:09:25 UTC) #17
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) sync_integration_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&number=200491
7 years, 3 months ago (2013-09-21 00:25:04 UTC) #18
noelallen1
7 years, 3 months ago (2013-09-21 17:17:40 UTC) #19
Message was sent while issue was closed.
Committed patchset #20 manually as r224603 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698