Chromium Code Reviews| Index: content/browser/renderer_host/media/audio_input_sync_writer.cc |
| diff --git a/content/browser/renderer_host/media/audio_input_sync_writer.cc b/content/browser/renderer_host/media/audio_input_sync_writer.cc |
| index c72b1cd7b0e5b1be50ccc754bcb6fc4d1b5dd336..de719c3bcabfc08184de86c6e4a6fd9ff41851bc 100644 |
| --- a/content/browser/renderer_host/media/audio_input_sync_writer.cc |
| +++ b/content/browser/renderer_host/media/audio_input_sync_writer.cc |
| @@ -5,6 +5,7 @@ |
| #include "content/browser/renderer_host/media/audio_input_sync_writer.h" |
| #include <algorithm> |
| +#include <utility> |
| #include "base/format_macros.h" |
| #include "base/metrics/histogram_macros.h" |
| @@ -47,6 +48,7 @@ AudioInputSyncWriter::AudioInputSyncWriter(void* shared_memory, |
| write_count_(0), |
| write_to_fifo_count_(0), |
| write_error_count_(0), |
| + had_socket_error_(false), |
| trailing_write_to_fifo_count_(0), |
| trailing_write_error_count_(0) { |
| DCHECK_GT(shared_memory_segment_count, 0); |
| @@ -327,9 +329,11 @@ void AudioInputSyncWriter::WriteParametersToCurrentSegment( |
| bool AudioInputSyncWriter::SignalDataWrittenAndUpdateCounters() { |
| if (socket_->Send(¤t_segment_id_, sizeof(current_segment_id_)) != |
| - sizeof(current_segment_id_)) { |
| + sizeof(current_segment_id_) && |
| + !had_socket_error_) { |
| + had_socket_error_ = true; |
|
tommi (sloooow) - chröme
2017/04/18 09:39:28
Can we ever recover from this?
If not, can we have
Max Morin
2017/04/18 09:55:28
In the case in the bug (other end of sync socket i
tommi (sloooow) - chröme
2017/04/19 10:44:35
Yes I think that would be a safer change to make a
Max Morin
2017/04/19 11:51:00
Makes sense. I changed it.
|
| const std::string error_message = "AISW: No room in socket buffer."; |
| - LOG(WARNING) << error_message; |
| + PLOG(WARNING) << error_message; |
| AddToNativeLog(error_message); |
| TRACE_EVENT_INSTANT0("audio", |
| "AudioInputSyncWriter: No room in socket buffer", |