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

Unified Diff: base/threading/thread.h

Issue 61643006: Adds the ability for MessageLoop to take a MessagePump (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: base/threading/thread.h
diff --git a/base/threading/thread.h b/base/threading/thread.h
index 98831b82e5ccea93b2d2f68c583a74682d6925d0..f816a1fa0acafeafec955b11a527b1547727e5cf 100644
--- a/base/threading/thread.h
+++ b/base/threading/thread.h
@@ -14,6 +14,8 @@
namespace base {
+class MessagePump;
+
// A simple thread abstraction that establishes a MessageLoop on a new thread.
// The consumer uses the MessageLoop of the thread to cause code to execute on
// the thread. When this object is destroyed the thread is terminated. All
@@ -30,13 +32,23 @@ namespace base {
class BASE_EXPORT Thread : PlatformThread::Delegate {
public:
struct Options {
- Options() : message_loop_type(MessageLoop::TYPE_DEFAULT), stack_size(0) {}
+ Options()
+ : message_loop_type(MessageLoop::TYPE_DEFAULT),
+ message_pump(NULL),
+ stack_size(0) {
+ }
Options(MessageLoop::Type type, size_t size)
- : message_loop_type(type), stack_size(size) {}
+ : message_loop_type(type),
+ message_pump(NULL),
+ stack_size(size) {}
// Specifies the type of message loop that will be allocated on the thread.
MessageLoop::Type message_loop_type;
+ // If non-null this is used as the MessagePump for the Thread's MessageLoop.
+ // MessageLoop takes ownership of this.
+ MessagePump* message_pump;
darin (slow to review) 2013/11/07 00:17:54 Perhaps it would be nice to use scoped_ptr here as
+
// Specifies the maximum stack size that the thread is allowed to use.
// This does not necessarily correspond to the thread's initial stack size.
// A value of 0 indicates that the default maximum should be used.

Powered by Google App Engine
This is Rietveld 408576698