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

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: try another fix 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..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();
« 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