Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 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 #ifndef BASE_THREADING_JAVA_THREAD_H_ | |
| 6 #define BASE_THREADING_JAVA_THREAD_H_ | |
| 7 | |
| 8 #include <jni.h> | |
| 9 | |
| 10 #include "base/android/scoped_java_ref.h" | |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 | |
| 13 namespace base { | |
| 14 | |
| 15 class MessageLoop; | |
| 16 class WaitableEvent; | |
| 17 | |
| 18 namespace android { | |
| 19 | |
| 20 class JavaThread { | |
|
joth
2013/07/10 20:33:48
comment. I guess this is where the primary API doc
Kristian Monsen
2013/07/16 21:54:41
I made a start, See what you think.
| |
| 21 public: | |
| 22 JavaThread(const char* name); | |
| 23 virtual ~JavaThread() {} | |
| 24 | |
| 25 base::MessageLoop* message_loop() const { return message_loop_.get(); } | |
| 26 void Start(); | |
| 27 void Stop(); | |
| 28 | |
| 29 // Called from java | |
|
joth
2013/07/10 20:33:48
.. on the inner thread when it has started. Execut
Kristian Monsen
2013/07/16 21:54:41
Done.
| |
| 30 void InitializeThread(JNIEnv* env, jobject obj); | |
| 31 | |
| 32 static bool RegisterBindings(JNIEnv* env); | |
| 33 | |
| 34 private: | |
| 35 scoped_ptr<base::MessageLoop> message_loop_; | |
| 36 base::WaitableEvent* waitable_event_; | |
| 37 ScopedJavaGlobalRef<jobject> java_thread_; | |
| 38 | |
| 39 bool started_; | |
| 40 }; | |
| 41 | |
| 42 } // namespace android | |
| 43 | |
| 44 } // namespace base | |
| 45 | |
| 46 #endif // BASE_THREADING_JAVA_THREAD_H_ | |
| OLD | NEW |