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

Unified Diff: content/browser/browser_main_loop.cc

Issue 10479018: Add base::RunLoop and update ui_test_utils to use it to reduce flakiness (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: darin feedback Created 8 years, 6 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
Index: content/browser/browser_main_loop.cc
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
index d2021111c6f77d91b1730a56e758d6b985f0abe5..292bc3b13cccac09da5385d2a6af60c7fe744b04 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -12,6 +12,7 @@
#include "base/message_loop.h"
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram.h"
+#include "base/run_loop.h"
#include "base/string_number_conversions.h"
#include "base/threading/thread_restrictions.h"
#include "content/browser/browser_thread_impl.h"
@@ -648,16 +649,16 @@ void BrowserMainLoop::InitializeToolkit() {
}
void BrowserMainLoop::MainMessageLoopRun() {
+ DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type());
if (parameters_.ui_task)
MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task);
-#if defined(OS_MACOSX)
- MessageLoopForUI::current()->Run();
-#elif defined(OS_ANDROID)
+#if defined(OS_ANDROID)
// Android's main message loop is the Java message loop.
NOTREACHED();
#else
jar (doing other things) 2012/06/23 02:43:19 Can you move lines 652-654 into this #else clause?
jbates 2012/06/25 20:04:57 Done.
- MessageLoopForUI::current()->RunWithDispatcher(NULL);
+ base::RunLoop run_loop;
+ run_loop.Run();
#endif
}

Powered by Google App Engine
This is Rietveld 408576698