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

Unified Diff: content/browser/renderer_host/media/audio_sync_reader.cc

Issue 570713003: Avoid unsafe usage of CancelIo() within Windows SyncSocket. (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix clients. Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/sync_socket_win.cc ('k') | media/audio/audio_device_thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/media/audio_sync_reader.cc
diff --git a/content/browser/renderer_host/media/audio_sync_reader.cc b/content/browser/renderer_host/media/audio_sync_reader.cc
index cd1832b44a90814471f582cc64e5d94a601b0382..8fab23df56cde9d2c60bc7ea87e557f0ef953399 100644
--- a/content/browser/renderer_host/media/audio_sync_reader.cc
+++ b/content/browser/renderer_host/media/audio_sync_reader.cc
@@ -144,10 +144,11 @@ bool AudioSyncReader::WaitUntilDataIsReady() {
while (timeout.InMicroseconds() > 0) {
bytes_received = socket_->ReceiveWithTimeout(
&renderer_buffer_index, sizeof(renderer_buffer_index), timeout);
- if (!bytes_received)
+ if (bytes_received != sizeof(renderer_buffer_index)) {
+ bytes_received = 0;
break;
+ }
- DCHECK_EQ(bytes_received, sizeof(renderer_buffer_index));
if (renderer_buffer_index == buffer_index_)
break;
« no previous file with comments | « base/sync_socket_win.cc ('k') | media/audio/audio_device_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698