WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-137765-20141017142029.patch (text/plain), 14.81 KB, created by
Gyuyoung Kim
on 2014-10-16 22:20:25 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Gyuyoung Kim
Created:
2014-10-16 22:20:25 PDT
Size:
14.81 KB
patch
obsolete
>Subversion Revision: 174805 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index e493a8d8ef5276141b5ba7be666bac0feaba4a4c..5fe375975c586e0aa2941c8a009e3737654ff6d8 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,27 @@ >+2014-10-16 Gyuyoung Kim <gyuyoung.kim@samsung.com> >+ >+ Use std::unique_ptr instead of PassOwnPtr|OwnPtr in MediaPlayerFoo classes >+ https://bugs.webkit.org/show_bug.cgi?id=137765 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ No new tests, no behavior changes. >+ >+ * html/HTMLMediaElement.cpp: >+ (WebCore::HTMLMediaElement::parseAttribute): >+ * html/HTMLMediaElement.h: >+ * platform/graphics/MediaPlayer.cpp: >+ (WebCore::createNullMediaPlayer): >+ * platform/graphics/MediaPlayer.h: >+ (WebCore::MediaPlayer::create): >+ * platform/graphics/MediaPlayerPrivate.h: >+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: >+ (WebCore::MediaPlayerPrivateGStreamer::create): >+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: >+ * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp: >+ (WebCore::MockMediaPlayerMediaSource::create): >+ * platform/mock/mediasource/MockMediaPlayerMediaSource.h: ditto. >+ > 2014-10-16 Chris Dumez <cdumez@apple.com> > > Use is<>() / downcast<>() for BasicShape subclasses >diff --git a/Source/WebCore/html/HTMLMediaElement.cpp b/Source/WebCore/html/HTMLMediaElement.cpp >index 1fa90eb32998ad2dcfba067d993deba26e261a72..b58525a04133b921c96a3d6e5d51b827de7d02bc 100644 >--- a/Source/WebCore/html/HTMLMediaElement.cpp >+++ b/Source/WebCore/html/HTMLMediaElement.cpp >@@ -4646,7 +4646,7 @@ void HTMLMediaElement::clearMediaPlayer(int flags) > m_mediaSession->setHasPlaybackTargetAvailabilityListeners(*this, false); > #endif > >- m_player.clear(); >+ m_player = nullptr; > > stopPeriodicTimers(); > m_loadTimer.stop(); >@@ -4693,7 +4693,7 @@ void HTMLMediaElement::stop() > // Once an active DOM object has been stopped it can not be restarted, so we can deallocate > // the media player now. Note that userCancelledLoad will already have cleared the player > // if the media was not fully loaded. This handles all other cases. >- m_player.clear(); >+ m_player = nullptr; > > updateSleepDisabling(); > } >diff --git a/Source/WebCore/html/HTMLMediaElement.h b/Source/WebCore/html/HTMLMediaElement.h >index 13ea7ad6b8a5043fa01788d350d7ef8a848bcc3a..40a0e18c7bfb4dae2fc4f6ea051cf32504a141f1 100644 >--- a/Source/WebCore/html/HTMLMediaElement.h >+++ b/Source/WebCore/html/HTMLMediaElement.h >@@ -770,7 +770,7 @@ private: > MediaPlayer::VideoGravity m_videoFullscreenGravity; > #endif > >- OwnPtr<MediaPlayer> m_player; >+ std::unique_ptr<MediaPlayer> m_player; > > MediaPlayer::Preload m_preload; > >diff --git a/Source/WebCore/platform/graphics/MediaPlayer.cpp b/Source/WebCore/platform/graphics/MediaPlayer.cpp >index 8ad79db77c9b0536a70f64ed61a3e6f21e57d3e2..47169afd11f623620c699dbbe3afb262f968cccd 100644 >--- a/Source/WebCore/platform/graphics/MediaPlayer.cpp >+++ b/Source/WebCore/platform/graphics/MediaPlayer.cpp >@@ -144,12 +144,11 @@ public: > #endif > }; > >-static PassOwnPtr<MediaPlayerPrivateInterface> createNullMediaPlayer(MediaPlayer* player) >-{ >- return adoptPtr(new NullMediaPlayerPrivate(player)); >+static std::unique_ptr<MediaPlayerPrivateInterface> createNullMediaPlayer(MediaPlayer* player) >+{ >+ return std::make_unique<NullMediaPlayerPrivate>(player); > } > >- > // engine support > > struct MediaPlayerFactory { >diff --git a/Source/WebCore/platform/graphics/MediaPlayer.h b/Source/WebCore/platform/graphics/MediaPlayer.h >index 7c6add6b37628cc1746529fc4e7c951ea1861398..1b8af899df2b0b1859c9292e725c7b468484b5aa 100644 >--- a/Source/WebCore/platform/graphics/MediaPlayer.h >+++ b/Source/WebCore/platform/graphics/MediaPlayer.h >@@ -278,11 +278,11 @@ public: > class MediaPlayer { > WTF_MAKE_NONCOPYABLE(MediaPlayer); WTF_MAKE_FAST_ALLOCATED; > public: >- >- static PassOwnPtr<MediaPlayer> create(MediaPlayerClient& client) >+ static std::unique_ptr<MediaPlayer> create(MediaPlayerClient& client) > { >- return adoptPtr(new MediaPlayer(client)); >+ return std::unique_ptr<MediaPlayer>(new MediaPlayer(client)); > } >+ > virtual ~MediaPlayer(); > > // Media engine support. >@@ -577,7 +577,8 @@ public: > String sourceApplicationIdentifier() const; > > private: >- MediaPlayer(MediaPlayerClient&); >+ explicit MediaPlayer(MediaPlayerClient&); >+ > MediaPlayerFactory* nextBestMediaEngine(MediaPlayerFactory*) const; > void loadWithNextMediaEngine(MediaPlayerFactory*); > void reloadTimerFired(Timer<MediaPlayer>&); >@@ -586,7 +587,7 @@ private: > > MediaPlayerClient& m_client; > Timer<MediaPlayer> m_reloadTimer; >- OwnPtr<MediaPlayerPrivateInterface> m_private; >+ std::unique_ptr<MediaPlayerPrivateInterface> m_private; > MediaPlayerFactory* m_currentMediaEngine; > URL m_url; > String m_contentMIMEType; >@@ -608,7 +609,7 @@ private: > #endif > }; > >-typedef PassOwnPtr<MediaPlayerPrivateInterface> (*CreateMediaEnginePlayer)(MediaPlayer*); >+typedef std::unique_ptr<MediaPlayerPrivateInterface> (*CreateMediaEnginePlayer)(MediaPlayer*); > typedef void (*MediaEngineSupportedTypes)(HashSet<String>& types); > typedef MediaPlayer::SupportsType (*MediaEngineSupportsType)(const MediaEngineSupportParameters& parameters); > typedef void (*MediaEngineGetSitesInMediaCache)(Vector<String>&); >diff --git a/Source/WebCore/platform/graphics/MediaPlayerPrivate.h b/Source/WebCore/platform/graphics/MediaPlayerPrivate.h >index 0387a7d1528c4d58eb4356675b1d857ef56e60aa..431e01b876ec935b72da377e7962b1a10326b905 100644 >--- a/Source/WebCore/platform/graphics/MediaPlayerPrivate.h >+++ b/Source/WebCore/platform/graphics/MediaPlayerPrivate.h >@@ -31,7 +31,6 @@ > #include "MediaPlayer.h" > #include "PlatformTimeRanges.h" > #include <wtf/Forward.h> >-#include <wtf/OwnPtr.h> > > namespace WebCore { > >diff --git a/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp b/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp >index 275d9e125d270a2ab5048ffefdfd5ca915106026..fdd96f4dc9c4a02fd209e7de5d230365a7e41521 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp >+++ b/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp >@@ -335,9 +335,9 @@ static dispatch_queue_t globalLoaderDelegateQueue() > } > #endif > >-PassOwnPtr<MediaPlayerPrivateInterface> MediaPlayerPrivateAVFoundationCF::create(MediaPlayer* player) >-{ >- return adoptPtr(new MediaPlayerPrivateAVFoundationCF(player)); >+std::unique_ptr<MediaPlayerPrivateInterface> MediaPlayerPrivateAVFoundationCF::create(MediaPlayer* player) >+{ >+ return std::unique_ptr<MediaPlayerPrivateAVFoundationCF>(player); > } > > void MediaPlayerPrivateAVFoundationCF::registerMediaEngine(MediaEngineRegistrar registrar) >diff --git a/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h b/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h >index 2ac0144daa938cd2302c6b2d67dda303500847d3..26256b68067f83004ce20c51810c07754805e037 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h >+++ b/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h >@@ -41,6 +41,7 @@ class WebCoreAVCFResourceLoader; > > class MediaPlayerPrivateAVFoundationCF : public MediaPlayerPrivateAVFoundation { > public: >+ static std::unique_ptr<MediaPlayerPrivateInterface> create(MediaPlayer*); > virtual ~MediaPlayerPrivateAVFoundationCF(); > > virtual void tracksChanged() override; >@@ -58,10 +59,9 @@ public: > static void registerMediaEngine(MediaEngineRegistrar); > > private: >- MediaPlayerPrivateAVFoundationCF(MediaPlayer*); >+ explicit MediaPlayerPrivateAVFoundationCF(MediaPlayer*); > > // Engine support >- static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*); > static void getSupportedTypes(HashSet<String>& types); > static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&); > static bool supportsKeySystem(const String& keySystem, const String& mimeType); >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h >index 37fcc61d93ba716d96d655a3e7bebe575a04fd3f..b36c9f8912921bc5fd5f2f804b1dc04a3cb3795e 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h >@@ -68,6 +68,9 @@ class VideoTrackPrivateAVFObjC; > > class MediaPlayerPrivateAVFoundationObjC : public MediaPlayerPrivateAVFoundation { > public: >+ // engine support >+ static std::unique_ptr<MediaPlayerPrivateInterface> create(MediaPlayer*); >+ > virtual ~MediaPlayerPrivateAVFoundationObjC(); > > static void registerMediaEngine(MediaEngineRegistrar); >@@ -132,8 +135,6 @@ public: > private: > MediaPlayerPrivateAVFoundationObjC(MediaPlayer*); > >- // engine support >- static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*); > static void getSupportedTypes(HashSet<String>& types); > static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&); > static bool supportsKeySystem(const String& keySystem, const String& mimeType); >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm >index 98eb8ecc66b0aedd725133d54fdf1459454f33b2..96d940f4e5a4dc1fae020b76a10e8fd5cece49ed 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm >@@ -371,9 +371,9 @@ static dispatch_queue_t globalPullDelegateQueue() > } > #endif > >-PassOwnPtr<MediaPlayerPrivateInterface> MediaPlayerPrivateAVFoundationObjC::create(MediaPlayer* player) >+std::unique_ptr<MediaPlayerPrivateInterface> MediaPlayerPrivateAVFoundationObjC::create(MediaPlayer* player) > { >- return adoptPtr(new MediaPlayerPrivateAVFoundationObjC(player)); >+ return std::unique_ptr<MediaPlayerPrivateAVFoundationObjC>(new MediaPlayerPrivateAVFoundationObjC(player)); > } > > void MediaPlayerPrivateAVFoundationObjC::registerMediaEngine(MediaEngineRegistrar registrar) >diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp >index 8ac8fccfbab3a1756d1972ed74c7d068de3d968f..093aff939c7bd75a9e36fae82aa38eb24900c042 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp >@@ -138,9 +138,9 @@ void MediaPlayerPrivateGStreamer::setAudioStreamProperties(GObject* object) > LOG_MEDIA_MESSAGE("Set media.role as %s at %s", role, elementName.get()); > } > >-PassOwnPtr<MediaPlayerPrivateInterface> MediaPlayerPrivateGStreamer::create(MediaPlayer* player) >+std::unique_ptr<MediaPlayerPrivateInterface> MediaPlayerPrivateGStreamer::create(MediaPlayer* player) > { >- return adoptPtr(new MediaPlayerPrivateGStreamer(player)); >+ return std::unique_ptr<MediaPlayerPrivateGStreamer>(new MediaPlayerPrivateGStreamer(player)); > } > > void MediaPlayerPrivateGStreamer::registerMediaEngine(MediaEngineRegistrar registrar) >diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h >index 5084921982c618432a1aa2f1ffa9c0f81c31ba76..be1aae846df37d05a4cc533401037a1651eff66d 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h >+++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h >@@ -57,7 +57,9 @@ class VideoTrackPrivateGStreamer; > > class MediaPlayerPrivateGStreamer : public MediaPlayerPrivateGStreamerBase { > public: >+ static std::unique_ptr<MediaPlayerPrivateInterface> create(MediaPlayer*); > ~MediaPlayerPrivateGStreamer(); >+ > static void registerMediaEngine(MediaEngineRegistrar); > gboolean handleMessage(GstMessage*); > void handlePluginInstallerResult(GstInstallPluginsReturn); >@@ -126,9 +128,7 @@ public: > bool changePipelineState(GstState); > > private: >- MediaPlayerPrivateGStreamer(MediaPlayer*); >- >- static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*); >+ explicit MediaPlayerPrivateGStreamer(MediaPlayer*); > > static void getSupportedTypes(HashSet<String>&); > static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&); >diff --git a/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp b/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp >index c66178b9677cf84965d98bf88be3a3986f7e38da..f20fa048a5a8d0db314f1cd7d9c6273c014e97d8 100644 >--- a/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp >+++ b/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp >@@ -44,9 +44,9 @@ void MockMediaPlayerMediaSource::registerMediaEngine(MediaEngineRegistrar regist > registrar(create, getSupportedTypes, supportsType, 0, 0, 0, 0); > } > >-PassOwnPtr<MediaPlayerPrivateInterface> MockMediaPlayerMediaSource::create(MediaPlayer* player) >+std::unique_ptr<MediaPlayerPrivateInterface> MockMediaPlayerMediaSource::create(MediaPlayer* player) > { >- return adoptPtr(new MockMediaPlayerMediaSource(player)); >+ return std::unique_ptr<MockMediaPlayerMediaSource>(new MockMediaPlayerMediaSource(player)); > } > > static HashSet<String> mimeTypeCache() >diff --git a/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h b/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h >index b6694d8ed8737989eb0bf6eef963906365ffb97f..fc96357ad0e83c9bd16413bf110b42e8ddc01a33 100644 >--- a/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h >+++ b/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h >@@ -38,9 +38,10 @@ class MockMediaSourcePrivate; > > class MockMediaPlayerMediaSource : public MediaPlayerPrivateInterface { > public: >+ static std::unique_ptr<MediaPlayerPrivateInterface> create(MediaPlayer*); >+ > // MediaPlayer Engine Support > static void registerMediaEngine(MediaEngineRegistrar); >- static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*); > static void getSupportedTypes(HashSet<String>& types); > static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&); > >@@ -56,7 +57,7 @@ public: > void seekCompleted(); > > private: >- MockMediaPlayerMediaSource(MediaPlayer*); >+ explicit MockMediaPlayerMediaSource(MediaPlayer*); > > // MediaPlayerPrivate Overrides > virtual void load(const String& url) override;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 137765
:
239922
|
239924
|
239994
|
239998
|
240105
|
240202
|
240235
|
240253
|
240327
|
240331
|
240333
|
240335
|
240588
|
240590
|
240593
|
246713
|
246720
|
246728
|
246736
|
246944