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

Side by Side Diff: shell/android/native_handler_thread.cc

Issue 1456913002: Use thread with looper and native message loop for vsync service. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « shell/android/native_handler_thread.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "shell/android/native_handler_thread.h"
6
7 #include "base/message_loop/message_loop.h"
8 #include "jni/NativeHandlerThread_jni.h"
9
10 namespace shell {
11
12 jlong CreateMessageLoop(JNIEnv* env, jobject jcaller) {
13 scoped_ptr<base::MessageLoop> loop(new base::MessageLoopForUI);
14 base::MessageLoopForUI::current()->Start();
15 return reinterpret_cast<intptr_t>(loop.release());
16 }
17
18 void DeleteMessageLoop(JNIEnv* env, jobject jcaller, jlong message_loop) {
19 scoped_ptr<base::MessageLoop> loop(
20 reinterpret_cast<base::MessageLoop*>(message_loop));
21 loop->QuitNow();
22 }
23
24 bool RegisterNativeHandlerThreadJni(JNIEnv* env) {
25 return RegisterNativesImpl(env);
26 }
27
28 } // namespace shell
OLDNEW
« no previous file with comments | « shell/android/native_handler_thread.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698