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

Issue 8965053: Implement support for a cancelable SyncSocket. (Closed)

Created:
9 years ago by tommi (sloooow) - chröme
Modified:
8 years, 11 months ago
CC:
chromium-reviews, hclam+watch_chromium.org, ddorwin+watch_chromium.org, fischman+watch_chromium.org, jam, Paweł Hajdan Jr., acolwell+watch_chromium.org, annacc+watch_chromium.org, dpranke-watch+content_chromium.org, joi+watch-content_chromium.org, brettw-cc_chromium.org, vrk (LEFT CHROMIUM), scherkus (not reviewing), ihf+watch_chromium.org
Visibility:
Public.

Description

Implement support for a cancelable SyncSocket. Currently, blocking SyncSocket operations can not be unblocked from other threads, but this is now supported by using the CancelableSyncSocket class. The implementation on Mac and Linux is very simple and basically consists of adding a call to shutdown(). On Windows however things are a tiny bit more complex since we use named pipes with synchronous IO and canceling synchronous IO is simply not possible on XP and arguably tricky on Vista+. So, what we do instead is to use asynchronous IO in a synchronous fashion to support the SyncSocket semantics and as well as allowing the connection to be correctly shut down from another thread. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=119051

Patch Set 1 #

Patch Set 2 : Build issues #

Patch Set 3 : Fix build error and a bug in WASAPIAudioOutputStreamTestMono #

Patch Set 4 : Using a single event for file operations on Windows. Some comment improvements. #

Total comments: 1

Patch Set 5 : Rebase and fix merges #

Total comments: 8

Patch Set 6 : Addressing review comments #

Patch Set 7 : Add CreatePair explicitly to CancelableSyncSocket and fix bug in the posix Receive implementation #

Total comments: 2

Patch Set 8 : addressed micro-nit #

Unified diffs Side-by-side diffs Delta from patch set Stats (+308 lines, -124 lines) Patch
M base/sync_socket.h View 1 2 3 4 5 6 7 4 chunks +53 lines, -10 lines 0 comments Download
M base/sync_socket_posix.cc View 1 2 3 4 5 6 5 chunks +37 lines, -24 lines 0 comments Download
M base/sync_socket_win.cc View 1 2 3 4 5 5 chunks +154 lines, -53 lines 0 comments Download
M content/browser/renderer_host/media/audio_input_sync_writer.cc View 5 1 chunk +3 lines, -7 lines 0 comments Download
M content/browser/renderer_host/media/audio_sync_reader.cc View 5 1 chunk +3 lines, -7 lines 0 comments Download
M content/renderer/pepper_plugin_delegate_impl.cc View 1 2 3 4 5 1 chunk +5 lines, -7 lines 0 comments Download
M ipc/sync_socket_unittest.cc View 1 2 3 4 5 4 chunks +49 lines, -10 lines 0 comments Download
M media/audio/win/audio_output_win_unittest.cc View 1 2 3 4 5 3 chunks +4 lines, -6 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
tommi (sloooow) - chröme
9 years ago (2011-12-21 13:08:02 UTC) #1
Ami GONE FROM CHROMIUM
drive-by http://codereview.chromium.org/8965053/diff/9002/base/sync_socket_posix.cc File base/sync_socket_posix.cc (right): http://codereview.chromium.org/8965053/diff/9002/base/sync_socket_posix.cc#newcode126 base/sync_socket_posix.cc:126: return HANDLE_EINTR(shutdown(handle(), SHUT_RDWR)) >= 0; What guarantees that ...
9 years ago (2011-12-21 17:41:30 UTC) #2
tommi (sloooow) - chröme
The bsd socket API is generally thread safe with the exception of a few functions ...
9 years ago (2011-12-21 20:42:46 UTC) #3
Ami GONE FROM CHROMIUM
On 2011/12/21 20:42:46, tommi wrote: > The bsd socket API is generally thread safe That's ...
9 years ago (2011-12-21 21:00:58 UTC) #4
tommi (sloooow) - chröme
ping
8 years, 11 months ago (2012-01-23 15:00:07 UTC) #5
darin (slow to review)
https://chromiumcodereview.appspot.com/8965053/diff/16001/base/sync_socket.h File base/sync_socket.h (right): https://chromiumcodereview.appspot.com/8965053/diff/16001/base/sync_socket.h#newcode41 base/sync_socket.h:41: // |pair| is an array of two closed SyncSockets ...
8 years, 11 months ago (2012-01-24 18:59:03 UTC) #6
tommi (sloooow) - chröme
https://chromiumcodereview.appspot.com/8965053/diff/16001/base/sync_socket.h File base/sync_socket.h (right): https://chromiumcodereview.appspot.com/8965053/diff/16001/base/sync_socket.h#newcode41 base/sync_socket.h:41: // |pair| is an array of two closed SyncSockets ...
8 years, 11 months ago (2012-01-24 21:03:25 UTC) #7
darin (slow to review)
On Tue, Jan 24, 2012 at 1:03 PM, <tommi@chromium.org> wrote: > > https://chromiumcodereview.**appspot.com/8965053/diff/** > 16001/base/sync_socket.h<https://chromiumcodereview.appspot.com/8965053/diff/16001/base/sync_socket.h> ...
8 years, 11 months ago (2012-01-24 21:19:36 UTC) #8
tommi (sloooow) - chröme
done. Btw, in my previous patch set I added one expectation to the unit test ...
8 years, 11 months ago (2012-01-24 21:56:38 UTC) #9
darin (slow to review)
LGTM https://chromiumcodereview.appspot.com/8965053/diff/23005/base/sync_socket.h File base/sync_socket.h (right): https://chromiumcodereview.appspot.com/8965053/diff/23005/base/sync_socket.h#newcode104 base/sync_socket.h:104: static bool CreatePair(CancelableSyncSocket* socket_a, micro-nit: perhaps it would ...
8 years, 11 months ago (2012-01-25 00:54:59 UTC) #10
tommi (sloooow) - chröme
https://chromiumcodereview.appspot.com/8965053/diff/23005/base/sync_socket.h File base/sync_socket.h (right): https://chromiumcodereview.appspot.com/8965053/diff/23005/base/sync_socket.h#newcode104 base/sync_socket.h:104: static bool CreatePair(CancelableSyncSocket* socket_a, On 2012/01/25 00:54:59, darin wrote: ...
8 years, 11 months ago (2012-01-25 10:49:13 UTC) #11
darin (slow to review)
8 years, 11 months ago (2012-01-25 15:59:31 UTC) #12
LGTM

Powered by Google App Engine
This is Rietveld 408576698