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

Side by Side 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: phajdan feedback Created 8 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome_frame/test/chrome_frame_test_utils.h ('k') | content/test/test_navigation_observer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/browser_main_loop.h" 5 #include "content/browser/browser_main_loop.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/hi_res_timer_manager.h" 10 #include "base/hi_res_timer_manager.h"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/message_loop.h" 12 #include "base/message_loop.h"
13 #include "base/metrics/field_trial.h" 13 #include "base/metrics/field_trial.h"
14 #include "base/metrics/histogram.h" 14 #include "base/metrics/histogram.h"
15 #include "base/run_loop.h"
15 #include "base/string_number_conversions.h" 16 #include "base/string_number_conversions.h"
16 #include "base/threading/thread_restrictions.h" 17 #include "base/threading/thread_restrictions.h"
17 #include "content/browser/browser_thread_impl.h" 18 #include "content/browser/browser_thread_impl.h"
18 #include "content/browser/download/download_file_manager.h" 19 #include "content/browser/download/download_file_manager.h"
19 #include "content/browser/download/save_file_manager.h" 20 #include "content/browser/download/save_file_manager.h"
20 #include "content/browser/gamepad/gamepad_service.h" 21 #include "content/browser/gamepad/gamepad_service.h"
21 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" 22 #include "content/browser/gpu/browser_gpu_channel_host_factory.h"
22 #include "content/browser/gpu/gpu_process_host.h" 23 #include "content/browser/gpu/gpu_process_host.h"
23 #include "content/browser/gpu/gpu_process_host_ui_shim.h" 24 #include "content/browser/gpu/gpu_process_host_ui_shim.h"
24 #include "content/browser/in_process_webkit/webkit_thread.h" 25 #include "content/browser/in_process_webkit/webkit_thread.h"
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 config.dwICC = ICC_WIN95_CLASSES; 628 config.dwICC = ICC_WIN95_CLASSES;
628 if (!InitCommonControlsEx(&config)) 629 if (!InitCommonControlsEx(&config))
629 LOG_GETLASTERROR(FATAL); 630 LOG_GETLASTERROR(FATAL);
630 #endif 631 #endif
631 632
632 if (parts_.get()) 633 if (parts_.get())
633 parts_->ToolkitInitialized(); 634 parts_->ToolkitInitialized();
634 } 635 }
635 636
636 void BrowserMainLoop::MainMessageLoopRun() { 637 void BrowserMainLoop::MainMessageLoopRun() {
638 #if defined(OS_ANDROID)
639 // Android's main message loop is the Java message loop.
640 NOTREACHED();
641 #else
642 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type());
637 if (parameters_.ui_task) 643 if (parameters_.ui_task)
638 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); 644 MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task);
639 645
640 #if defined(OS_MACOSX) 646 base::RunLoop run_loop;
641 MessageLoopForUI::current()->Run(); 647 run_loop.Run();
642 #elif defined(OS_ANDROID)
643 // Android's main message loop is the Java message loop.
644 NOTREACHED();
645 #else
646 MessageLoopForUI::current()->RunWithDispatcher(NULL);
647 #endif 648 #endif
648 } 649 }
649 650
650 } // namespace content 651 } // namespace content
OLDNEW
« no previous file with comments | « chrome_frame/test/chrome_frame_test_utils.h ('k') | content/test/test_navigation_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698