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

Side by Side Diff: base/message_loop/message_loop.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: rebase and cr fix 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
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_MESSAGE_LOOP_MESSAGE_LOOP_H_ 5 #ifndef BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_
6 #define BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ 6 #define BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_
7 7
8 #include <queue> 8 #include <queue>
9 #include <string> 9 #include <string>
10 10
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 // This type of ML only supports tasks and timers. 102 // This type of ML only supports tasks and timers.
103 // 103 //
104 // TYPE_UI 104 // TYPE_UI
105 // This type of ML also supports native UI events (e.g., Windows messages). 105 // This type of ML also supports native UI events (e.g., Windows messages).
106 // See also MessageLoopForUI. 106 // See also MessageLoopForUI.
107 // 107 //
108 // TYPE_IO 108 // TYPE_IO
109 // This type of ML also supports asynchronous IO. See also 109 // This type of ML also supports asynchronous IO. See also
110 // MessageLoopForIO. 110 // MessageLoopForIO.
111 // 111 //
112 // TYPE_JAVA
113 // This type of ML is backed by a Java message handler which is responsible
114 // for running the tasks added to the ML. This is only for use on Android.
115 //
112 enum Type { 116 enum Type {
113 TYPE_DEFAULT, 117 TYPE_DEFAULT,
114 TYPE_UI, 118 TYPE_UI,
115 TYPE_IO 119 TYPE_IO,
120 #if defined(OS_ANDROID)
121 TYPE_JAVA,
122 #endif // defined(OS_ANDROID)
116 }; 123 };
117 124
118 // Normally, it is not necessary to instantiate a MessageLoop. Instead, it 125 // Normally, it is not necessary to instantiate a MessageLoop. Instead, it
119 // is typical to make use of the current thread's MessageLoop instance. 126 // is typical to make use of the current thread's MessageLoop instance.
120 explicit MessageLoop(Type type = TYPE_DEFAULT); 127 explicit MessageLoop(Type type = TYPE_DEFAULT);
121 virtual ~MessageLoop(); 128 virtual ~MessageLoop();
122 129
123 // Returns the MessageLoop object for the current thread, or null if none. 130 // Returns the MessageLoop object for the current thread, or null if none.
124 static MessageLoop* current(); 131 static MessageLoop* current();
125 132
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 708
702 // Do not add any member variables to MessageLoopForIO! This is important b/c 709 // Do not add any member variables to MessageLoopForIO! This is important b/c
703 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra 710 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra
704 // data that you need should be stored on the MessageLoop's pump_ instance. 711 // data that you need should be stored on the MessageLoop's pump_ instance.
705 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), 712 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO),
706 MessageLoopForIO_should_not_have_extra_member_variables); 713 MessageLoopForIO_should_not_have_extra_member_variables);
707 714
708 } // namespace base 715 } // namespace base
709 716
710 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_ 717 #endif // BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698