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

Unified Diff: third_party/WebKit/Source/platform/mediastream/MediaStreamComponent.cpp

Issue 2540263003: Carry MediaStreamComponent properties on clone. (Closed)
Patch Set: added test + todo comments Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/mediastream/MediaStreamComponent.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..22b8da285c2a1a1c8f3ca569c31fb6bc3c9a1e7d 100644
--- a/third_party/WebKit/Source/platform/mediastream/MediaStreamComponent.cpp
+++ b/third_party/WebKit/Source/platform/mediastream/MediaStreamComponent.cpp
@@ -50,11 +50,27 @@ 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 so that they are
+ // also cloned. Part of crbug:669212 since stopped is currently not carried
+ // over, nor is ended().
+ return clonedComponent;
+}
+
void MediaStreamComponent::dispose() {
m_trackData.reset();
}
« no previous file with comments | « third_party/WebKit/Source/platform/mediastream/MediaStreamComponent.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698