Title: [208786] trunk/Source/WebCore
Revision
208786
Author
[email protected]
Date
2016-11-15 22:51:50 -0800 (Tue, 15 Nov 2016)

Log Message

Warning added in r208542
https://bugs.webkit.org/show_bug.cgi?id=164636

Patch by Alejandro G. Castro <[email protected]> on 2016-11-15
Reviewed by Eric Carlson.

Deleted the copy constructor, we now explicitly copy the object in
the clone method.

* platform/mediastream/MediaStreamTrackPrivate.cpp: Delete the
copy constructor.
(WebCore::MediaStreamTrackPrivate::clone): Copy the relevant
information for the clone operation in the API.
* platform/mediastream/MediaStreamTrackPrivate.h: Delete the copy
constructor.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (208785 => 208786)


--- trunk/Source/WebCore/ChangeLog	2016-11-16 06:18:16 UTC (rev 208785)
+++ trunk/Source/WebCore/ChangeLog	2016-11-16 06:51:50 UTC (rev 208786)
@@ -1,3 +1,20 @@
+2016-11-15  Alejandro G. Castro  <[email protected]>
+
+        Warning added in r208542
+        https://bugs.webkit.org/show_bug.cgi?id=164636
+
+        Reviewed by Eric Carlson.
+
+        Deleted the copy constructor, we now explicitly copy the object in
+        the clone method.
+
+        * platform/mediastream/MediaStreamTrackPrivate.cpp: Delete the
+        copy constructor.
+        (WebCore::MediaStreamTrackPrivate::clone): Copy the relevant
+        information for the clone operation in the API.
+        * platform/mediastream/MediaStreamTrackPrivate.h: Delete the copy
+        constructor.
+
 2016-11-15  Ryosuke Niwa  <[email protected]>
 
         Add more assertions to ElementQueue diagnose a bug

Modified: trunk/Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.cpp (208785 => 208786)


--- trunk/Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.cpp	2016-11-16 06:18:16 UTC (rev 208785)
+++ trunk/Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.cpp	2016-11-16 06:51:50 UTC (rev 208786)
@@ -47,15 +47,6 @@
     return adoptRef(*new MediaStreamTrackPrivate(WTFMove(source), WTFMove(id)));
 }
 
-MediaStreamTrackPrivate::MediaStreamTrackPrivate(const MediaStreamTrackPrivate& other)
-    : m_source(other.m_source.copyRef())
-    , m_id(createCanonicalUUIDString())
-    , m_isEnabled(other.enabled())
-    , m_isEnded(other.ended())
-{
-    m_source->addObserver(this);
-}
-
 MediaStreamTrackPrivate::MediaStreamTrackPrivate(Ref<RealtimeMediaSource>&& source, String&& id)
     : m_source(WTFMove(source))
     , m_id(WTFMove(id))
@@ -132,7 +123,12 @@
 
 Ref<MediaStreamTrackPrivate> MediaStreamTrackPrivate::clone()
 {
-    return adoptRef(*new MediaStreamTrackPrivate(*this));
+    auto clonedMediaStreamTrackPrivate = create(m_source.copyRef());
+    clonedMediaStreamTrackPrivate->m_isEnabled = this->m_isEnabled;
+    clonedMediaStreamTrackPrivate->m_isEnded = this->m_isEnded;
+    clonedMediaStreamTrackPrivate->m_constraints = this->m_constraints;
+
+    return clonedMediaStreamTrackPrivate;
 }
 
 RealtimeMediaSource::Type MediaStreamTrackPrivate::type() const

Modified: trunk/Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.h (208785 => 208786)


--- trunk/Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.h	2016-11-16 06:18:16 UTC (rev 208785)
+++ trunk/Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.h	2016-11-16 06:51:50 UTC (rev 208786)
@@ -98,7 +98,6 @@
     void paintCurrentFrameInContext(GraphicsContext&, const FloatRect&);
 
 private:
-    explicit MediaStreamTrackPrivate(const MediaStreamTrackPrivate&);
     MediaStreamTrackPrivate(Ref<RealtimeMediaSource>&&, String&& id);
 
     // RealtimeMediaSourceObserver
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to