Chromium Code Reviews| Index: third_party/WebKit/Source/platform/mediastream/MediaStreamComponent.cpp |
| diff --git a/third_party/WebKit/Source/platform/mediastream/MediaStreamComponent.cpp b/third_party/WebKit/Source/platform/mediastream/MediaStreamComponent.cpp |
| index 6793c6fc8d6a1ea21f3f577a354f6fef44b25b2d..45a8de56fc1be568765dab6a02d75aee223c8209 100644 |
| --- a/third_party/WebKit/Source/platform/mediastream/MediaStreamComponent.cpp |
| +++ b/third_party/WebKit/Source/platform/mediastream/MediaStreamComponent.cpp |
| @@ -50,11 +50,25 @@ MediaStreamComponent* MediaStreamComponent::create(const String& id, |
| MediaStreamComponent::MediaStreamComponent(const String& id, |
| MediaStreamSource* source) |
| - : m_source(source), m_id(id), m_enabled(true), m_muted(false) { |
| + : MediaStreamComponent(id, source, true, false) {} |
| + |
| +MediaStreamComponent::MediaStreamComponent(const String& id, |
| + MediaStreamSource* source, |
| + bool enabled, |
| + bool muted) |
| + : m_source(source), m_id(id), m_enabled(enabled), m_muted(muted) { |
| DCHECK(m_id.length()); |
| ThreadState::current()->registerPreFinalizer(this); |
| } |
| +MediaStreamComponent* MediaStreamComponent::clone() const { |
| + MediaStreamComponent* clonedComponent = new MediaStreamComponent( |
| + createCanonicalUUIDString(), source(), m_enabled, m_muted); |
| + // TODO(pbos): Clone |m_trackData| as well. |
| + // TODO(pbos): Move properties from MediaStreamTrack here. |
|
Guido Urdaneta
2016/12/01 15:23:24
nit: File a bug about these?
pbos
2016/12/01 17:16:33
Done, using the same bug since some properties are
|
| + return clonedComponent; |
| +} |
| + |
| void MediaStreamComponent::dispose() { |
| m_trackData.reset(); |
| } |