Commit 55f45227 authored by zea@chromium.org's avatar zea@chromium.org

Revert 271764 "Detaching from the VM after calling MediaStreamMa..."

Breaks androidwebview_instrumentation_tests
org.chromium.android_webview.test.MediaAccessPermissionRequestTest#testGrantAccess

http://build.chromium.org/p/chromium.linux/buildstatus?builder=Android%20Tests%20%28dbg%29&number=20509

> Detaching from the VM after calling MediaStreamManager::SendMessageToNativeLog on Android.
> 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.
> Since the log message is still crucial for diagnosing audio input issues, I'm detaching the VM after SendMessageToNativeLog, instead of removing the call on Android.
> 
> BUG=365915
> 
> Review URL: https://codereview.chromium.org/294803003

TBR=jiayl@chromium.org

Review URL: https://codereview.chromium.org/291173006

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271788 0039d316-1c4b-4281-b951-d872f2087c98
parent 97463e72
......@@ -6,9 +6,6 @@
#include <algorithm>
#if defined(OS_ANDROID)
#include "base/android/jni_android.h"
#endif
#include "base/memory/shared_memory.h"
#include "content/browser/renderer_host/media/media_stream_manager.h"
......@@ -53,19 +50,9 @@ uint32 AudioInputSyncWriter::Write(const void* data,
<< interval.InMilliseconds() << "ms.";
}
}
if (!oss.str().empty()) {
if (!oss.str().empty())
MediaStreamManager::SendMessageToNativeLog(oss.str());
// 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 detach
// here to make sure the thread exits clean.
#if defined(OS_ANDROID)
base::android::DetachFromVM();
#endif
}
last_write_time_ = base::Time::Now();
uint8* ptr = static_cast<uint8*>(shared_memory_->memory());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment