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 for gtk
bug-137765-20141022160151.patch (text/plain), 42.10 KB, created by
Gyuyoung Kim
on 2014-10-22 00:01:45 PDT
(
hide
)
Description:
Patch for gtk
Filename:
MIME Type:
Creator:
Gyuyoung Kim
Created:
2014-10-22 00:01:45 PDT
Size:
42.10 KB
patch
obsolete
>Subversion Revision: 175021 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 18e0941b6ba9a8999247c4f097636d59910acc26..0e0d32b24518d5b47592f791f830f28419c4c2bd 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,63 @@ >+2014-10-21 Gyuyoung Kim <gyuyoung.kim@samsung.com> >+ >+ Use std::unique_ptr instead of PassOwnPtr in MediaPlayerFoo classes >+ https://bugs.webkit.org/show_bug.cgi?id=137765 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ As a step to use std::unique_ptr|make_unique<>, this patch changes use of OwnPtr|PassOwnPtr with >+ std::unique_ptr<>|make_unique<>. However we have to set constructor to public in order to use >+ std::make_unique<>. This change will conflict with MediaPlayerFoo's create() factory function >+ because there are two object creation methods. Thus this patch removes create() factory function >+ in MediaPlayerFoo classes and also lets MediaPlayerFactory create MediaPlayerFoo using std::make_unique<> >+ instead of the create() factory functions. >+ >+ No new tests, no behavior changes. >+ >+ * html/HTMLMediaElement.cpp: >+ (WebCore::HTMLMediaElement::parseAttribute): >+ * html/HTMLMediaElement.h: >+ * platform/graphics/MediaEnginePlayerType.h: Added. >+ * platform/graphics/MediaPlayer.cpp: >+ (WebCore::NullMediaPlayerPrivate::NullMediaPlayerPrivate): >+ (WebCore::MediaPlayerFactory::MediaPlayerFactory): >+ (WebCore::MediaPlayerFactory::createMediaPlayer): >+ (WebCore::addMediaEngine): >+ (WebCore::MediaPlayer::MediaPlayer): >+ (WebCore::MediaPlayer::loadWithNextMediaEngine): >+ (WebCore::createNullMediaPlayer): Deleted. >+ * platform/graphics/MediaPlayer.h: >+ (WebCore::MediaPlayer::create): Deleted. >+ * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h: >+ * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: >+ (WebCore::MediaPlayerPrivateAVFoundationCF::registerMediaEngine): >+ (WebCore::MediaPlayerPrivateAVFoundationCF::create): Deleted. >+ * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h: >+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: >+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: >+ (WebCore::MediaPlayerPrivateAVFoundationObjC::registerMediaEngine): >+ (WebCore::MediaPlayerPrivateAVFoundationObjC::create): Deleted. >+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: >+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: >+ (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::registerMediaEngine): >+ (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::create): Deleted. >+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: >+ (WebCore::MediaPlayerPrivateGStreamer::registerMediaEngine): >+ (WebCore::MediaPlayerPrivateGStreamer::create): Deleted. >+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: >+ * platform/graphics/mac/MediaPlayerPrivateQTKit.h: >+ * platform/graphics/mac/MediaPlayerPrivateQTKit.mm: >+ (WebCore::MediaPlayerPrivateQTKit::registerMediaEngine): >+ (WebCore::MediaPlayerPrivateQTKit::create): Deleted. >+ * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp: >+ (WebCore::MediaPlayerPrivateMediaFoundation::registerMediaEngine): >+ (WebCore::MediaPlayerPrivateMediaFoundation::create): Deleted. >+ * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h: >+ * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp: >+ (WebCore::MockMediaPlayerMediaSource::registerMediaEngine): >+ (WebCore::MockMediaPlayerMediaSource::create): Deleted. >+ * platform/mock/mediasource/MockMediaPlayerMediaSource.h: >+ > 2014-10-21 Andy Estes <aestes@apple.com> > > One more iOS build fix after r175013. >diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt >index 822a604762e7d653cc21648bcdfa9283c72056b4..2f19392d5ac291fde2f7e2ef2a9bd824b30eb657 100644 >--- a/Source/WebCore/CMakeLists.txt >+++ b/Source/WebCore/CMakeLists.txt >@@ -2168,12 +2168,19 @@ set(WebCore_SOURCES > platform/mock/GeolocationClientMock.cpp > platform/mock/MediaConstraintsMock.cpp > platform/mock/MockMediaStreamCenter.cpp >+ platform/mock/PlatformSpeechSynthesizerMock.cpp > platform/mock/RTCDataChannelHandlerMock.cpp > platform/mock/RTCDTMFSenderHandlerMock.cpp > platform/mock/RTCNotifiersMock.cpp > platform/mock/RTCPeerConnectionHandlerMock.cpp > platform/mock/ScrollbarThemeMock.cpp > >+ platform/mock/mediasource/MockBox.cpp >+ platform/mock/mediasource/MockMediaPlayerMediaSource.cpp >+ platform/mock/mediasource/MockMediaSourcePrivate.cpp >+ platform/mock/mediasource/MockSourceBufferPrivate.cpp >+ platform/mock/mediasource/MockTracks.cpp >+ > platform/network/AuthenticationChallengeBase.cpp > platform/network/BlobData.cpp > platform/network/BlobDataFileReference.cpp >@@ -3123,14 +3130,6 @@ set(WebCoreTestSupport_IDL_FILES > ) > > set(WebCoreTestSupport_SOURCES >- platform/mock/PlatformSpeechSynthesizerMock.cpp >- >- platform/mock/mediasource/MockBox.cpp >- platform/mock/mediasource/MockMediaPlayerMediaSource.cpp >- platform/mock/mediasource/MockMediaSourcePrivate.cpp >- platform/mock/mediasource/MockSourceBufferPrivate.cpp >- platform/mock/mediasource/MockTracks.cpp >- > testing/InternalSettings.cpp > testing/Internals.cpp > >diff --git a/Source/WebCore/WebCore.exp.in b/Source/WebCore/WebCore.exp.in >index 413e406af4e937b222f71fbeadd2edbffc2fca27..f930790225480dd3b59779dc81f4d9a2d0bf3b7b 100644 >--- a/Source/WebCore/WebCore.exp.in >+++ b/Source/WebCore/WebCore.exp.in >@@ -3232,7 +3232,7 @@ __ZN7WebCore8Document13getTouchRectsERN3WTF6VectorINS_7IntRectELm0ENS1_15CrashOn > #if ENABLE(MEDIA_SOURCE) > __ZN7WebCore12SourceBuffer25bufferedSamplesForTrackIDERKN3WTF12AtomicStringE > __ZN7WebCore14JSSourceBuffer9toWrappedEN3JSC7JSValueE >-__ZN7WebCore26MockMediaPlayerMediaSource19registerMediaEngineEPFvPFN3WTF10PassOwnPtrINS_27MediaPlayerPrivateInterfaceEEEPNS_11MediaPlayerEEPFvRNS1_7HashSetINS1_6StringENS1_10StringHashENS1_10HashTraitsISA_EEEEEPFNS5_12SupportsTypeERKNS_28MediaEngineSupportParametersEEPFvRNS1_6VectorISA_Lm0ENS1_15CrashOnOverflowEEEEPFvvEPFvRKSA_EPFbSX_SX_EE >+__ZN7WebCore26MockMediaPlayerMediaSource19registerMediaEngineEPFvNS_21MediaEnginePlayerTypeEPFvRN3WTF7HashSetINS2_6StringENS2_10StringHashENS2_10HashTraitsIS4_EEEEEPFNS_11MediaPlayer12SupportsTypeERKNS_28MediaEngineSupportParametersEEPFvRNS2_6VectorIS4_Lm0ENS2_15CrashOnOverflowEEEEPFvvEPFvRKS4_EPFbSS_SS_EE > #endif > > #if ENABLE(MEDIA_STREAM) >@@ -3408,7 +3408,7 @@ __ZN7WebCore16HTMLMediaElement22clearMediaCacheForSiteERKN3WTF6StringE > __ZN7WebCore16HTMLMediaElement4playEv > __ZN7WebCore16HTMLMediaElement5pauseEv > __ZN7WebCore16HTMLMediaElement8setMutedEb >-__ZN7WebCore25MediaPlayerFactorySupport23callRegisterMediaEngineEPFvPFvPFN3WTF10PassOwnPtrINS_27MediaPlayerPrivateInterfaceEEEPNS_11MediaPlayerEEPFvRNS1_7HashSetINS1_6StringENS1_10StringHashENS1_10HashTraitsISA_EEEEEPFNS5_12SupportsTypeERKNS_28MediaEngineSupportParametersEEPFvRNS1_6VectorISA_Lm0ENS1_15CrashOnOverflowEEEEPFvvEPFvRKSA_EPFbSX_SX_EEE >+__ZN7WebCore25MediaPlayerFactorySupport23callRegisterMediaEngineEPFvPFvNS_21MediaEnginePlayerTypeEPFvRN3WTF7HashSetINS2_6StringENS2_10StringHashENS2_10HashTraitsIS4_EEEEEPFNS_11MediaPlayer12SupportsTypeERKNS_28MediaEngineSupportParametersEEPFvRNS2_6VectorIS4_Lm0ENS2_15CrashOnOverflowEEEEPFvvEPFvRKS4_EPFbSS_SS_EEE > __ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_10TimeRangesE > __ZNK7WebCore10TimeRanges7nearestEd > __ZNK7WebCore16HTMLMediaElement11currentTimeEv >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index 165dac9aec8fc22d8e11e6567b8677415455e281..b45e1173d0a42478acfe5e56ccc0bce8808e167d 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -5576,6 +5576,7 @@ > CA3BF67E10D99BAE00E6CE53 /* ScrollAnimator.h in Headers */ = {isa = PBXBuildFile; fileRef = CA3BF67D10D99BAE00E6CE53 /* ScrollAnimator.h */; settings = {ATTRIBUTES = (Private, ); }; }; > CAE9F90F146441F000C245B0 /* CSSAspectRatioValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CAE9F90D146441F000C245B0 /* CSSAspectRatioValue.cpp */; }; > CAE9F910146441F000C245B0 /* CSSAspectRatioValue.h in Headers */ = {isa = PBXBuildFile; fileRef = CAE9F90E146441F000C245B0 /* CSSAspectRatioValue.h */; }; >+ CBB7460019F73DA800520543 /* MediaEnginePlayerType.h in Headers */ = {isa = PBXBuildFile; fileRef = CBB745FF19F73C2600520543 /* MediaEnginePlayerType.h */; settings = {ATTRIBUTES = (Private, ); }; }; > CCC2B51415F613060048CDD6 /* DeviceClient.h in Headers */ = {isa = PBXBuildFile; fileRef = CCC2B51015F613060048CDD6 /* DeviceClient.h */; settings = {ATTRIBUTES = (Private, ); }; }; > CCC2B51515F613060048CDD6 /* DeviceController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CCC2B51115F613060048CDD6 /* DeviceController.cpp */; }; > CCC2B51615F613060048CDD6 /* DeviceController.h in Headers */ = {isa = PBXBuildFile; fileRef = CCC2B51215F613060048CDD6 /* DeviceController.h */; settings = {ATTRIBUTES = (Private, ); }; }; >@@ -12993,6 +12994,7 @@ > CA3BF67D10D99BAE00E6CE53 /* ScrollAnimator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollAnimator.h; sourceTree = "<group>"; }; > CAE9F90D146441F000C245B0 /* CSSAspectRatioValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSAspectRatioValue.cpp; sourceTree = "<group>"; }; > CAE9F90E146441F000C245B0 /* CSSAspectRatioValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSAspectRatioValue.h; sourceTree = "<group>"; }; >+ CBB745FF19F73C2600520543 /* MediaEnginePlayerType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaEnginePlayerType.h; sourceTree = "<group>"; }; > CCC2B51015F613060048CDD6 /* DeviceClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceClient.h; sourceTree = "<group>"; }; > CCC2B51115F613060048CDD6 /* DeviceController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeviceController.cpp; sourceTree = "<group>"; }; > CCC2B51215F613060048CDD6 /* DeviceController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceController.h; sourceTree = "<group>"; }; >@@ -20475,6 +20477,7 @@ > 141DC04C164834B900371E5A /* LayoutRect.cpp */, > 141DC04D164834B900371E5A /* LayoutRect.h */, > 141DC04E164834B900371E5A /* LayoutSize.h */, >+ CBB745FF19F73C2600520543 /* MediaEnginePlayerType.h */, > E4B41E0C0CBF90BD00AF2ECE /* MediaPlayer.cpp */, > E4B41E0D0CBF90BD00AF2ECE /* MediaPlayer.h */, > 079F5E4B0F3BEBEA005E0782 /* MediaPlayerPrivate.h */, >@@ -24450,6 +24453,7 @@ > A8D223FE16B52E4E00157288 /* HTMLResourcePreloader.h in Headers */, > A871DC250A15205700B12A68 /* HTMLScriptElement.h in Headers */, > 977B3875122883E900B81FF8 /* HTMLScriptRunner.h in Headers */, >+ CBB7460019F73DA800520543 /* MediaEnginePlayerType.h in Headers */, > 977B3876122883E900B81FF8 /* HTMLScriptRunnerHost.h in Headers */, > A81369D8097374F600D74463 /* HTMLSelectElement.h in Headers */, > E44613A80CD6331000FADA75 /* HTMLSourceElement.h in Headers */, >diff --git a/Source/WebCore/html/HTMLMediaElement.cpp b/Source/WebCore/html/HTMLMediaElement.cpp >index 204d20c88baddfac57815f058fe3d8c3d03ef84d..724f7b8511a0bf07bf680a3a92e2f5858607198d 100644 >--- a/Source/WebCore/html/HTMLMediaElement.cpp >+++ b/Source/WebCore/html/HTMLMediaElement.cpp >@@ -4645,7 +4645,7 @@ void HTMLMediaElement::clearMediaPlayer(int flags) > m_mediaSession->setHasPlaybackTargetAvailabilityListeners(*this, false); > #endif > >- m_player.clear(); >+ m_player = nullptr; > > stopPeriodicTimers(); > m_loadTimer.stop(); >@@ -4692,7 +4692,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(); > } >@@ -5333,7 +5333,7 @@ void HTMLMediaElement::createMediaPlayer() > #if ENABLE(VIDEO_TRACK) > forgetResourceSpecificTracks(); > #endif >- m_player = MediaPlayer::create(*this); >+ m_player = std::make_unique<MediaPlayer>(static_cast<MediaPlayerClient&>(*this)); > > #if ENABLE(WEB_AUDIO) > if (m_audioSourceNode) { >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/MediaEnginePlayerType.h b/Source/WebCore/platform/graphics/MediaEnginePlayerType.h >new file mode 100644 >index 0000000000000000000000000000000000000000..057568180705c04dff9b4efbdd5354d10dd26a06 >--- /dev/null >+++ b/Source/WebCore/platform/graphics/MediaEnginePlayerType.h >@@ -0,0 +1,43 @@ >+/* >+ * Copyright (C) 2014 Samsung Electronics. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+ >+#ifndef MediaEnginePlayerType_h >+#define MediaEnginePlayerType_h >+ >+namespace WebCore { >+typedef enum { >+ NullMediaPlayer, >+ AVFoundationCFPlayer, >+ AVFoundationObjCPlayer, >+ MediaSourceAVFObjCPlayer, >+ GStreamerPlayer, >+ QTKitPlayer, >+ MediaFoundationPlayer, >+ MockMediaSourcePlayer >+} MediaEnginePlayerType; >+} >+ >+#endif >diff --git a/Source/WebCore/platform/graphics/MediaPlayer.cpp b/Source/WebCore/platform/graphics/MediaPlayer.cpp >index 8ad79db77c9b0536a70f64ed61a3e6f21e57d3e2..5e15151144d054ad65b46ee01f186bf34d5772c4 100644 >--- a/Source/WebCore/platform/graphics/MediaPlayer.cpp >+++ b/Source/WebCore/platform/graphics/MediaPlayer.cpp >@@ -44,6 +44,7 @@ > > #if ENABLE(MEDIA_SOURCE) > #include "MediaSourcePrivateClient.h" >+#include "MockMediaPlayerMediaSource.h" > #endif > > #if USE(GSTREAMER) >@@ -56,14 +57,15 @@ > #define PlatformMediaEngineClassName MediaPlayerPrivateMediaFoundation > #endif > >+#if ENABLE(VIDEO) && USE(AVFOUNDATION) >+#include "MediaPlayerPrivateAVFoundationObjC.h" >+#endif >+ > #if PLATFORM(COCOA) > #include "MediaPlayerPrivateQTKit.h" >-#if USE(AVFOUNDATION) >-#include "MediaPlayerPrivateAVFoundationObjC.h" > #if ENABLE(MEDIA_SOURCE) > #include "MediaPlayerPrivateMediaSourceAVFObjC.h" > #endif >-#endif > #elif PLATFORM(WIN) && !USE(GSTREAMER) > #if USE(AVFOUNDATION) > #include "MediaPlayerPrivateAVFoundationCF.h" >@@ -78,7 +80,7 @@ const PlatformMedia NoPlatformMedia = { PlatformMedia::None, {0} }; > > class NullMediaPlayerPrivate : public MediaPlayerPrivateInterface { > public: >- NullMediaPlayerPrivate(MediaPlayer*) { } >+ explicit NullMediaPlayerPrivate(MediaPlayer*) { } > > virtual void load(const String&) { } > #if ENABLE(MEDIA_SOURCE) >@@ -144,39 +146,73 @@ public: > #endif > }; > >-static PassOwnPtr<MediaPlayerPrivateInterface> createNullMediaPlayer(MediaPlayer* player) >-{ >- return adoptPtr(new NullMediaPlayerPrivate(player)); >-} >- > > // engine support > > struct MediaPlayerFactory { > WTF_MAKE_NONCOPYABLE(MediaPlayerFactory); WTF_MAKE_FAST_ALLOCATED; > public: >- MediaPlayerFactory(CreateMediaEnginePlayer constructor, MediaEngineSupportedTypes getSupportedTypes, MediaEngineSupportsType supportsTypeAndCodecs, >+ MediaPlayerFactory(MediaEnginePlayerType playerType, MediaEngineSupportedTypes getSupportedTypes, MediaEngineSupportsType supportsTypeAndCodecs, > MediaEngineGetSitesInMediaCache getSitesInMediaCache, MediaEngineClearMediaCache clearMediaCache, MediaEngineClearMediaCacheForSite clearMediaCacheForSite, MediaEngineSupportsKeySystem supportsKeySystem) >- : constructor(constructor) >- , getSupportedTypes(getSupportedTypes) >- , supportsTypeAndCodecs(supportsTypeAndCodecs) >- , getSitesInMediaCache(getSitesInMediaCache) >- , clearMediaCache(clearMediaCache) >- , clearMediaCacheForSite(clearMediaCacheForSite) >- , supportsKeySystem(supportsKeySystem) >+ : playerType(playerType) >+ , getSupportedTypes(getSupportedTypes) >+ , supportsTypeAndCodecs(supportsTypeAndCodecs) >+ , getSitesInMediaCache(getSitesInMediaCache) >+ , clearMediaCache(clearMediaCache) >+ , clearMediaCacheForSite(clearMediaCacheForSite) >+ , supportsKeySystem(supportsKeySystem) > { > } > >- CreateMediaEnginePlayer constructor; >+ MediaEnginePlayerType playerType; > MediaEngineSupportedTypes getSupportedTypes; > MediaEngineSupportsType supportsTypeAndCodecs; > MediaEngineGetSitesInMediaCache getSitesInMediaCache; > MediaEngineClearMediaCache clearMediaCache; > MediaEngineClearMediaCacheForSite clearMediaCacheForSite; > MediaEngineSupportsKeySystem supportsKeySystem; >+ >+ std::unique_ptr<MediaPlayerPrivateInterface> createMediaPlayer(MediaPlayer* player) >+ { >+ switch (playerType) { >+ case NullMediaPlayer: >+ return std::make_unique<NullMediaPlayerPrivate>(player); >+#if USE(AVFOUNDATION) >+#if PLATFORM(WIN) >+ case AVFoundationCFPlayer: >+ return std::make_unique<MediaPlayerPrivateAVFoundationCF>(player); >+#endif >+ case AVFoundationObjCPlayer: >+ return std::make_unique<MediaPlayerPrivateAVFoundationObjC>(player); >+#if PLATFORM(MAC) && ENABLE(MEDIA_SOURCE) >+ case MediaSourceAVFObjCPlayer: >+ return std::make_unique<MediaPlayerPrivateMediaSourceAVFObjC>(player); >+#endif >+#endif // USE(AVFOUNDATION) >+#if USE(GSTREAMER) >+ case GStreamerPlayer: >+ return std::make_unique<MediaPlayerPrivateGStreamer>(player); >+#endif >+#if PLATFORM(COCOA) >+ case QTKitPlayer: >+ return std::make_unique<MediaPlayerPrivateQTKit>(player); >+#endif >+#if PLATFORM(WIN) && USE(MEDIA_FOUNDATION) >+ case MediaFoundationPlayer: >+ return std::make_unique<MediaPlayerPrivateMediaFoundation>(player); >+#endif >+#if ENABLE(MEDIA_SOURCE) >+ case MockMediaSourcePlayer: >+ return std::make_unique<MockMediaPlayerMediaSource>(player); >+#endif >+ default: >+ ASSERT_NOT_REACHED(); >+ return std::make_unique<NullMediaPlayerPrivate>(player); >+ } >+ } > }; > >-static void addMediaEngine(CreateMediaEnginePlayer, MediaEngineSupportedTypes, MediaEngineSupportsType, MediaEngineGetSitesInMediaCache, MediaEngineClearMediaCache, MediaEngineClearMediaCacheForSite, MediaEngineSupportsKeySystem); >+static void addMediaEngine(MediaEnginePlayerType, MediaEngineSupportedTypes, MediaEngineSupportsType, MediaEngineGetSitesInMediaCache, MediaEngineClearMediaCache, MediaEngineClearMediaCacheForSite, MediaEngineSupportsKeySystem); > > static MediaPlayerFactory* bestMediaEngineForSupportParameters(const MediaEngineSupportParameters&, MediaPlayerFactory* current = 0); > static MediaPlayerFactory* nextMediaEngine(MediaPlayerFactory* current); >@@ -223,14 +259,14 @@ static Vector<MediaPlayerFactory*>& installedMediaEngines(RequeryEngineOptions r > return installedEngines; > } > >-static void addMediaEngine(CreateMediaEnginePlayer constructor, MediaEngineSupportedTypes getSupportedTypes, MediaEngineSupportsType supportsType, >+static void addMediaEngine(MediaEnginePlayerType playerType, MediaEngineSupportedTypes getSupportedTypes, MediaEngineSupportsType supportsType, > MediaEngineGetSitesInMediaCache getSitesInMediaCache, MediaEngineClearMediaCache clearMediaCache, MediaEngineClearMediaCacheForSite clearMediaCacheForSite, MediaEngineSupportsKeySystem supportsKeySystem) > { >- ASSERT(constructor); >+ ASSERT(playerType); > ASSERT(getSupportedTypes); > ASSERT(supportsType); > >- installedMediaEngines().append(new MediaPlayerFactory(constructor, getSupportedTypes, supportsType, getSitesInMediaCache, clearMediaCache, clearMediaCacheForSite, supportsKeySystem)); >+ installedMediaEngines().append(new MediaPlayerFactory(playerType, getSupportedTypes, supportsType, getSitesInMediaCache, clearMediaCache, clearMediaCacheForSite, supportsKeySystem)); > } > > static const AtomicString& applicationOctetStream() >@@ -308,7 +344,7 @@ static MediaPlayerFactory* nextMediaEngine(MediaPlayerFactory* current) > MediaPlayer::MediaPlayer(MediaPlayerClient& client) > : m_client(client) > , m_reloadTimer(this, &MediaPlayer::reloadTimerFired) >- , m_private(createNullMediaPlayer(this)) >+ , m_private(std::make_unique<NullMediaPlayerPrivate>(this)) > , m_currentMediaEngine(0) > , m_preload(Auto) > , m_visible(false) >@@ -409,7 +445,7 @@ void MediaPlayer::loadWithNextMediaEngine(MediaPlayerFactory* current) > m_private = nullptr; > } else if (m_currentMediaEngine != engine) { > m_currentMediaEngine = engine; >- m_private = engine->constructor(this); >+ m_private = engine->createMediaPlayer(this); > m_client.mediaPlayerEngineUpdated(this); > m_private->setPrivateBrowsingMode(m_privateBrowsing); > m_private->setPreload(m_preload); >@@ -426,7 +462,7 @@ void MediaPlayer::loadWithNextMediaEngine(MediaPlayerFactory* current) > #endif > m_private->load(m_url.string()); > } else { >- m_private = createNullMediaPlayer(this); >+ m_private = std::make_unique<NullMediaPlayerPrivate>(this); > m_client.mediaPlayerEngineUpdated(this); > m_client.mediaPlayerResourceNotSupported(this); > } >diff --git a/Source/WebCore/platform/graphics/MediaPlayer.h b/Source/WebCore/platform/graphics/MediaPlayer.h >index 7c6add6b37628cc1746529fc4e7c951ea1861398..a8adfde74a7c393ee7bd93b99ea51784375473e5 100644 >--- a/Source/WebCore/platform/graphics/MediaPlayer.h >+++ b/Source/WebCore/platform/graphics/MediaPlayer.h >@@ -35,6 +35,7 @@ > #include "IntRect.h" > #include "URL.h" > #include "LayoutRect.h" >+#include "MediaEnginePlayerType.h" > #include "MediaSession.h" > #include "NativeImagePtr.h" > #include "PlatformLayer.h" >@@ -45,8 +46,6 @@ > #include <wtf/HashSet.h> > #include <wtf/MediaTime.h> > #include <wtf/Noncopyable.h> >-#include <wtf/OwnPtr.h> >-#include <wtf/PassOwnPtr.h> > #include <wtf/text/StringHash.h> > > #if ENABLE(AVF_CAPTIONS) >@@ -278,11 +277,7 @@ public: > class MediaPlayer { > WTF_MAKE_NONCOPYABLE(MediaPlayer); WTF_MAKE_FAST_ALLOCATED; > public: >- >- static PassOwnPtr<MediaPlayer> create(MediaPlayerClient& client) >- { >- return adoptPtr(new MediaPlayer(client)); >- } >+ explicit MediaPlayer(MediaPlayerClient&); > virtual ~MediaPlayer(); > > // Media engine support. >@@ -577,7 +572,6 @@ public: > String sourceApplicationIdentifier() const; > > private: >- MediaPlayer(MediaPlayerClient&); > MediaPlayerFactory* nextBestMediaEngine(MediaPlayerFactory*) const; > void loadWithNextMediaEngine(MediaPlayerFactory*); > void reloadTimerFired(Timer<MediaPlayer>&); >@@ -586,7 +580,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 +602,6 @@ private: > #endif > }; > >-typedef PassOwnPtr<MediaPlayerPrivateInterface> (*CreateMediaEnginePlayer)(MediaPlayer*); > typedef void (*MediaEngineSupportedTypes)(HashSet<String>& types); > typedef MediaPlayer::SupportsType (*MediaEngineSupportsType)(const MediaEngineSupportParameters& parameters); > typedef void (*MediaEngineGetSitesInMediaCache)(Vector<String>&); >@@ -616,7 +609,7 @@ typedef void (*MediaEngineClearMediaCache)(); > typedef void (*MediaEngineClearMediaCacheForSite)(const String&); > typedef bool (*MediaEngineSupportsKeySystem)(const String& keySystem, const String& mimeType); > >-typedef void (*MediaEngineRegistrar)(CreateMediaEnginePlayer, MediaEngineSupportedTypes, MediaEngineSupportsType, >+typedef void (*MediaEngineRegistrar)(MediaEnginePlayerType, MediaEngineSupportedTypes, MediaEngineSupportsType, > MediaEngineGetSitesInMediaCache, MediaEngineClearMediaCache, MediaEngineClearMediaCacheForSite, MediaEngineSupportsKeySystem); > typedef void (*MediaEngineRegister)(MediaEngineRegistrar); > >diff --git a/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h b/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h >index 660b0c0025d1b7de7c5d75aa1bc75b888bc1fe85..d893987b53244a85514e213e21d66bced55990af 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h >+++ b/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h >@@ -46,6 +46,7 @@ class GenericCueData; > class MediaPlayerPrivateAVFoundation : public MediaPlayerPrivateInterface, public AVFInbandTrackParent > { > public: >+ explicit MediaPlayerPrivateAVFoundation(MediaPlayer*); > > virtual void repaint(); > virtual void metadataLoaded(); >@@ -144,7 +145,6 @@ public: > #endif > > protected: >- MediaPlayerPrivateAVFoundation(MediaPlayer*); > virtual ~MediaPlayerPrivateAVFoundation(); > > WeakPtr<MediaPlayerPrivateAVFoundation> createWeakPtr() { return m_weakPtrFactory.createWeakPtr(); } >diff --git a/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp b/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp >index 275d9e125d270a2ab5048ffefdfd5ca915106026..ed9c0eacd7b7229e3c6b1e1639753e23c20f9a26 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp >+++ b/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp >@@ -335,15 +335,10 @@ static dispatch_queue_t globalLoaderDelegateQueue() > } > #endif > >-PassOwnPtr<MediaPlayerPrivateInterface> MediaPlayerPrivateAVFoundationCF::create(MediaPlayer* player) >-{ >- return adoptPtr(new MediaPlayerPrivateAVFoundationCF(player)); >-} >- > void MediaPlayerPrivateAVFoundationCF::registerMediaEngine(MediaEngineRegistrar registrar) > { > if (isAvailable()) >- registrar(create, getSupportedTypes, supportsType, 0, 0, 0, supportsKeySystem); >+ registrar(AVFoundationCFPlayer, getSupportedTypes, supportsType, 0, 0, 0, supportsKeySystem); > } > > MediaPlayerPrivateAVFoundationCF::MediaPlayerPrivateAVFoundationCF(MediaPlayer* player) >diff --git a/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h b/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h >index 2ac0144daa938cd2302c6b2d67dda303500847d3..44a8cf639502b5e2e17b8c43aa738872e7b210e0 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: >+ explicit MediaPlayerPrivateAVFoundationCF(MediaPlayer*); > virtual ~MediaPlayerPrivateAVFoundationCF(); > > virtual void tracksChanged() override; >@@ -58,10 +59,7 @@ public: > static void registerMediaEngine(MediaEngineRegistrar); > > private: >- 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 f2b8e3b7a2ac0546853cf338967fb14b872a5846..7e7d977efc07778d7fc11d8bb981bfeeff6c5664 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h >@@ -69,6 +69,7 @@ class VideoTrackPrivateAVFObjC; > > class MediaPlayerPrivateAVFoundationObjC : public MediaPlayerPrivateAVFoundation { > public: >+ explicit MediaPlayerPrivateAVFoundationObjC(MediaPlayer*); > virtual ~MediaPlayerPrivateAVFoundationObjC(); > > static void registerMediaEngine(MediaEngineRegistrar); >@@ -131,10 +132,7 @@ public: > WeakPtr<MediaPlayerPrivateAVFoundationObjC> createWeakPtr() { return m_weakPtrFactory.createWeakPtr(); } > > 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 9bda8c8378582276fb415fcb5a2a5d447e7f7c9c..cc713df52bbfcac1a8a811c8af307e8a7c606dcc 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm >@@ -383,15 +383,10 @@ static dispatch_queue_t globalPullDelegateQueue() > } > #endif > >-PassOwnPtr<MediaPlayerPrivateInterface> MediaPlayerPrivateAVFoundationObjC::create(MediaPlayer* player) >-{ >- return adoptPtr(new MediaPlayerPrivateAVFoundationObjC(player)); >-} >- > void MediaPlayerPrivateAVFoundationObjC::registerMediaEngine(MediaEngineRegistrar registrar) > { > if (isAvailable()) >- registrar(create, getSupportedTypes, supportsType, 0, 0, 0, supportsKeySystem); >+ registrar(AVFoundationObjCPlayer, getSupportedTypes, supportsType, 0, 0, 0, supportsKeySystem); > } > > MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC(MediaPlayer* player) >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h >index 077ac2e32c38eb7bd25239a024b3f775106957b1..575efa58384b0542fe7e75fe9b2ed75548be0357 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h >@@ -50,13 +50,11 @@ class MediaSourcePrivateAVFObjC; > > class MediaPlayerPrivateMediaSourceAVFObjC : public MediaPlayerPrivateInterface { > public: >- MediaPlayerPrivateMediaSourceAVFObjC(MediaPlayer*); >+ explicit MediaPlayerPrivateMediaSourceAVFObjC(MediaPlayer*); > virtual ~MediaPlayerPrivateMediaSourceAVFObjC(); > > static void registerMediaEngine(MediaEngineRegistrar); > >- // MediaPlayer Factory Methods >- static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*); > static bool isAvailable(); > static void getSupportedTypes(HashSet<String>& types); > static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&); >diff --git a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm >index f0eb61caa8e04fe77b8a76df55b0c0a180e26b18..c8978e21ee4b1e03e467e2e3ba365ad8b9821d02 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm >+++ b/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm >@@ -196,12 +196,7 @@ MediaPlayerPrivateMediaSourceAVFObjC::~MediaPlayerPrivateMediaSourceAVFObjC() > void MediaPlayerPrivateMediaSourceAVFObjC::registerMediaEngine(MediaEngineRegistrar registrar) > { > if (isAvailable()) >- registrar(create, getSupportedTypes, supportsType, 0, 0, 0, 0); >-} >- >-PassOwnPtr<MediaPlayerPrivateInterface> MediaPlayerPrivateMediaSourceAVFObjC::create(MediaPlayer* player) >-{ >- return adoptPtr(new MediaPlayerPrivateMediaSourceAVFObjC(player)); >+ registrar(MediaSourceAVFObjCPlayer, getSupportedTypes, supportsType, 0, 0, 0, 0); > } > > bool MediaPlayerPrivateMediaSourceAVFObjC::isAvailable() >diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp >index 8ac8fccfbab3a1756d1972ed74c7d068de3d968f..0e1136b5630ebbc9402afb109392ae0e92adc281 100644 >--- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp >+++ b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp >@@ -138,15 +138,10 @@ void MediaPlayerPrivateGStreamer::setAudioStreamProperties(GObject* object) > LOG_MEDIA_MESSAGE("Set media.role as %s at %s", role, elementName.get()); > } > >-PassOwnPtr<MediaPlayerPrivateInterface> MediaPlayerPrivateGStreamer::create(MediaPlayer* player) >-{ >- return adoptPtr(new MediaPlayerPrivateGStreamer(player)); >-} >- > void MediaPlayerPrivateGStreamer::registerMediaEngine(MediaEngineRegistrar registrar) > { > if (isAvailable()) >- registrar(create, getSupportedTypes, supportsType, 0, 0, 0, 0); >+ registrar(GStreamerPlayer, getSupportedTypes, supportsType, 0, 0, 0, 0); > } > > bool initializeGStreamerAndRegisterWebKitElements() >diff --git a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h b/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h >index 5084921982c618432a1aa2f1ffa9c0f81c31ba76..669fb56a31aae3ae7f17428274f9912b23278c4e 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: >+ explicit MediaPlayerPrivateGStreamer(MediaPlayer*); > ~MediaPlayerPrivateGStreamer(); >+ > static void registerMediaEngine(MediaEngineRegistrar); > gboolean handleMessage(GstMessage*); > void handlePluginInstallerResult(GstInstallPluginsReturn); >@@ -126,10 +128,6 @@ public: > bool changePipelineState(GstState); > > private: >- MediaPlayerPrivateGStreamer(MediaPlayer*); >- >- static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*); >- > static void getSupportedTypes(HashSet<String>&); > static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&); > >diff --git a/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h b/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h >index 80c2cea5913a4252be1bdf2a730013e6a3a846f5..ec31a77450a748a10f933f332c371b4e15acf484 100644 >--- a/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h >+++ b/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h >@@ -50,6 +50,7 @@ namespace WebCore { > > class MediaPlayerPrivateQTKit : public MediaPlayerPrivateInterface { > public: >+ explicit MediaPlayerPrivateQTKit(MediaPlayer*); > ~MediaPlayerPrivateQTKit(); > WEBCORE_EXPORT static void registerMediaEngine(MediaEngineRegistrar); > >@@ -63,10 +64,6 @@ public: > void layerHostChanged(PlatformLayer* rootLayer); > > private: >- MediaPlayerPrivateQTKit(MediaPlayer*); >- >- // engine support >- static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*); > static void getSupportedTypes(HashSet<String>& types); > static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&); > >diff --git a/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm b/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm >index af659e5d8cd4d4a96187636c4ec94f8268cc648e..c33608e910de22454625b2fb045c886940f31438 100644 >--- a/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm >+++ b/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm >@@ -166,15 +166,10 @@ using namespace WebCore; > > namespace WebCore { > >-PassOwnPtr<MediaPlayerPrivateInterface> MediaPlayerPrivateQTKit::create(MediaPlayer* player) >-{ >- return adoptPtr(new MediaPlayerPrivateQTKit(player)); >-} >- > void MediaPlayerPrivateQTKit::registerMediaEngine(MediaEngineRegistrar registrar) > { > if (isAvailable()) >- registrar(create, getSupportedTypes, supportsType, getSitesInMediaCache, clearMediaCache, clearMediaCacheForSite, 0); >+ registrar(QTKitPlayer, getSupportedTypes, supportsType, getSitesInMediaCache, clearMediaCache, clearMediaCacheForSite, 0); > } > > MediaPlayerPrivateQTKit::MediaPlayerPrivateQTKit(MediaPlayer* player) >diff --git a/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp b/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp >index 8a1cee6fb236ea3e8a6fdda2f10b1579f5b26c6e..7f32a649b8b300ac57983367027f1840c765ea37 100644 >--- a/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp >+++ b/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp >@@ -41,15 +41,10 @@ MediaPlayerPrivateMediaFoundation::MediaPlayerPrivateMediaFoundation(MediaPlayer > { > } > >-PassOwnPtr<MediaPlayerPrivateInterface> MediaPlayerPrivateMediaFoundation::create(MediaPlayer* player) >-{ >- return adoptPtr(new MediaPlayerPrivateMediaFoundation(player)); >-} >- > void MediaPlayerPrivateMediaFoundation::registerMediaEngine(MediaEngineRegistrar registrar) > { > if (isAvailable()) >- registrar(create, getSupportedTypes, supportsType, 0, 0, 0, 0); >+ registrar(MediaFoundationPlayer, getSupportedTypes, supportsType, 0, 0, 0, 0); > } > > bool MediaPlayerPrivateMediaFoundation::isAvailable() >diff --git a/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.h b/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.h >index b9ae0c55d55faeebffe412a5afe1be54e79538a2..bba536c6a2facfcfe84eb816dd3ef85c31afc801 100644 >--- a/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.h >+++ b/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.h >@@ -30,10 +30,9 @@ namespace WebCore { > > class MediaPlayerPrivateMediaFoundation : public MediaPlayerPrivateInterface { > public: >- MediaPlayerPrivateMediaFoundation(MediaPlayer*); >+ explicit MediaPlayerPrivateMediaFoundation(MediaPlayer*); > static void registerMediaEngine(MediaEngineRegistrar); > >- static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*); > static void getSupportedTypes(HashSet<String>& types); > static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&); > static bool isAvailable(); >diff --git a/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp b/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp >index c66178b9677cf84965d98bf88be3a3986f7e38da..9fa64d93fbc2cb3fce43267f82110fbba75fa93a 100644 >--- a/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp >+++ b/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp >@@ -41,12 +41,7 @@ namespace WebCore { > // MediaPlayer Enigne Support > void MockMediaPlayerMediaSource::registerMediaEngine(MediaEngineRegistrar registrar) > { >- registrar(create, getSupportedTypes, supportsType, 0, 0, 0, 0); >-} >- >-PassOwnPtr<MediaPlayerPrivateInterface> MockMediaPlayerMediaSource::create(MediaPlayer* player) >-{ >- return adoptPtr(new MockMediaPlayerMediaSource(player)); >+ registrar(MockMediaSourcePlayer, getSupportedTypes, supportsType, 0, 0, 0, 0); > } > > static HashSet<String> mimeTypeCache() >diff --git a/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h b/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h >index b6694d8ed8737989eb0bf6eef963906365ffb97f..e6ab47701197dbb16707c1a78cdc8d2b78fd2179 100644 >--- a/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h >+++ b/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h >@@ -38,14 +38,14 @@ class MockMediaSourcePrivate; > > class MockMediaPlayerMediaSource : public MediaPlayerPrivateInterface { > public: >+ WEBCORE_EXPORT explicit MockMediaPlayerMediaSource(MediaPlayer*); >+ virtual ~MockMediaPlayerMediaSource(); >+ > // MediaPlayer Engine Support > static void registerMediaEngine(MediaEngineRegistrar); >- static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*); > static void getSupportedTypes(HashSet<String>& types); > static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&); > >- virtual ~MockMediaPlayerMediaSource(); >- > void advanceCurrentTime(); > void updateDuration(const MediaTime&); > >@@ -56,8 +56,6 @@ public: > void seekCompleted(); > > private: >- MockMediaPlayerMediaSource(MediaPlayer*); >- > // MediaPlayerPrivate Overrides > virtual void load(const String& url) override; > virtual void load(const String& url, MediaSourcePrivateClient*) 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