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

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

Issue 2107723002: Cap AudioInputSyncWriter "no room in fifo" log messages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change cap to 50. Created 4 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 caa326127b619cf70250e245f5835bb0a1d8c897..98817e2127fc7e83b47d07c89ec597fc062c6713 100644
--- a/content/browser/renderer_host/media/audio_input_sync_writer.cc
+++ b/content/browser/renderer_host/media/audio_input_sync_writer.cc
@@ -233,9 +233,20 @@ bool AudioInputSyncWriter::PushDataToFifo(const AudioBus* data,
bool key_pressed,
uint32_t hardware_delay_bytes) {
if (overflow_buses_.size() == kMaxOverflowBusesSize) {
- const std::string error_message = "AISW: No room in fifo.";
- LOG(ERROR) << error_message;
- AddToNativeLog(error_message);
+ // We use |write_error_count_| for capping number of log messages.
+ // |write_error_count_| also includes socket Send() errors, but those should
+ // be rare.
+ if (write_error_count_ <= 50) {
+ const std::string error_message = "AISW: No room in fifo.";
+ LOG(WARNING) << error_message;
+ AddToNativeLog(error_message);
+ if (write_error_count_ == 50) {
+ const std::string error_message =
+ "AISW: Log cap reached, suppressing further fifo overflow logs.";
+ LOG(WARNING) << error_message;
+ AddToNativeLog(error_message);
+ }
+ }
return false;
}
@@ -321,7 +332,7 @@ bool AudioInputSyncWriter::SignalDataWrittenAndUpdateCounters() {
if (socket_->Send(&current_segment_id_, sizeof(current_segment_id_)) !=
sizeof(current_segment_id_)) {
const std::string error_message = "AISW: No room in socket buffer.";
- LOG(ERROR) << error_message;
+ LOG(WARNING) << error_message;
AddToNativeLog(error_message);
return false;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698