| Index: base/message_loop/incoming_task_queue.h
|
| diff --git a/base/message_loop/incoming_task_queue.h b/base/message_loop/incoming_task_queue.h
|
| index 72e1f30282966de72b01a505a6144839a1d00643..0d2d6b0058a2f2ae3bf946de123bb569d36e8f6d 100644
|
| --- a/base/message_loop/incoming_task_queue.h
|
| +++ b/base/message_loop/incoming_task_queue.h
|
| @@ -26,6 +26,11 @@ class BASE_EXPORT IncomingTaskQueue
|
| public:
|
| explicit IncomingTaskQueue(MessageLoop* message_loop);
|
|
|
| + // Creates a task queue for the message loop that is to be initialized lazily
|
| + // (i.e. created by CreateForLazyInit()).
|
| + static IncomingTaskQueue* CreateForLazyInitMessageLoop(
|
| + MessageLoop* message_loop);
|
| +
|
| // Appends a task to the incoming queue. Posting of all tasks is routed though
|
| // AddToIncomingQueue() or TryAddToIncomingQueue() to make sure that posting
|
| // task is properly synchronized between different threads.
|
| @@ -53,6 +58,13 @@ class BASE_EXPORT IncomingTaskQueue
|
| // Disconnects |this| from the parent message loop.
|
| void WillDestroyCurrentMessageLoop();
|
|
|
| + // Called when |message_loop_|'s LazyInit() is called, so that now it's ready
|
| + // for scheduling work. It is not valid to call this unless this task queue
|
| + // is created by CreateForLazyInitMessageLoop().
|
| + void DidInitializeMessageLoop();
|
| +
|
| + bool empty();
|
| +
|
| private:
|
| friend class RefCountedThreadSafe<IncomingTaskQueue>;
|
| virtual ~IncomingTaskQueue();
|
| @@ -92,6 +104,11 @@ class BASE_EXPORT IncomingTaskQueue
|
| // if the incoming queue was not empty.
|
| const bool always_schedule_work_;
|
|
|
| + // True if our message loop is created for lazy initialization and hasn't been
|
| + // initialized yet. Note that while this is true this task queue won't call
|
| + // ScheduleWork even if always_schedule_work_ is true.
|
| + bool message_loop_not_initialized_ = false;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(IncomingTaskQueue);
|
| };
|
|
|
|
|