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

Side by Side Diff: base/message_loop.cc

Issue 151158: Adding time-out to browser tests (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 | « base/message_loop.h ('k') | chrome/test/in_process_browser_test.h » ('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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "base/message_loop.h" 5 #include "base/message_loop.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 return; 291 return;
292 // Start the native pump if we are not already pumping. 292 // Start the native pump if we are not already pumping.
293 pump_->ScheduleWork(); 293 pump_->ScheduleWork();
294 } 294 }
295 } 295 }
296 296
297 bool MessageLoop::NestableTasksAllowed() const { 297 bool MessageLoop::NestableTasksAllowed() const {
298 return nestable_tasks_allowed_; 298 return nestable_tasks_allowed_;
299 } 299 }
300 300
301 bool MessageLoop::IsNested() {
302 return state_->run_depth > 1;
303 }
304
301 //------------------------------------------------------------------------------ 305 //------------------------------------------------------------------------------
302 306
303 void MessageLoop::RunTask(Task* task) { 307 void MessageLoop::RunTask(Task* task) {
304 DCHECK(nestable_tasks_allowed_); 308 DCHECK(nestable_tasks_allowed_);
305 // Execute the task and assume the worst: It is probably not reentrant. 309 // Execute the task and assume the worst: It is probably not reentrant.
306 nestable_tasks_allowed_ = false; 310 nestable_tasks_allowed_ = false;
307 311
308 HistogramEvent(kTaskRunEvent); 312 HistogramEvent(kTaskRunEvent);
309 task->Run(); 313 task->Run();
310 delete task; 314 delete task;
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 Watcher *delegate) { 623 Watcher *delegate) {
620 return pump_libevent()->WatchFileDescriptor( 624 return pump_libevent()->WatchFileDescriptor(
621 fd, 625 fd,
622 persistent, 626 persistent,
623 static_cast<base::MessagePumpLibevent::Mode>(mode), 627 static_cast<base::MessagePumpLibevent::Mode>(mode),
624 controller, 628 controller,
625 delegate); 629 delegate);
626 } 630 }
627 631
628 #endif 632 #endif
OLDNEW
« no previous file with comments | « base/message_loop.h ('k') | chrome/test/in_process_browser_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698