| Differences between
and this patch
- a/Source/WebCore/ChangeLog +46 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2015-02-16  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2
3
        Use std::unique_ptr instead of PassOwnPtr|OwnPtr in MediaPlayerFoo classes
4
        https://bugs.webkit.org/show_bug.cgi?id=137765
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        As a step to use std::unique_ptr|std::make_unique<>, this patch changes use of OwnPtr|PassOwnPtr with
9
        std::unique_ptr<>|std::make_unique<>. However MediaPlayer has used factory pattern, thus create() factory
10
        function should be kept to use factory pattern. Thus this patch sets contructor to private, and uses std::unique_ptr
11
        in the create() factory functions.
12
13
        No new tests, no behavior changes.
14
15
        * html/HTMLMediaElement.cpp:
16
        (WebCore::HTMLMediaElement::parseAttribute):
17
        * html/HTMLMediaElement.h:
18
        * platform/graphics/MediaPlayer.cpp:
19
        (WebCore::NullMediaPlayerPrivate::NullMediaPlayerPrivate):
20
        (WebCore::createNullMediaPlayer):
21
        * platform/graphics/MediaPlayer.h:
22
        (WebCore::MediaPlayer::create):
23
        * platform/graphics/MediaPlayerPrivate.h:
24
        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
25
        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
26
        (WebCore::MediaPlayerPrivateAVFoundationCF::create):
27
        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
28
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
29
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
30
        (WebCore::MediaPlayerPrivateAVFoundationObjC::create):
31
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
32
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
33
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::create):
34
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
35
        (WebCore::MediaPlayerPrivateGStreamer::create):
36
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
37
        * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
38
        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
39
        (WebCore::MediaPlayerPrivateQTKit::create):
40
        * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
41
        (WebCore::MediaPlayerPrivateMediaFoundation::create):
42
        * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
43
        * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
44
        (WebCore::MockMediaPlayerMediaSource::create):
45
        * platform/mock/mediasource/MockMediaPlayerMediaSource.h:
46
1
2015-02-16  Milan Crha  <mcrha@redhat.com>
47
2015-02-16  Milan Crha  <mcrha@redhat.com>
2
48
3
        [GTK] Loading page into WebView shows g_closure_unref warning
49
        [GTK] Loading page into WebView shows g_closure_unref warning
- a/Source/WebCore/WebCore.exp.in -1 / +1 lines
Lines 3438-3444 __ZN7WebCore16HTMLMediaElement22clearMediaCacheForSiteERKN3WTF6StringE a/Source/WebCore/WebCore.exp.in_sec1
3438
__ZN7WebCore16HTMLMediaElement4playEv
3438
__ZN7WebCore16HTMLMediaElement4playEv
3439
__ZN7WebCore16HTMLMediaElement5pauseEv
3439
__ZN7WebCore16HTMLMediaElement5pauseEv
3440
__ZN7WebCore16HTMLMediaElement8setMutedEb
3440
__ZN7WebCore16HTMLMediaElement8setMutedEb
3441
__ZN7WebCore25MediaPlayerFactorySupport23callRegisterMediaEngineEPFvPFvPFN3WTF10PassOwnPtrINS_27MediaPlayerPrivateInterfaceEEEPNS_11MediaPlayerEEPFvRNS1_7HashSetINS1_6StringENS1_10StringHashENS1_10HashTraitsISA_EEEEEPFNS5_12SupportsTypeERKNS_28MediaEngineSupportParametersEEPFvRNS1_6VectorISA_Lm0ENS1_15CrashOnOverflowEEEEPFvvEPFvRKSA_EPFbSX_SX_EEE
3441
__ZN7WebCore25MediaPlayerFactorySupport23callRegisterMediaEngineEPFvPFvPFNSt3__110unique_ptrINS_27MediaPlayerPrivateInterfaceENS1_14default_deleteIS3_EEEEPNS_11MediaPlayerEEPFvRN3WTF7HashSetINSB_6StringENSB_10StringHashENSB_10HashTraitsISD_EEEEEPFNS7_12SupportsTypeERKNS_28MediaEngineSupportParametersEEPFvRNSB_6VectorISD_Lm0ENSB_15CrashOnOverflowEEEEPFvvEPFvRKSD_EPFbS10_S10_EEE
3442
__ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_10TimeRangesE
3442
__ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_10TimeRangesE
3443
__ZNK7WebCore10TimeRanges7nearestEd
3443
__ZNK7WebCore10TimeRanges7nearestEd
3444
__ZNK7WebCore16HTMLMediaElement11currentTimeEv
3444
__ZNK7WebCore16HTMLMediaElement11currentTimeEv
- a/Source/WebCore/html/HTMLMediaElement.cpp -3 / +3 lines
Lines 4692-4698 void HTMLMediaElement::clearMediaPlayer(int flags) a/Source/WebCore/html/HTMLMediaElement.cpp_sec1
4692
        m_mediaSession->setHasPlaybackTargetAvailabilityListeners(*this, false);
4692
        m_mediaSession->setHasPlaybackTargetAvailabilityListeners(*this, false);
4693
#endif
4693
#endif
4694
4694
4695
    m_player.clear();
4695
    m_player = nullptr;
4696
4696
4697
    stopPeriodicTimers();
4697
    stopPeriodicTimers();
4698
    m_loadTimer.stop();
4698
    m_loadTimer.stop();
Lines 4739-4745 void HTMLMediaElement::stop() a/Source/WebCore/html/HTMLMediaElement.cpp_sec2
4739
    // Once an active DOM object has been stopped it can not be restarted, so we can deallocate
4739
    // Once an active DOM object has been stopped it can not be restarted, so we can deallocate
4740
    // the media player now. Note that userCancelledLoad will already have cleared the player
4740
    // the media player now. Note that userCancelledLoad will already have cleared the player
4741
    // if the media was not fully loaded. This handles all other cases.
4741
    // if the media was not fully loaded. This handles all other cases.
4742
    m_player.clear();
4742
    m_player = nullptr;
4743
4743
4744
    updateSleepDisabling();
4744
    updateSleepDisabling();
4745
}
4745
}
Lines 5406-5412 void HTMLMediaElement::createMediaPlayer() a/Source/WebCore/html/HTMLMediaElement.cpp_sec3
5406
#if ENABLE(VIDEO_TRACK)
5406
#if ENABLE(VIDEO_TRACK)
5407
    forgetResourceSpecificTracks();
5407
    forgetResourceSpecificTracks();
5408
#endif
5408
#endif
5409
    m_player = MediaPlayer::create(*this);
5409
    m_player = std::make_unique<MediaPlayer>(static_cast<MediaPlayerClient&>(*this));
5410
5410
5411
#if ENABLE(WEB_AUDIO)
5411
#if ENABLE(WEB_AUDIO)
5412
    if (m_audioSourceNode) {
5412
    if (m_audioSourceNode) {
- a/Source/WebCore/html/HTMLMediaElement.h -1 / +1 lines
Lines 805-811 private: a/Source/WebCore/html/HTMLMediaElement.h_sec1
805
    MediaPlayer::VideoGravity m_videoFullscreenGravity;
805
    MediaPlayer::VideoGravity m_videoFullscreenGravity;
806
#endif
806
#endif
807
807
808
    OwnPtr<MediaPlayer> m_player;
808
    std::unique_ptr<MediaPlayer> m_player;
809
809
810
    MediaPlayer::Preload m_preload;
810
    MediaPlayer::Preload m_preload;
811
811
- a/Source/WebCore/platform/graphics/MediaPlayer.cpp -5 / +4 lines
Lines 79-85 const PlatformMedia NoPlatformMedia = { PlatformMedia::None, {0} }; a/Source/WebCore/platform/graphics/MediaPlayer.cpp_sec1
79
79
80
class NullMediaPlayerPrivate : public MediaPlayerPrivateInterface {
80
class NullMediaPlayerPrivate : public MediaPlayerPrivateInterface {
81
public:
81
public:
82
    NullMediaPlayerPrivate(MediaPlayer*) { }
82
    explicit NullMediaPlayerPrivate(MediaPlayer*) { }
83
83
84
    virtual void load(const String&) { }
84
    virtual void load(const String&) { }
85
#if ENABLE(MEDIA_SOURCE)
85
#if ENABLE(MEDIA_SOURCE)
Lines 145-156 public: a/Source/WebCore/platform/graphics/MediaPlayer.cpp_sec2
145
#endif
145
#endif
146
};
146
};
147
147
148
static PassOwnPtr<MediaPlayerPrivateInterface> createNullMediaPlayer(MediaPlayer* player) 
148
static std::unique_ptr<MediaPlayerPrivateInterface> createNullMediaPlayer(MediaPlayer* player)
149
{ 
149
{
150
    return adoptPtr(new NullMediaPlayerPrivate(player)); 
150
    return std::make_unique<NullMediaPlayerPrivate>(player);
151
}
151
}
152
152
153
154
// engine support
153
// engine support
155
154
156
struct MediaPlayerFactory {
155
struct MediaPlayerFactory {
- a/Source/WebCore/platform/graphics/MediaPlayer.h -8 / +3 lines
Lines 280-290 public: a/Source/WebCore/platform/graphics/MediaPlayer.h_sec1
280
class MediaPlayer {
280
class MediaPlayer {
281
    WTF_MAKE_NONCOPYABLE(MediaPlayer); WTF_MAKE_FAST_ALLOCATED;
281
    WTF_MAKE_NONCOPYABLE(MediaPlayer); WTF_MAKE_FAST_ALLOCATED;
282
public:
282
public:
283
283
    explicit MediaPlayer(MediaPlayerClient&);
284
    static PassOwnPtr<MediaPlayer> create(MediaPlayerClient& client)
285
    {
286
        return adoptPtr(new MediaPlayer(client));
287
    }
288
    virtual ~MediaPlayer();
284
    virtual ~MediaPlayer();
289
285
290
    // Media engine support.
286
    // Media engine support.
Lines 585-591 public: a/Source/WebCore/platform/graphics/MediaPlayer.h_sec2
585
    String sourceApplicationIdentifier() const;
581
    String sourceApplicationIdentifier() const;
586
582
587
private:
583
private:
588
    MediaPlayer(MediaPlayerClient&);
589
    const MediaPlayerFactory* nextBestMediaEngine(const MediaPlayerFactory*) const;
584
    const MediaPlayerFactory* nextBestMediaEngine(const MediaPlayerFactory*) const;
590
    void loadWithNextMediaEngine(const MediaPlayerFactory*);
585
    void loadWithNextMediaEngine(const MediaPlayerFactory*);
591
    void reloadTimerFired();
586
    void reloadTimerFired();
Lines 594-600 private: a/Source/WebCore/platform/graphics/MediaPlayer.h_sec3
594
589
595
    MediaPlayerClient& m_client;
590
    MediaPlayerClient& m_client;
596
    Timer m_reloadTimer;
591
    Timer m_reloadTimer;
597
    OwnPtr<MediaPlayerPrivateInterface> m_private;
592
    std::unique_ptr<MediaPlayerPrivateInterface> m_private;
598
    const MediaPlayerFactory* m_currentMediaEngine;
593
    const MediaPlayerFactory* m_currentMediaEngine;
599
    URL m_url;
594
    URL m_url;
600
    String m_contentMIMEType;
595
    String m_contentMIMEType;
Lines 615-621 private: a/Source/WebCore/platform/graphics/MediaPlayer.h_sec4
615
#endif
610
#endif
616
};
611
};
617
612
618
typedef PassOwnPtr<MediaPlayerPrivateInterface> (*CreateMediaEnginePlayer)(MediaPlayer*);
613
typedef std::unique_ptr<MediaPlayerPrivateInterface> (*CreateMediaEnginePlayer)(MediaPlayer*);
619
typedef void (*MediaEngineSupportedTypes)(HashSet<String>& types);
614
typedef void (*MediaEngineSupportedTypes)(HashSet<String>& types);
620
typedef MediaPlayer::SupportsType (*MediaEngineSupportsType)(const MediaEngineSupportParameters& parameters);
615
typedef MediaPlayer::SupportsType (*MediaEngineSupportsType)(const MediaEngineSupportParameters& parameters);
621
typedef void (*MediaEngineGetSitesInMediaCache)(Vector<String>&);
616
typedef void (*MediaEngineGetSitesInMediaCache)(Vector<String>&);
- a/Source/WebCore/platform/graphics/MediaPlayerPrivate.h -1 lines
Lines 31-37 a/Source/WebCore/platform/graphics/MediaPlayerPrivate.h_sec1
31
#include "MediaPlayer.h"
31
#include "MediaPlayer.h"
32
#include "PlatformTimeRanges.h"
32
#include "PlatformTimeRanges.h"
33
#include <wtf/Forward.h>
33
#include <wtf/Forward.h>
34
#include <wtf/OwnPtr.h>
35
34
36
namespace WebCore {
35
namespace WebCore {
37
36
- a/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h -2 / +1 lines
Lines 46-52 class GenericCueData; a/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h_sec1
46
class MediaPlayerPrivateAVFoundation : public MediaPlayerPrivateInterface, public AVFInbandTrackParent
46
class MediaPlayerPrivateAVFoundation : public MediaPlayerPrivateInterface, public AVFInbandTrackParent
47
{
47
{
48
public:
48
public:
49
50
    virtual void repaint();
49
    virtual void repaint();
51
    virtual void metadataLoaded();
50
    virtual void metadataLoaded();
52
    virtual void playabilityKnown();
51
    virtual void playabilityKnown();
Lines 144-150 public: a/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h_sec2
144
#endif
143
#endif
145
144
146
protected:
145
protected:
147
    MediaPlayerPrivateAVFoundation(MediaPlayer*);
146
    explicit MediaPlayerPrivateAVFoundation(MediaPlayer*);
148
    virtual ~MediaPlayerPrivateAVFoundation();
147
    virtual ~MediaPlayerPrivateAVFoundation();
149
148
150
    WeakPtr<MediaPlayerPrivateAVFoundation> createWeakPtr() { return m_weakPtrFactory.createWeakPtr(); }
149
    WeakPtr<MediaPlayerPrivateAVFoundation> createWeakPtr() { return m_weakPtrFactory.createWeakPtr(); }
- a/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp -3 / +3 lines
Lines 335-343 static dispatch_queue_t globalLoaderDelegateQueue() a/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp_sec1
335
}
335
}
336
#endif
336
#endif
337
337
338
PassOwnPtr<MediaPlayerPrivateInterface> MediaPlayerPrivateAVFoundationCF::create(MediaPlayer* player) 
338
std::unique_ptr<MediaPlayerPrivateInterface> MediaPlayerPrivateAVFoundationCF::create(MediaPlayer* player) 
339
{ 
339
{
340
    return adoptPtr(new MediaPlayerPrivateAVFoundationCF(player));
340
    return std::make_unique<MediaPlayerPrivateAVFoundationCF>(player);
341
}
341
}
342
342
343
void MediaPlayerPrivateAVFoundationCF::registerMediaEngine(MediaEngineRegistrar registrar)
343
void MediaPlayerPrivateAVFoundationCF::registerMediaEngine(MediaEngineRegistrar registrar)
- a/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h -3 / +3 lines
Lines 41-46 class WebCoreAVCFResourceLoader; a/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h_sec1
41
41
42
class MediaPlayerPrivateAVFoundationCF : public MediaPlayerPrivateAVFoundation {
42
class MediaPlayerPrivateAVFoundationCF : public MediaPlayerPrivateAVFoundation {
43
public:
43
public:
44
    // Engine support
45
    explicit MediaPlayerPrivateAVFoundationCF(MediaPlayer*);
44
    virtual ~MediaPlayerPrivateAVFoundationCF();
46
    virtual ~MediaPlayerPrivateAVFoundationCF();
45
47
46
    virtual void tracksChanged() override;
48
    virtual void tracksChanged() override;
Lines 58-67 public: a/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h_sec2
58
    static void registerMediaEngine(MediaEngineRegistrar);
60
    static void registerMediaEngine(MediaEngineRegistrar);
59
61
60
private:
62
private:
61
    MediaPlayerPrivateAVFoundationCF(MediaPlayer*);
63
    static std::unique_ptr<MediaPlayerPrivateInterface> create(MediaPlayer*);
62
64
63
    // Engine support
64
    static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*);
65
    static void getSupportedTypes(HashSet<String>& types);
65
    static void getSupportedTypes(HashSet<String>& types);
66
    static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&);
66
    static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&);
67
    static bool supportsKeySystem(const String& keySystem, const String& mimeType);
67
    static bool supportsKeySystem(const String& keySystem, const String& mimeType);
- a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h -3 / +2 lines
Lines 69-74 class VideoTrackPrivateAVFObjC; a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h_sec1
69
69
70
class MediaPlayerPrivateAVFoundationObjC : public MediaPlayerPrivateAVFoundation {
70
class MediaPlayerPrivateAVFoundationObjC : public MediaPlayerPrivateAVFoundation {
71
public:
71
public:
72
    explicit MediaPlayerPrivateAVFoundationObjC(MediaPlayer*);
72
    virtual ~MediaPlayerPrivateAVFoundationObjC();
73
    virtual ~MediaPlayerPrivateAVFoundationObjC();
73
74
74
    static void registerMediaEngine(MediaEngineRegistrar);
75
    static void registerMediaEngine(MediaEngineRegistrar);
Lines 132-141 public: a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h_sec2
132
    WeakPtr<MediaPlayerPrivateAVFoundationObjC> createWeakPtr() { return m_weakPtrFactory.createWeakPtr(); }
133
    WeakPtr<MediaPlayerPrivateAVFoundationObjC> createWeakPtr() { return m_weakPtrFactory.createWeakPtr(); }
133
134
134
private:
135
private:
135
    MediaPlayerPrivateAVFoundationObjC(MediaPlayer*);
136
137
    // engine support
136
    // engine support
138
    static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*);
137
    static std::unique_ptr<MediaPlayerPrivateInterface> create(MediaPlayer*);
139
    static void getSupportedTypes(HashSet<String>& types);
138
    static void getSupportedTypes(HashSet<String>& types);
140
    static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&);
139
    static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&);
141
    static bool supportsKeySystem(const String& keySystem, const String& mimeType);
140
    static bool supportsKeySystem(const String& keySystem, const String& mimeType);
- a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm -3 / +3 lines
Lines 387-395 static dispatch_queue_t globalPullDelegateQueue() a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm_sec1
387
}
387
}
388
#endif
388
#endif
389
389
390
PassOwnPtr<MediaPlayerPrivateInterface> MediaPlayerPrivateAVFoundationObjC::create(MediaPlayer* player)
390
std::unique_ptr<MediaPlayerPrivateInterface> MediaPlayerPrivateAVFoundationObjC::create(MediaPlayer* player)
391
{ 
391
{
392
    return adoptPtr(new MediaPlayerPrivateAVFoundationObjC(player));
392
    return std::make_unique<MediaPlayerPrivateAVFoundationObjC>(player);
393
}
393
}
394
394
395
void MediaPlayerPrivateAVFoundationObjC::registerMediaEngine(MediaEngineRegistrar registrar)
395
void MediaPlayerPrivateAVFoundationObjC::registerMediaEngine(MediaEngineRegistrar registrar)
- a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h -2 / +3 lines
Lines 50-62 class MediaSourcePrivateAVFObjC; a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h_sec1
50
50
51
class MediaPlayerPrivateMediaSourceAVFObjC : public MediaPlayerPrivateInterface {
51
class MediaPlayerPrivateMediaSourceAVFObjC : public MediaPlayerPrivateInterface {
52
public:
52
public:
53
    MediaPlayerPrivateMediaSourceAVFObjC(MediaPlayer*);
53
    explicit MediaPlayerPrivateMediaSourceAVFObjC(MediaPlayer*);
54
    virtual ~MediaPlayerPrivateMediaSourceAVFObjC();
54
    virtual ~MediaPlayerPrivateMediaSourceAVFObjC();
55
55
56
    static void registerMediaEngine(MediaEngineRegistrar);
56
    static void registerMediaEngine(MediaEngineRegistrar);
57
57
58
    // MediaPlayer Factory Methods
58
    // MediaPlayer Factory Methods
59
    static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*);
60
    static bool isAvailable();
59
    static bool isAvailable();
61
    static void getSupportedTypes(HashSet<String>& types);
60
    static void getSupportedTypes(HashSet<String>& types);
62
    static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&);
61
    static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&);
Lines 93-98 public: a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h_sec2
93
    WeakPtr<MediaPlayerPrivateMediaSourceAVFObjC> createWeakPtr() { return m_weakPtrFactory.createWeakPtr(); }
92
    WeakPtr<MediaPlayerPrivateMediaSourceAVFObjC> createWeakPtr() { return m_weakPtrFactory.createWeakPtr(); }
94
93
95
private:
94
private:
95
    static std::unique_ptr<MediaPlayerPrivateInterface> create(MediaPlayer*);
96
96
    // MediaPlayerPrivateInterface
97
    // MediaPlayerPrivateInterface
97
    virtual void load(const String& url) override;
98
    virtual void load(const String& url) override;
98
    virtual void load(const String& url, MediaSourcePrivateClient*) override;
99
    virtual void load(const String& url, MediaSourcePrivateClient*) override;
- a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm -2 / +2 lines
Lines 207-215 void MediaPlayerPrivateMediaSourceAVFObjC::registerMediaEngine(MediaEngineRegist a/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm_sec1
207
        registrar(create, getSupportedTypes, supportsType, 0, 0, 0, 0);
207
        registrar(create, getSupportedTypes, supportsType, 0, 0, 0, 0);
208
}
208
}
209
209
210
PassOwnPtr<MediaPlayerPrivateInterface> MediaPlayerPrivateMediaSourceAVFObjC::create(MediaPlayer* player)
210
std::unique_ptr<MediaPlayerPrivateInterface> MediaPlayerPrivateMediaSourceAVFObjC::create(MediaPlayer* player)
211
{
211
{
212
    return adoptPtr(new MediaPlayerPrivateMediaSourceAVFObjC(player));
212
    return std::make_unique<MediaPlayerPrivateMediaSourceAVFObjC>(player);
213
}
213
}
214
214
215
bool MediaPlayerPrivateMediaSourceAVFObjC::isAvailable()
215
bool MediaPlayerPrivateMediaSourceAVFObjC::isAvailable()
- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp -2 / +2 lines
Lines 142-150 void MediaPlayerPrivateGStreamer::setAudioStreamProperties(GObject* object) a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp_sec1
142
    LOG_MEDIA_MESSAGE("Set media.role as %s at %s", role, elementName.get());
142
    LOG_MEDIA_MESSAGE("Set media.role as %s at %s", role, elementName.get());
143
}
143
}
144
144
145
PassOwnPtr<MediaPlayerPrivateInterface> MediaPlayerPrivateGStreamer::create(MediaPlayer* player)
145
std::unique_ptr<MediaPlayerPrivateInterface> MediaPlayerPrivateGStreamer::create(MediaPlayer* player)
146
{
146
{
147
    return adoptPtr(new MediaPlayerPrivateGStreamer(player));
147
    return std::make_unique<MediaPlayerPrivateGStreamer>(player);
148
}
148
}
149
149
150
void MediaPlayerPrivateGStreamer::registerMediaEngine(MediaEngineRegistrar registrar)
150
void MediaPlayerPrivateGStreamer::registerMediaEngine(MediaEngineRegistrar registrar)
- a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h -3 / +3 lines
Lines 62-68 class VideoTrackPrivateGStreamer; a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h_sec1
62
62
63
class MediaPlayerPrivateGStreamer : public MediaPlayerPrivateGStreamerBase {
63
class MediaPlayerPrivateGStreamer : public MediaPlayerPrivateGStreamerBase {
64
public:
64
public:
65
    explicit MediaPlayerPrivateGStreamer(MediaPlayer*);
65
    ~MediaPlayerPrivateGStreamer();
66
    ~MediaPlayerPrivateGStreamer();
67
66
    static void registerMediaEngine(MediaEngineRegistrar);
68
    static void registerMediaEngine(MediaEngineRegistrar);
67
    gboolean handleMessage(GstMessage*);
69
    gboolean handleMessage(GstMessage*);
68
    void handlePluginInstallerResult(GstInstallPluginsReturn);
70
    void handlePluginInstallerResult(GstInstallPluginsReturn);
Lines 136-144 public: a/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h_sec2
136
#endif
138
#endif
137
139
138
private:
140
private:
139
    MediaPlayerPrivateGStreamer(MediaPlayer*);
141
    static std::unique_ptr<MediaPlayerPrivateInterface> create(MediaPlayer*);
140
141
    static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*);
142
142
143
    static void getSupportedTypes(HashSet<String>&);
143
    static void getSupportedTypes(HashSet<String>&);
144
    static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&);
144
    static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&);
- a/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h -2 / +2 lines
Lines 50-55 namespace WebCore { a/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h_sec1
50
    
50
    
51
class MediaPlayerPrivateQTKit : public MediaPlayerPrivateInterface {
51
class MediaPlayerPrivateQTKit : public MediaPlayerPrivateInterface {
52
public:
52
public:
53
    explicit MediaPlayerPrivateQTKit(MediaPlayer*);
53
    ~MediaPlayerPrivateQTKit();
54
    ~MediaPlayerPrivateQTKit();
54
    WEBCORE_EXPORT static void registerMediaEngine(MediaEngineRegistrar);
55
    WEBCORE_EXPORT static void registerMediaEngine(MediaEngineRegistrar);
55
56
Lines 63-72 public: a/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h_sec2
63
    void layerHostChanged(PlatformLayer* rootLayer);
64
    void layerHostChanged(PlatformLayer* rootLayer);
64
65
65
private:
66
private:
66
    MediaPlayerPrivateQTKit(MediaPlayer*);
67
    static std::unique_ptr<MediaPlayerPrivateInterface> create(MediaPlayer*);
67
68
68
    // engine support
69
    // engine support
69
    static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*);
70
    static void getSupportedTypes(HashSet<String>& types);
70
    static void getSupportedTypes(HashSet<String>& types);
71
    static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&);
71
    static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&);
72
72
- a/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm -2 / +2 lines
Lines 168-176 using namespace WebCore; a/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm_sec1
168
168
169
namespace WebCore {
169
namespace WebCore {
170
170
171
PassOwnPtr<MediaPlayerPrivateInterface> MediaPlayerPrivateQTKit::create(MediaPlayer* player)
171
std::unique_ptr<MediaPlayerPrivateInterface> MediaPlayerPrivateQTKit::create(MediaPlayer* player)
172
{ 
172
{ 
173
    return adoptPtr(new MediaPlayerPrivateQTKit(player));
173
    return std::make_unique<MediaPlayerPrivateQTKit>(player);
174
}
174
}
175
175
176
void MediaPlayerPrivateQTKit::registerMediaEngine(MediaEngineRegistrar registrar)
176
void MediaPlayerPrivateQTKit::registerMediaEngine(MediaEngineRegistrar registrar)
- a/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp -2 / +2 lines
Lines 65-73 MediaPlayerPrivateMediaFoundation::~MediaPlayerPrivateMediaFoundation() a/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp_sec1
65
    endSession();
65
    endSession();
66
}
66
}
67
67
68
PassOwnPtr<MediaPlayerPrivateInterface> MediaPlayerPrivateMediaFoundation::create(MediaPlayer* player)
68
std::unique_ptr<MediaPlayerPrivateInterface> MediaPlayerPrivateMediaFoundation::create(MediaPlayer* player)
69
{
69
{
70
    return adoptPtr(new MediaPlayerPrivateMediaFoundation(player));
70
    return std::make_unique<MediaPlayerPrivateMediaFoundation>(player);
71
}
71
}
72
72
73
void MediaPlayerPrivateMediaFoundation::registerMediaEngine(MediaEngineRegistrar registrar)
73
void MediaPlayerPrivateMediaFoundation::registerMediaEngine(MediaEngineRegistrar registrar)
- a/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.h -2 / +3 lines
Lines 35-45 namespace WebCore { a/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.h_sec1
35
35
36
class MediaPlayerPrivateMediaFoundation : public MediaPlayerPrivateInterface {
36
class MediaPlayerPrivateMediaFoundation : public MediaPlayerPrivateInterface {
37
public:
37
public:
38
    MediaPlayerPrivateMediaFoundation(MediaPlayer*);
38
    explicit MediaPlayerPrivateMediaFoundation(MediaPlayer*);
39
    ~MediaPlayerPrivateMediaFoundation();
39
    ~MediaPlayerPrivateMediaFoundation();
40
    static void registerMediaEngine(MediaEngineRegistrar);
40
    static void registerMediaEngine(MediaEngineRegistrar);
41
41
42
    static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*);
43
    static void getSupportedTypes(HashSet<String>& types);
42
    static void getSupportedTypes(HashSet<String>& types);
44
    static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&);
43
    static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&);
45
    static bool isAvailable();
44
    static bool isAvailable();
Lines 91-96 private: a/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.h_sec2
91
    COMPtr<IMFPresentationDescriptor> m_sourcePD;
90
    COMPtr<IMFPresentationDescriptor> m_sourcePD;
92
    COMPtr<IMFVideoDisplayControl> m_videoDisplay;
91
    COMPtr<IMFVideoDisplayControl> m_videoDisplay;
93
92
93
    static std::unique_ptr<MediaPlayerPrivateInterface> create(MediaPlayer*);
94
94
    bool createSession();
95
    bool createSession();
95
    bool endSession();
96
    bool endSession();
96
    bool startCreateMediaSource(const String& url);
97
    bool startCreateMediaSource(const String& url);
- a/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp -2 / +2 lines
Lines 43-51 void MockMediaPlayerMediaSource::registerMediaEngine(MediaEngineRegistrar regist a/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp_sec1
43
    registrar(create, getSupportedTypes, supportsType, 0, 0, 0, 0);
43
    registrar(create, getSupportedTypes, supportsType, 0, 0, 0, 0);
44
}
44
}
45
45
46
PassOwnPtr<MediaPlayerPrivateInterface> MockMediaPlayerMediaSource::create(MediaPlayer* player)
46
std::unique_ptr<MediaPlayerPrivateInterface> MockMediaPlayerMediaSource::create(MediaPlayer* player)
47
{
47
{
48
    return adoptPtr(new MockMediaPlayerMediaSource(player));
48
    return std::make_unique<MockMediaPlayerMediaSource>(player);
49
}
49
}
50
50
51
static HashSet<String> mimeTypeCache()
51
static HashSet<String> mimeTypeCache()
- a/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h -2 / +2 lines
Lines 40-46 class MockMediaPlayerMediaSource : public MediaPlayerPrivateInterface { a/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h_sec1
40
public:
40
public:
41
    // MediaPlayer Engine Support
41
    // MediaPlayer Engine Support
42
    WEBCORE_EXPORT static void registerMediaEngine(MediaEngineRegistrar);
42
    WEBCORE_EXPORT static void registerMediaEngine(MediaEngineRegistrar);
43
    static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*);
43
    static std::unique_ptr<MediaPlayerPrivateInterface> create(MediaPlayer*);
44
    static void getSupportedTypes(HashSet<String>& types);
44
    static void getSupportedTypes(HashSet<String>& types);
45
    static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&);
45
    static MediaPlayer::SupportsType supportsType(const MediaEngineSupportParameters&);
46
46
Lines 56-62 public: a/Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.h_sec2
56
    void seekCompleted();
56
    void seekCompleted();
57
57
58
private:
58
private:
59
    MockMediaPlayerMediaSource(MediaPlayer*);
59
    explicit MockMediaPlayerMediaSource(MediaPlayer*);
60
60
61
    // MediaPlayerPrivate Overrides
61
    // MediaPlayerPrivate Overrides
62
    virtual void load(const String& url) override;
62
    virtual void load(const String& url) override;

Return to Bug 137765