Lines Matching defs:MessageLoop

46 // A MessageLoop is used to process events for a particular thread.  There is
47 // at most one MessageLoop instance per thread.
50 // variants. Depending on the type of message pump used by the MessageLoop
55 // NOTE: Unless otherwise specified, a MessageLoop's methods may only be called
56 // on the thread where the MessageLoop's Run method executes.
58 // NOTE: MessageLoop has task reentrancy protection. This means that if a
69 // MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current());
77 class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
79 // A MessageLoop has a particular type, which indicates the set of
112 // Normally, it is not necessary to instantiate a MessageLoop. Instead, it
113 // is typical to make use of the current thread's MessageLoop instance.
114 explicit MessageLoop(Type type = TYPE_DEFAULT);
115 // Creates a TYPE_CUSTOM MessageLoop with the supplied MessagePump, which must
117 explicit MessageLoop(scoped_ptr<base::MessagePump> pump);
118 virtual ~MessageLoop();
120 // Returns the MessageLoop object for the current thread, or null if none.
121 static MessageLoop* current();
134 // A DestructionObserver is notified when the current MessageLoop is being
135 // destroyed. These observers are notified prior to MessageLoop::current()
137 // do final cleanup that depends on the MessageLoop.
139 // NOTE: Any tasks posted to the MessageLoop during this notification will
166 // dispatch the task from a nested invocation of MessageLoop::Run. Instead,
167 // such tasks get deferred until the top-most MessageLoop::Run is executing.
169 // The MessageLoop takes ownership of the Task, and deletes it after it has
176 // on the thread that executes MessageLoop::Run().
192 // if the object needs to live until the next run of the MessageLoop (for
197 // on the thread that executes MessageLoop::Run(). If this is not the same
208 // live until the next run of the MessageLoop, or if the object needs to be
225 // MessageLoop::Run(). If this is not the same as the thread that calls
251 // Warning: if the MessageLoop remains busy, it may never quit. Only use this
258 // Use QuitClosure variants if you need to Quit another thread's MessageLoop,
260 // nested calls to MessageLoop::Run. The problem being that you won't know
275 // arbitrary MessageLoop to QuitWhenIdle.
334 explicit ScopedNestableTaskAllower(MessageLoop* loop)
344 MessageLoop* loop_;
352 // MessageLoop.
384 // Can only be called from the thread that owns the MessageLoop.
443 // done in a specific MessageLoop instance (i.e., specific thread).
515 DISALLOW_COPY_AND_ASSIGN(MessageLoop);
521 // MessageLoopForUI extends MessageLoop with methods that are particular to a
522 // MessageLoop instantiated with TYPE_UI.
527 class BASE_EXPORT MessageLoopForUI : public MessageLoop {
529 MessageLoopForUI() : MessageLoop(TYPE_UI) {
534 MessageLoop* loop = MessageLoop::current();
536 DCHECK_EQ(MessageLoop::TYPE_UI, loop->type());
541 MessageLoop* loop = MessageLoop::current();
542 return loop && loop->type() == MessageLoop::TYPE_UI;
547 // which connects this MessageLoop to the UI thread's CFRunLoop and allows
571 // MessageLoopForUI is often allocated via MessageLoop(TYPE_UI). Any extra
572 // data that you need should be stored on the MessageLoop's pump_ instance.
573 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForUI),
579 // MessageLoopForIO extends MessageLoop with methods that are particular to a
580 // MessageLoop instantiated with TYPE_IO.
585 class BASE_EXPORT MessageLoopForIO : public MessageLoop {
587 MessageLoopForIO() : MessageLoop(TYPE_IO) {
592 MessageLoop* loop = MessageLoop::current();
593 DCHECK_EQ(MessageLoop::TYPE_IO, loop->type());
598 MessageLoop* loop = MessageLoop::current();
599 return loop && loop->type() == MessageLoop::TYPE_IO;
652 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra
653 // data that you need should be stored on the MessageLoop's pump_ instance.
654 COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO),