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 // We only check |incoming_queue_|, since we don't want to lock |work_queue_|. |
| 291 base::AutoLock lock(incoming_queue_lock_); |
| 292 DCHECK(incoming_queue_.empty()); |
| 293 } |
| 294 |
289 //------------------------------------------------------------------------------ | 295 //------------------------------------------------------------------------------ |
290 | 296 |
291 // Runs the loop in two different SEH modes: | 297 // Runs the loop in two different SEH modes: |
292 // enable_SEH_restoration_ = false : any unhandled exception goes to the last | 298 // enable_SEH_restoration_ = false : any unhandled exception goes to the last |
293 // one that calls SetUnhandledExceptionFilter(). | 299 // one that calls SetUnhandledExceptionFilter(). |
294 // enable_SEH_restoration_ = true : any unhandled exception goes to the filter | 300 // enable_SEH_restoration_ = true : any unhandled exception goes to the filter |
295 // that was existed before the loop was run. | 301 // that was existed before the loop was run. |
296 void MessageLoop::RunHandler() { | 302 void MessageLoop::RunHandler() { |
297 #if defined(OS_WIN) | 303 #if defined(OS_WIN) |
298 if (exception_restoration_) { | 304 if (exception_restoration_) { |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
696 Watcher *delegate) { | 702 Watcher *delegate) { |
697 return pump_libevent()->WatchFileDescriptor( | 703 return pump_libevent()->WatchFileDescriptor( |
698 fd, | 704 fd, |
699 persistent, | 705 persistent, |
700 static_cast<base::MessagePumpLibevent::Mode>(mode), | 706 static_cast<base::MessagePumpLibevent::Mode>(mode), |
701 controller, | 707 controller, |
702 delegate); | 708 delegate); |
703 } | 709 } |
704 | 710 |
705 #endif | 711 #endif |
OLD | NEW |