OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
279 void MessageLoop::AddTaskObserver(TaskObserver* task_observer) { | 279 void MessageLoop::AddTaskObserver(TaskObserver* task_observer) { |
280 DCHECK_EQ(this, current()); | 280 DCHECK_EQ(this, current()); |
281 task_observers_.AddObserver(task_observer); | 281 task_observers_.AddObserver(task_observer); |
282 } | 282 } |
283 | 283 |
284 void MessageLoop::RemoveTaskObserver(TaskObserver* task_observer) { | 284 void MessageLoop::RemoveTaskObserver(TaskObserver* task_observer) { |
285 DCHECK_EQ(this, current()); | 285 DCHECK_EQ(this, current()); |
286 task_observers_.RemoveObserver(task_observer); | 286 task_observers_.RemoveObserver(task_observer); |
287 } | 287 } |
288 | 288 |
289 void MessageLoop::AssertIdle() const { | |
290 base::AutoLock lock(incoming_queue_lock_); | |
291 DCHECK(incoming_queue_.empty()); | |
darin (slow to review)
2011/01/25 17:07:43
what about the work_queue_?
willchan no longer on Chromium
2011/01/25 17:12:01
See my comment in the .h file:
// Asserts that the
| |
292 } | |
293 | |
289 //------------------------------------------------------------------------------ | 294 //------------------------------------------------------------------------------ |
290 | 295 |
291 // Runs the loop in two different SEH modes: | 296 // Runs the loop in two different SEH modes: |
292 // enable_SEH_restoration_ = false : any unhandled exception goes to the last | 297 // enable_SEH_restoration_ = false : any unhandled exception goes to the last |
293 // one that calls SetUnhandledExceptionFilter(). | 298 // one that calls SetUnhandledExceptionFilter(). |
294 // enable_SEH_restoration_ = true : any unhandled exception goes to the filter | 299 // enable_SEH_restoration_ = true : any unhandled exception goes to the filter |
295 // that was existed before the loop was run. | 300 // that was existed before the loop was run. |
296 void MessageLoop::RunHandler() { | 301 void MessageLoop::RunHandler() { |
297 #if defined(OS_WIN) | 302 #if defined(OS_WIN) |
298 if (exception_restoration_) { | 303 if (exception_restoration_) { |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
696 Watcher *delegate) { | 701 Watcher *delegate) { |
697 return pump_libevent()->WatchFileDescriptor( | 702 return pump_libevent()->WatchFileDescriptor( |
698 fd, | 703 fd, |
699 persistent, | 704 persistent, |
700 static_cast<base::MessagePumpLibevent::Mode>(mode), | 705 static_cast<base::MessagePumpLibevent::Mode>(mode), |
701 controller, | 706 controller, |
702 delegate); | 707 delegate); |
703 } | 708 } |
704 | 709 |
705 #endif | 710 #endif |
OLD | NEW |