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

Unified Diff: content/renderer/in_process_renderer_thread.cc

Issue 1518213002: Assign thread name to in_proc renderer and gpu thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Gpu thread too Created 5 years 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 | « content/gpu/in_process_gpu_thread.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/in_process_renderer_thread.cc
diff --git a/content/renderer/in_process_renderer_thread.cc b/content/renderer/in_process_renderer_thread.cc
index 8b4b333bb93580363a4f7bb5e7d693152856c69e..94a41e61581607c31a4680a675232dfe4703255c 100644
--- a/content/renderer/in_process_renderer_thread.cc
+++ b/content/renderer/in_process_renderer_thread.cc
@@ -8,6 +8,10 @@
#include "content/renderer/render_process_impl.h"
#include "content/renderer/render_thread_impl.h"
+#if defined(OS_ANDROID)
+#include "base/android/jni_android.h"
+#endif
+
namespace content {
InProcessRendererThread::InProcessRendererThread(
@@ -20,6 +24,13 @@ InProcessRendererThread::~InProcessRendererThread() {
}
void InProcessRendererThread::Init() {
+ // Call AttachCurrentThreadWithName, before any other AttachCurrentThread()
+ // calls. The latter causes Java VM to assign Thread-??? to the thread name.
+ // Please note calls to AttachCurrentThreadWithName after AttachCurrentThread
+ // will not change the thread name kept in Java VM.
+#if defined(OS_ANDROID)
+ base::android::AttachCurrentThreadWithName(thread_name());
+#endif
render_process_.reset(new RenderProcessImpl());
RenderThreadImpl::Create(params_);
}
« no previous file with comments | « content/gpu/in_process_gpu_thread.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698