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

Side by Side Diff: base/message_loop.cc

Issue 6374010: Add MessageLoop::AssertIdle(). Use in ChromeOS audio threads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update comments. Created 9 years, 11 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/browser/chromeos/audio_mixer_alsa.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) 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
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
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
OLDNEW
« no previous file with comments | « base/message_loop.h ('k') | chrome/browser/chromeos/audio_mixer_alsa.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698