OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_THREADING_JAVA_THREAD_H_ | 5 #ifndef BASE_THREADING_JAVA_THREAD_H_ |
6 #define BASE_THREADING_JAVA_THREAD_H_ | 6 #define BASE_THREADING_JAVA_THREAD_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 | 9 |
10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 public: | 26 public: |
27 JavaHandlerThread(const char* name); | 27 JavaHandlerThread(const char* name); |
28 virtual ~JavaHandlerThread(); | 28 virtual ~JavaHandlerThread(); |
29 | 29 |
30 base::MessageLoop* message_loop() const { return message_loop_.get(); } | 30 base::MessageLoop* message_loop() const { return message_loop_.get(); } |
31 void Start(); | 31 void Start(); |
32 void Stop(); | 32 void Stop(); |
33 | 33 |
34 // Called from java on the newly created thread. | 34 // Called from java on the newly created thread. |
35 // Start() will not return before this methods has finished. | 35 // Start() will not return before this methods has finished. |
36 void InitializeThread(JNIEnv* env, jobject obj, jint event); | 36 void InitializeThread(JNIEnv* env, jobject obj, jlong event); |
37 | 37 |
38 static bool RegisterBindings(JNIEnv* env); | 38 static bool RegisterBindings(JNIEnv* env); |
39 | 39 |
40 private: | 40 private: |
41 scoped_ptr<base::MessageLoop> message_loop_; | 41 scoped_ptr<base::MessageLoop> message_loop_; |
42 ScopedJavaGlobalRef<jobject> java_thread_; | 42 ScopedJavaGlobalRef<jobject> java_thread_; |
43 }; | 43 }; |
44 | 44 |
45 } // namespace android | 45 } // namespace android |
46 } // namespace base | 46 } // namespace base |
47 | 47 |
48 #endif // BASE_THREADING_JAVA_THREAD_H_ | 48 #endif // BASE_THREADING_JAVA_THREAD_H_ |
OLD | NEW |