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/media_stream_dependency_factory.h" | 5 #include "content/renderer/media/media_stream_dependency_factory.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/synchronization/waitable_event.h" | 9 #include "base/synchronization/waitable_event.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 default: | 122 default: |
123 NOTREACHED(); | 123 NOTREACHED(); |
124 } | 124 } |
125 } | 125 } |
126 | 126 |
127 void StartObservering() { | 127 void StartObservering() { |
128 DCHECK(CalledOnValidThread()); | 128 DCHECK(CalledOnValidThread()); |
129 CheckIfSourcesAreLive(); | 129 CheckIfSourcesAreLive(); |
130 } | 130 } |
131 | 131 |
132 virtual void OnChanged() { | 132 virtual void OnChanged() OVERRIDE { |
133 DCHECK(CalledOnValidThread()); | 133 DCHECK(CalledOnValidThread()); |
134 CheckIfSourcesAreLive(); | 134 CheckIfSourcesAreLive(); |
135 } | 135 } |
136 | 136 |
137 private: | 137 private: |
138 void CheckIfSourcesAreLive() { | 138 void CheckIfSourcesAreLive() { |
139 ObservedSources::iterator it = sources_.begin(); | 139 ObservedSources::iterator it = sources_.begin(); |
140 while (it != sources_.end()) { | 140 while (it != sources_.end()) { |
141 if ((*it)->state() != webrtc::MediaSourceInterface::kInitializing) { | 141 if ((*it)->state() != webrtc::MediaSourceInterface::kInitializing) { |
142 live_ &= (*it)->state() == webrtc::MediaSourceInterface::kLive; | 142 live_ &= (*it)->state() == webrtc::MediaSourceInterface::kLive; |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 // processed before returning. We wait for the above task to finish before | 591 // processed before returning. We wait for the above task to finish before |
592 // letting the the function continue to avoid any potential race issues. | 592 // letting the the function continue to avoid any potential race issues. |
593 chrome_worker_thread_.Stop(); | 593 chrome_worker_thread_.Stop(); |
594 } else { | 594 } else { |
595 NOTREACHED() << "Worker thread not running."; | 595 NOTREACHED() << "Worker thread not running."; |
596 } | 596 } |
597 } | 597 } |
598 } | 598 } |
599 | 599 |
600 } // namespace content | 600 } // namespace content |
OLD | NEW |