OLD | NEW |
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/renderer/media/scoped_loop_observer.h" | 5 #include "media/audio/scoped_loop_observer.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/synchronization/waitable_event.h" | 8 #include "base/synchronization/waitable_event.h" |
9 | 9 |
| 10 namespace media { |
| 11 |
10 ScopedLoopObserver::ScopedLoopObserver( | 12 ScopedLoopObserver::ScopedLoopObserver( |
11 const scoped_refptr<base::MessageLoopProxy>& loop) | 13 const scoped_refptr<base::MessageLoopProxy>& loop) |
12 : loop_(loop) { | 14 : loop_(loop) { |
13 ObserveLoopDestruction(true, NULL); | 15 ObserveLoopDestruction(true, NULL); |
14 } | 16 } |
15 | 17 |
16 ScopedLoopObserver::~ScopedLoopObserver() { | 18 ScopedLoopObserver::~ScopedLoopObserver() { |
17 ObserveLoopDestruction(false, NULL); | 19 ObserveLoopDestruction(false, NULL); |
18 } | 20 } |
19 | 21 |
(...skipping 14 matching lines...) Expand all Loading... |
34 base::Unretained(this), enable, &event))) { | 36 base::Unretained(this), enable, &event))) { |
35 event.Wait(); | 37 event.Wait(); |
36 } else { | 38 } else { |
37 // The message loop's thread has already terminated, so no need to wait. | 39 // The message loop's thread has already terminated, so no need to wait. |
38 } | 40 } |
39 } | 41 } |
40 | 42 |
41 if (done) | 43 if (done) |
42 done->Signal(); | 44 done->Signal(); |
43 } | 45 } |
| 46 |
| 47 } // namespace media. |
OLD | NEW |