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

Unified Diff: content/browser/android/launcher_thread.cc

Issue 2774363003: android: Java-based launcher thread (Closed)
Patch Set: Created 3 years, 9 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
Index: content/browser/android/launcher_thread.cc
diff --git a/content/browser/android/launcher_thread.cc b/content/browser/android/launcher_thread.cc
new file mode 100644
index 0000000000000000000000000000000000000000..de4b99f0e73cffa76e8e6a114d5acd1e8fea9bbf
--- /dev/null
+++ b/content/browser/android/launcher_thread.cc
@@ -0,0 +1,31 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/browser/android/launcher_thread.h"
+
+#include "jni/LauncherThread_jni.h"
+
+namespace content {
+namespace android {
+
+namespace {
+base::LazyInstance<LauncherThread>::Leaky g_launcher_thread;
+}
+
+base::MessageLoop* LauncherThread::GetLauncherMessageLoop() {
+ return g_launcher_thread.Get().GetMessageLoop();
+}
+
+LauncherThread::LauncherThread()
+ : java_handler_thread_(Java_LauncherThread_getHandlerThread(
+ base::android::AttachCurrentThread())) {}
+
+LauncherThread::~LauncherThread() {}
+
+base::MessageLoop* LauncherThread::GetMessageLoop() {
+ return java_handler_thread_.message_loop();
+}
+
+} // namespace android
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698