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

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

Issue 294803003: Do not call SendMessageToNativeLog on Android in AudioInputSyncWriter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@temp
Patch Set: Created 6 years, 7 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 b9c8ee5e3b6d19c3a84acfbd1b695872c2baf4c1..99b91b7b9f6b8fcf2e19c2df0504f593c16b2d21 100644
--- a/content/browser/renderer_host/media/audio_input_sync_writer.cc
+++ b/content/browser/renderer_host/media/audio_input_sync_writer.cc
@@ -9,8 +9,6 @@
#include "base/memory/shared_memory.h"
#include "content/browser/renderer_host/media/media_stream_manager.h"
-static const uint32 kLogDelayThreadholdMs = 500;
-
namespace content {
AudioInputSyncWriter::AudioInputSyncWriter(
@@ -37,23 +35,29 @@ uint32 AudioInputSyncWriter::Write(const void* data,
uint32 size,
double volume,
bool key_pressed) {
+#if !defined(OS_ANDROID)
+ static const base::TimeDelta kLogDelayThreadhold =
+ base::TimeDelta::FromMilliseconds(500);
+
std::ostringstream oss;
if (last_write_time_.is_null()) {
// This is the first time Write is called.
base::TimeDelta interval = base::Time::Now() - creation_time_;
oss << "Audio input data received for the first time: delay = "
<< interval.InMilliseconds() << "ms.";
+
} else {
base::TimeDelta interval = base::Time::Now() - last_write_time_;
- if (interval.InMilliseconds() > kLogDelayThreadholdMs) {
+ if (interval > kLogDelayThreadhold) {
oss << "Audio input data delay unexpectedly long: delay = "
- << interval.InMilliseconds() << "ms.";
+ << interval.InMilliseconds() << "ms.";
}
}
if (!oss.str().empty())
MediaStreamManager::SendMessageToNativeLog(oss.str());
last_write_time_ = base::Time::Now();
+#endif
uint8* ptr = static_cast<uint8*>(shared_memory_->memory());
ptr += current_segment_id_ * shared_memory_segment_size_;
« 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