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

Unified Diff: content/gpu/in_process_gpu_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 | « no previous file | content/renderer/in_process_renderer_thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/gpu/in_process_gpu_thread.cc
diff --git a/content/gpu/in_process_gpu_thread.cc b/content/gpu/in_process_gpu_thread.cc
index 10d0702e014b017bf72af5df0b9541a426fa12e7..4fa71bfbb7ca87e79c13dbfd3e254704f79ac679 100644
--- a/content/gpu/in_process_gpu_thread.cc
+++ b/content/gpu/in_process_gpu_thread.cc
@@ -10,6 +10,10 @@
#include "content/gpu/gpu_process.h"
#include "gpu/command_buffer/service/sync_point_manager.h"
+#if defined(OS_ANDROID)
+#include "base/android/jni_android.h"
+#endif
+
namespace content {
InProcessGpuThread::InProcessGpuThread(
@@ -34,6 +38,14 @@ InProcessGpuThread::~InProcessGpuThread() {
}
void InProcessGpuThread::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
+
gpu_process_ = new GpuProcess();
// The process object takes ownership of the thread object, so do not
« no previous file with comments | « no previous file | content/renderer/in_process_renderer_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698