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

Unified Diff: base/message_loop/incoming_task_queue.h

Issue 1011683002: Lazily initialize MessageLoop for faster thread startup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: StartAndWait -> StartAndWaitForTesting Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/message_loop/incoming_task_queue.cc » ('j') | base/message_loop/incoming_task_queue.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..020b26a5b77cfd9e3e226a422b809bf8f58c84f8 100644
--- a/base/message_loop/incoming_task_queue.h
+++ b/base/message_loop/incoming_task_queue.h
@@ -53,6 +53,12 @@ class BASE_EXPORT IncomingTaskQueue
// Disconnects |this| from the parent message loop.
void WillDestroyCurrentMessageLoop();
+ // This should be called when it's ready for scheduling work.
+ void StartScheduling();
+
+ // Returns true if this has no queued tasks.
+ bool empty();
danakj 2015/04/24 20:54:39 IsEmpty
Nico 2015/04/24 21:31:15 style nit: lower_names() only for trivial methods.
kinuko 2015/04/27 16:36:04 Done. (Removed this method)
+
private:
friend class RefCountedThreadSafe<IncomingTaskQueue>;
virtual ~IncomingTaskQueue();
@@ -92,6 +98,9 @@ class BASE_EXPORT IncomingTaskQueue
// if the incoming queue was not empty.
const bool always_schedule_work_;
+ // False until StartScheduling() is called.
+ bool is_ready_for_scheduling_ = false;
danakj 2015/04/24 20:54:39 please initialize it in the constructor where othe
Nico 2015/04/24 21:31:15 nit: let's not mix member initialization style in
kinuko 2015/04/27 16:36:04 Done.
+
DISALLOW_COPY_AND_ASSIGN(IncomingTaskQueue);
};
« no previous file with comments | « no previous file | base/message_loop/incoming_task_queue.cc » ('j') | base/message_loop/incoming_task_queue.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698