From 787e3347eb49a59db5e6fe0374f50464f36d48e3 Mon Sep 17 00:00:00 2001 From: glider Date: Mon, 18 May 2015 06:24:19 -0700 Subject: Revert of Reland: Lazily initialize MessageLoop for faster thread startup (patchset #5 id:160001 of https://codereview.chromium.org/1129953004/) Reason for revert: Massive data race reports, see https://crbug.com/489263 Original issue's description: > Reland: Lazily initialize MessageLoop for faster thread startup > > Original review: https://codereview.chromium.org/1011683002/ > > Reverted because it's suspected for following flakiness issues: > http://crbug.com/485157 - Windows race > http://crbug.com/485091 - Android ThreadWatcher > http://crbug.com/485178 - interactive_ui_tests Menu* tests > > PS1 is the original patch set that gets reverted. > > BUG=465458, 485157, 485091, 485178 > TBR=jam > > Committed: https://crrev.com/8b6133a69f16702a32a3c3104630c4d9ac393b7a > Cr-Commit-Position: refs/heads/master@{#330329} TBR=thakis@chromium.org,toyoshim@chromium.org,jam@chromium.org,kinuko@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=465458, 485157, 485091, 485178 Review URL: https://codereview.chromium.org/1140363002 Cr-Commit-Position: refs/heads/master@{#330351} --- content/browser/browser_thread_impl.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'content/browser/browser_thread_impl.cc') diff --git a/content/browser/browser_thread_impl.cc b/content/browser/browser_thread_impl.cc index 4ae6607..78e3836 100644 --- a/content/browser/browser_thread_impl.cc +++ b/content/browser/browser_thread_impl.cc @@ -159,8 +159,14 @@ void BrowserThreadImpl::Init() { AtomicWord stored_pointer = base::subtle::NoBarrier_Load(storage); BrowserThreadDelegate* delegate = reinterpret_cast(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 -- cgit v1.1