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

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..c972bfaf513b74d65a568cce831c50d1f7df0d92 100644
--- a/content/browser/renderer_host/media/audio_input_sync_writer.cc
+++ b/content/browser/renderer_host/media/audio_input_sync_writer.cc
@@ -50,9 +50,19 @@ uint32 AudioInputSyncWriter::Write(const void* data,
<< interval.InMilliseconds() << "ms.";
}
}
- if (!oss.str().empty())
+ if (!oss.str().empty()) {
MediaStreamManager::SendMessageToNativeLog(oss.str());
Feng Qian 2014/05/19 23:27:01 I felt it is safer to disabling logging instead of
jiayl 2014/05/19 23:30:20 This is only called for the first audio sample dat
Feng Qian 2014/05/20 15:53:12 thanks for explanation, sounds fine to me. On 201
+ // MediaStreamManager::SendMessageToNativeLog posts a task to the UI thread,
Feng Qian 2014/05/20 15:53:12 Should comments be inside #if defined(OS_ANDROID)?
+ // which will attach the audio thread to the Android java VM. Unlike chrome
+ // created threads, the audio thread is owned by the OS and does not detach
+ // itself from the VM on exit, causing a crash (crbug/365915). So we detach
+ // here to make sure the thread exits clean.
+#if defined(OS_ANDROID)
+ base::android::DetachFromVM();
tommi (sloooow) - chröme 2014/05/20 12:28:29 Just so that I understand - from information in th
Feng Qian 2014/05/20 15:53:12 tommi@, not sure if I understand your question cor
jiayl 2014/05/20 15:56:14 The crash happens when the thread exists, not whil
+#endif
+ }
+
last_write_time_ = base::Time::Now();
uint8* ptr = static_cast<uint8*>(shared_memory_->memory());
« 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