Home | History | Annotate | Download | only in message_loop

Lines Matching defs:MessageLoop

47 // A MessageLoop is used to process events for a particular thread.  There is
48 // at most one MessageLoop instance per thread.
51 // variants. Depending on the type of message pump used by the MessageLoop
56 // NOTE: Unless otherwise specified, a MessageLoop's methods may only be called
57 // on the thread where the MessageLoop's Run method executes.
59 // NOTE: MessageLoop has task reentrancy protection. This means that if a
70 // MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current());
78 class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
80 // A MessageLoop has a particular type, which indicates the set of
113 // Normally, it is not necessary to instantiate a MessageLoop. Instead, it
114 // is typical to make use of the current thread's MessageLoop instance.
115 explicit MessageLoop(Type type = TYPE_DEFAULT);
116 // Creates a TYPE_CUSTOM MessageLoop with the supplied MessagePump, which must
118 explicit MessageLoop(scoped_ptr<MessagePump> pump);
120 ~MessageLoop() override;
122 // Returns the MessageLoop object for the current thread, or null if none.
123 static MessageLoop* current();
136 // A DestructionObserver is notified when the current MessageLoop is being
137 // destroyed. These observers are notified prior to MessageLoop::current()
139 // do final cleanup that depends on the MessageLoop.
141 // NOTE: Any tasks posted to the MessageLoop during this notification will
171 // dispatch the task from a nested invocation of MessageLoop::Run. Instead,
172 // such tasks get deferred until the top-most MessageLoop::Run is executing.
174 // The MessageLoop takes ownership of the Task, and deletes it after it has
181 // on the thread that executes MessageLoop::Run().
197 // if the object needs to live until the next run of the MessageLoop (for
202 // on the thread that executes MessageLoop::Run().
211 // live until the next run of the MessageLoop, or if the object needs to be
228 // 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
272 // arbitrary MessageLoop to QuitWhenIdle.
331 explicit ScopedNestableTaskAllower(MessageLoop* loop)
341 MessageLoop* loop_;
349 // MessageLoop.
381 // Can only be called from the thread that owns the MessageLoop.
411 // Creates a MessageLoop without binding to a thread.
422 static scoped_ptr<MessageLoop> CreateUnbound(
428 MessageLoop(Type type, MessagePumpFactoryCallback pump_factory);
468 // done in a specific MessageLoop instance (i.e., specific thread).
549 DISALLOW_COPY_AND_ASSIGN(MessageLoop);
555 // MessageLoopForUI extends MessageLoop with methods that are particular to a
556 // MessageLoop instantiated with TYPE_UI.
561 class BASE_EXPORT MessageLoopForUI : public MessageLoop {
563 MessageLoopForUI() : MessageLoop(TYPE_UI) {
568 MessageLoop* loop = MessageLoop::current();
570 DCHECK_EQ(MessageLoop::TYPE_UI, loop->type());
575 MessageLoop* loop = MessageLoop::current();
576 return loop && loop->type() == MessageLoop::TYPE_UI;
581 // which connects this MessageLoop to the UI thread's CFRunLoop and allows
605 // MessageLoopForUI is often allocated via MessageLoop(TYPE_UI). Any extra
606 // data that you need should be stored on the MessageLoop's pump_ instance.
607 static_assert(sizeof(MessageLoop) == sizeof(MessageLoopForUI),
613 // MessageLoopForIO extends MessageLoop with methods that are particular to a
614 // MessageLoop instantiated with TYPE_IO.
619 class BASE_EXPORT MessageLoopForIO : public MessageLoop {
625 MessageLoop* loop = MessageLoop::current();
626 DCHECK_EQ(MessageLoop::TYPE_IO, loop->type());
631 MessageLoop* loop = MessageLoop::current();
632 return loop && loop->type() == MessageLoop::TYPE_IO;
685 // MessageLoopForIO is often allocated via MessageLoop(TYPE_IO). Any extra
686 // data that you need should be stored on the MessageLoop's pump_ instance.
687 static_assert(sizeof(MessageLoop) == sizeof(MessageLoopForIO),