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-20141016122959.patch (text/plain), 7.96 KB, created by
Gyuyoung Kim
on 2014-10-15 20:29:56 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Gyuyoung Kim
Created:
2014-10-15 20:29:56 PDT
Size:
7.96 KB
patch
obsolete
>Subversion Revision: 174755 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 138fb2f9962ee5120791f01edbf240327079abd2..2f7892f3710c92d81bec57361f286a73c6218497 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,24 @@ >+2014-10-15 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: Set ctor to public. >+ (WebCore::MediaPlayer::create): >+ * platform/graphics/MediaPlayerPrivate.h: >+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: >+ (WebCore::MediaPlayerPrivateGStreamer::create): >+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Set ctor and create() to public. >+ > 2014-10-15 Chris Dumez <cdumez@apple.com> > > [Mac] Fix inefficiencies in ResourceResponse::platformLazyInit(InitLevel) - Part 2 >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..32784f851fb419aa6f19ac3b0f9b3de6ef08074c 100644 >--- a/Source/WebCore/platform/graphics/MediaPlayer.h >+++ b/Source/WebCore/platform/graphics/MediaPlayer.h >@@ -279,10 +279,12 @@ 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::make_unique<MediaPlayer>(client); > } >+ >+ explicit MediaPlayer(MediaPlayerClient&); > virtual ~MediaPlayer(); > > // Media engine support. >@@ -577,7 +579,6 @@ public: > String sourceApplicationIdentifier() const; > > private: >- 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/gstreamer/MediaPlayerPrivateGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp >index 8ac8fccfbab3a1756d1972ed74c7d068de3d968f..d08736b69e7424988185955620d1def9282caecf 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::make_unique<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..d4cedec0aec6997c3a1fc9ce83e26bcba807c1fc 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h >+++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h >@@ -57,7 +57,10 @@ class VideoTrackPrivateGStreamer; > > class MediaPlayerPrivateGStreamer : public MediaPlayerPrivateGStreamerBase { > public: >+ static std::unique_ptr<MediaPlayerPrivateInterface> create(MediaPlayer*); >+ explicit MediaPlayerPrivateGStreamer(MediaPlayer*); > ~MediaPlayerPrivateGStreamer(); >+ > static void registerMediaEngine(MediaEngineRegistrar); > gboolean handleMessage(GstMessage*); > void handlePluginInstallerResult(GstInstallPluginsReturn); >@@ -126,10 +129,6 @@ public: > bool changePipelineState(GstState); > > private: >- MediaPlayerPrivateGStreamer(MediaPlayer*); >- >- static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*); >- > static void getSupportedTypes(HashSet<String>&); > static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&); >
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