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

Side by Side Diff: base/android/java_thread.h

Issue 18584006: Making a way to create thread with a Java Looper for Android (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update copyright year, and split a comment over two lines Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 {
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
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
40 } // namespace android
41
42 } // namespace base
43
44 #endif // BASE_THREADING_JAVA_THREAD_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698