summaryrefslogtreecommitdiffstats
path: root/content/browser/browser_thread_impl.cc
diff options
context:
space:
mode:
authorkinuko <kinuko@chromium.org>2015-05-05 10:13:51 -0700
committerCommit bot <commit-bot@chromium.org>2015-05-05 17:15:18 +0000
commitf1f70cb5ebe24d85c575396f026a415ed0fe9afc (patch)
tree7707d3dbe7c3404c5391318bb015f990e4692d1e /content/browser/browser_thread_impl.cc
parent8d20ad724b073dbb1e2b7e55f3174bdfc9ca2385 (diff)
downloadchromium_src-f1f70cb5ebe24d85c575396f026a415ed0fe9afc.zip
chromium_src-f1f70cb5ebe24d85c575396f026a415ed0fe9afc.tar.gz
chromium_src-f1f70cb5ebe24d85c575396f026a415ed0fe9afc.tar.bz2
Lazily initialize MessageLoop for faster thread startup
Summary of the change and background discussion: https://docs.google.com/a/chromium.org/document/d/1o1vUUOjX3tC7pV5-nxchaGtElo4NwtzKOAb4Zm09ezw/edit# This implements approach 1 in the doc. Approach 2: https://codereview.chromium.org/1086663002/ Approach 3: https://codereview.chromium.org/1058603004/ Discussion thread: https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/2t6lB8hUgYw BUG=465458 Review URL: https://codereview.chromium.org/1011683002 Cr-Commit-Position: refs/heads/master@{#328347}
Diffstat (limited to 'content/browser/browser_thread_impl.cc')
-rw-r--r--content/browser/browser_thread_impl.cc8
1 files changed, 1 insertions, 7 deletions
diff --git a/content/browser/browser_thread_impl.cc b/content/browser/browser_thread_impl.cc
index 78e3836..4ae6607 100644
--- a/content/browser/browser_thread_impl.cc
+++ b/content/browser/browser_thread_impl.cc
@@ -159,14 +159,8 @@ void BrowserThreadImpl::Init() {
AtomicWord stored_pointer = base::subtle::NoBarrier_Load(storage);
BrowserThreadDelegate* delegate =
reinterpret_cast<BrowserThreadDelegate*>(stored_pointer);
- if (delegate) {
+ if (delegate)
delegate->Init();
- message_loop()->PostTask(FROM_HERE,
- base::Bind(&BrowserThreadDelegate::InitAsync,
- // Delegate is expected to exist for the
- // duration of the thread's lifetime
- base::Unretained(delegate)));
- }
}
// We disable optimizations for this block of functions so the compiler doesn't