| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_source_observer.h" | 5 #include "content/renderer/media/media_stream_source_observer.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "content/renderer/media/media_stream_source_extra_data.h" | 8 #include "content/renderer/media/media_stream_source.h" |
| 9 | 9 |
| 10 namespace content { | 10 namespace content { |
| 11 | 11 |
| 12 MediaStreamSourceObserver::MediaStreamSourceObserver( | 12 MediaStreamSourceObserver::MediaStreamSourceObserver( |
| 13 webrtc::MediaSourceInterface* webrtc_source, | 13 webrtc::MediaSourceInterface* webrtc_source, |
| 14 MediaStreamSourceExtraData* extra_data) | 14 MediaStreamSource* extra_data) |
| 15 : state_(webrtc_source->state()), | 15 : state_(webrtc_source->state()), |
| 16 webrtc_source_(webrtc_source), | 16 webrtc_source_(webrtc_source), |
| 17 extra_data_(extra_data) { | 17 extra_data_(extra_data) { |
| 18 webrtc_source_->RegisterObserver(this); | 18 webrtc_source_->RegisterObserver(this); |
| 19 } | 19 } |
| 20 | 20 |
| 21 MediaStreamSourceObserver::~MediaStreamSourceObserver() { | 21 MediaStreamSourceObserver::~MediaStreamSourceObserver() { |
| 22 DCHECK(CalledOnValidThread()); | 22 DCHECK(CalledOnValidThread()); |
| 23 if (webrtc_source_.get()) | 23 if (webrtc_source_.get()) |
| 24 webrtc_source_->UnregisterObserver(this); | 24 webrtc_source_->UnregisterObserver(this); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 54 webrtc_source_->UnregisterObserver(this); | 54 webrtc_source_->UnregisterObserver(this); |
| 55 webrtc_source_ = NULL; | 55 webrtc_source_ = NULL; |
| 56 break; | 56 break; |
| 57 default: | 57 default: |
| 58 NOTREACHED(); | 58 NOTREACHED(); |
| 59 break; | 59 break; |
| 60 } | 60 } |
| 61 } | 61 } |
| 62 | 62 |
| 63 } // namespace content | 63 } // namespace content |
| OLD | NEW |