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

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

Issue 2822123002: Avoid log spam in AudioSyncReader. (Closed)
Patch Set: Created 3 years, 8 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
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(&current_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",

Powered by Google App Engine
This is Rietveld 408576698