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..11d20d524b996685988c4e4ee6c855c39db80c02 100644 |
--- a/content/browser/renderer_host/media/audio_input_sync_writer.cc |
+++ b/content/browser/renderer_host/media/audio_input_sync_writer.cc |
@@ -8,6 +8,7 @@ |
#include "base/memory/shared_memory.h" |
#include "content/browser/renderer_host/media/media_stream_manager.h" |
+#include "content/public/browser/browser_thread.h" |
static const uint32 kLogDelayThreadholdMs = 500; |
@@ -50,8 +51,20 @@ uint32 AudioInputSyncWriter::Write(const void* data, |
<< interval.InMilliseconds() << "ms."; |
} |
} |
- if (!oss.str().empty()) |
+ if (!oss.str().empty()) { |
+#if defined(OS_ANDROID) |
Ami GONE FROM CHROMIUM
2014/05/21 18:03:38
vrk@ points out that logging is not available on a
|
+ // MediaStreamManager::SendMessageToNativeLog posts a task to the UI thread, |
+ // 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 post to |
+ // the IO thread first to avoid attaching the audio thread to VM. |
Ami GONE FROM CHROMIUM
2014/05/21 17:51:42
I don't get it.
How is it that the PostTask that
jiayl
2014/05/21 17:59:07
See https://code.google.com/p/chromium/issues/deta
Feng Qian
2014/05/21 18:08:33
jiayl, can you build and test the new patch locall
jiayl
2014/05/21 18:13:58
Code removed for Android now.
|
+ BrowserThread::PostTask( |
+ BrowserThread::IO, FROM_HERE, |
+ base::Bind(&MediaStreamManager::SendMessageToNativeLog, oss.str())); |
+#else |
MediaStreamManager::SendMessageToNativeLog(oss.str()); |
+#endif |
+ } |
last_write_time_ = base::Time::Now(); |