OLD | NEW |
(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 |
OLD | NEW |