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

Side by Side Diff: content/shell/shell_browser_main.cc

Issue 14335017: content: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 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 | « content/shell/shell.cc ('k') | content/shell/shell_browser_main_parts.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/shell/shell_browser_main.h" 5 #include "content/shell/shell_browser_main.h"
6 6
7 #include <iostream> 7 #include <iostream>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 scoped_ptr<content::BrowserMainRunner> main_runner_( 113 scoped_ptr<content::BrowserMainRunner> main_runner_(
114 content::BrowserMainRunner::Create()); 114 content::BrowserMainRunner::Create());
115 115
116 int exit_code = main_runner_->Initialize(parameters); 116 int exit_code = main_runner_->Initialize(parameters);
117 117
118 if (exit_code >= 0) 118 if (exit_code >= 0)
119 return exit_code; 119 return exit_code;
120 120
121 if (CommandLine::ForCurrentProcess()->HasSwitch( 121 if (CommandLine::ForCurrentProcess()->HasSwitch(
122 switches::kCheckLayoutTestSysDeps)) { 122 switches::kCheckLayoutTestSysDeps)) {
123 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); 123 base::MessageLoop::current()->PostTask(FROM_HERE,
124 base::MessageLoop::QuitClosure());
124 main_runner_->Run(); 125 main_runner_->Run();
125 content::Shell::CloseAllWindows(); 126 content::Shell::CloseAllWindows();
126 main_runner_->Shutdown(); 127 main_runner_->Shutdown();
127 return 0; 128 return 0;
128 } 129 }
129 130
130 if (layout_test_mode) { 131 if (layout_test_mode) {
131 content::WebKitTestController test_controller; 132 content::WebKitTestController test_controller;
132 { 133 {
133 // We're outside of the message loop here, and this is a test. 134 // We're outside of the message loop here, and this is a test.
(...skipping 29 matching lines...) Expand all
163 break; 164 break;
164 } 165 }
165 166
166 ran_at_least_once = true; 167 ran_at_least_once = true;
167 main_runner_->Run(); 168 main_runner_->Run();
168 169
169 if (!content::WebKitTestController::Get()->ResetAfterLayoutTest()) 170 if (!content::WebKitTestController::Get()->ResetAfterLayoutTest())
170 break; 171 break;
171 } 172 }
172 if (!ran_at_least_once) { 173 if (!ran_at_least_once) {
173 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); 174 base::MessageLoop::current()->PostTask(FROM_HERE,
175 base::MessageLoop::QuitClosure());
174 main_runner_->Run(); 176 main_runner_->Run();
175 } 177 }
176 exit_code = 0; 178 exit_code = 0;
177 } else { 179 } else {
178 exit_code = main_runner_->Run(); 180 exit_code = main_runner_->Run();
179 } 181 }
180 182
181 main_runner_->Shutdown(); 183 main_runner_->Shutdown();
182 184
183 return exit_code; 185 return exit_code;
184 } 186 }
OLDNEW
« no previous file with comments | « content/shell/shell.cc ('k') | content/shell/shell_browser_main_parts.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698