Changeset 86418 in webkit


Ignore:
Timestamp:
May 13, 2011 12:37:50 AM (13 years ago)
Author:
Patrick Gansterer
Message:

2011-05-13 Patrick Gansterer <Patrick Gansterer>

Reviewed by Adam Barth.

Enable OwnPtr strict mode in MediaPlayer
https://bugs.webkit.org/show_bug.cgi?id=59466

Let the CreateMediaEnginePlayer function return a PassOwnPtr instead of a raw pointer.
Also fix the templete argument of OwnPtr for the m_private member variable.

  • platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::MediaPlayer): (WebCore::MediaPlayer::loadWithNextMediaEngine):
  • platform/graphics/MediaPlayer.h:
  • platform/graphics/avfoundation/MediaPlayerPrivateAVFoundationObjC.h:
  • platform/graphics/avfoundation/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::create):
  • platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::create):
  • platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
  • platform/graphics/mac/MediaPlayerPrivateQTKit.h:
  • platform/graphics/mac/MediaPlayerPrivateQTKit.mm: (WebCore::MediaPlayerPrivateQTKit::create):
  • platform/graphics/qt/MediaPlayerPrivatePhonon.cpp: (WebCore::MediaPlayerPrivatePhonon::create):
  • platform/graphics/qt/MediaPlayerPrivatePhonon.h:
  • platform/graphics/qt/MediaPlayerPrivateQt.cpp: (WebCore::MediaPlayerPrivateQt::create):
  • platform/graphics/qt/MediaPlayerPrivateQt.h:
  • platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp: (WebCore::MediaPlayerPrivateQuickTimeVisualContext::create):
  • platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h:
  • platform/graphics/win/MediaPlayerPrivateQuickTimeWin.cpp: (WebCore::MediaPlayerPrivate::create):
  • platform/graphics/win/MediaPlayerPrivateQuickTimeWin.h:
  • platform/graphics/wince/MediaPlayerPrivateWinCE.h:

2011-05-13 Patrick Gansterer <Patrick Gansterer>

Reviewed by Adam Barth.

Enable OwnPtr strict mode in MediaPlayer
https://bugs.webkit.org/show_bug.cgi?id=59466

Let the CreateMediaEnginePlayer function return a PassOwnPtr instead of a raw pointer.
Also fix the templete argument of OwnPtr for the m_private member variable.

  • src/WebMediaPlayerClientImpl.cpp: (WebKit::WebMediaPlayerClientImpl::create):
  • src/WebMediaPlayerClientImpl.h:
Location:
trunk/Source
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r86417 r86418  
     12011-05-13  Patrick Gansterer  <paroga@webkit.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        Enable OwnPtr strict mode in MediaPlayer
     6        https://bugs.webkit.org/show_bug.cgi?id=59466
     7
     8        Let the CreateMediaEnginePlayer function return a PassOwnPtr instead of a raw pointer.
     9        Also fix the templete argument of OwnPtr for the m_private member variable.
     10
     11        * platform/graphics/MediaPlayer.cpp:
     12        (WebCore::MediaPlayer::MediaPlayer):
     13        (WebCore::MediaPlayer::loadWithNextMediaEngine):
     14        * platform/graphics/MediaPlayer.h:
     15        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundationObjC.h:
     16        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundationObjC.mm:
     17        (WebCore::MediaPlayerPrivateAVFoundationObjC::create):
     18        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
     19        (WebCore::MediaPlayerPrivateGStreamer::create):
     20        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
     21        * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
     22        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
     23        (WebCore::MediaPlayerPrivateQTKit::create):
     24        * platform/graphics/qt/MediaPlayerPrivatePhonon.cpp:
     25        (WebCore::MediaPlayerPrivatePhonon::create):
     26        * platform/graphics/qt/MediaPlayerPrivatePhonon.h:
     27        * platform/graphics/qt/MediaPlayerPrivateQt.cpp:
     28        (WebCore::MediaPlayerPrivateQt::create):
     29        * platform/graphics/qt/MediaPlayerPrivateQt.h:
     30        * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
     31        (WebCore::MediaPlayerPrivateQuickTimeVisualContext::create):
     32        * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h:
     33        * platform/graphics/win/MediaPlayerPrivateQuickTimeWin.cpp:
     34        (WebCore::MediaPlayerPrivate::create):
     35        * platform/graphics/win/MediaPlayerPrivateQuickTimeWin.h:
     36        * platform/graphics/wince/MediaPlayerPrivateWinCE.h:
     37
    1382011-05-13  Alexey Proskuryakov  <ap@apple.com>
    239
  • trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp

    r84881 r86418  
    2626#include "config.h"
    2727
    28 // FIXME: Remove this define!
    29 #define LOOSE_OWN_PTR
    30 
    3128#if ENABLE(VIDEO)
    3229#include "MediaPlayer.h"
     
    311308    if (!engines.isEmpty()) {
    312309        m_currentMediaEngine = engines[0];
    313         m_private.clear();
    314         m_private.set(engines[0]->constructor(this));
     310        m_private = engines[0]->constructor(this);
    315311        if (m_mediaPlayerClient)
    316312            m_mediaPlayerClient->mediaPlayerEngineUpdated(this);
     
    363359    if (!engine) {
    364360        m_currentMediaEngine = engine;
    365         m_private.clear();
     361        m_private = nullptr;
    366362    } else if (m_currentMediaEngine != engine) {
    367363        m_currentMediaEngine = engine;
    368         m_private.clear();
    369         m_private.set(engine->constructor(this));
     364        m_private = engine->constructor(this);
    370365        if (m_mediaPlayerClient)
    371366            m_mediaPlayerClient->mediaPlayerEngineUpdated(this);
  • trunk/Source/WebCore/platform/graphics/MediaPlayer.h

    r83667 r86418  
    311311    MediaPlayerClient* m_mediaPlayerClient;
    312312    Timer<MediaPlayer> m_reloadTimer;
    313     OwnPtr<MediaPlayerPrivateInterface*> m_private;
     313    OwnPtr<MediaPlayerPrivateInterface> m_private;
    314314    MediaPlayerFactory* m_currentMediaEngine;
    315315    String m_url;
     
    331331};
    332332
    333 typedef MediaPlayerPrivateInterface* (*CreateMediaEnginePlayer)(MediaPlayer*);
     333typedef PassOwnPtr<MediaPlayerPrivateInterface> (*CreateMediaEnginePlayer)(MediaPlayer*);
    334334typedef void (*MediaEngineSupportedTypes)(HashSet<String>& types);
    335335typedef MediaPlayer::SupportsType (*MediaEngineSupportsType)(const String& type, const String& codecs);
  • trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundationObjC.h

    r85913 r86418  
    6767
    6868    // engine support
    69     static MediaPlayerPrivateInterface* create(MediaPlayer* player);
     69    static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*);
    7070    static void getSupportedTypes(HashSet<String>& types);
    7171    static MediaPlayer::SupportsType supportsType(const String& type, const String& codecs);
  • trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundationObjC.mm

    r86163 r86418  
    124124static const float invalidTime = -1.0f;
    125125
    126 MediaPlayerPrivateInterface* MediaPlayerPrivateAVFoundationObjC::create(MediaPlayer* player)
     126PassOwnPtr<MediaPlayerPrivateInterface> MediaPlayerPrivateAVFoundationObjC::create(MediaPlayer* player)
    127127{
    128     return new MediaPlayerPrivateAVFoundationObjC(player);
     128    return adoptPtr(new MediaPlayerPrivateAVFoundationObjC(player));
    129129}
    130130
  • trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp

    r85036 r86418  
    152152}
    153153
    154 MediaPlayerPrivateInterface* MediaPlayerPrivateGStreamer::create(MediaPlayer* player)
    155 {
    156     return new MediaPlayerPrivateGStreamer(player);
     154PassOwnPtr<MediaPlayerPrivateInterface> MediaPlayerPrivateGStreamer::create(MediaPlayer* player)
     155{
     156    return adoptPtr(new MediaPlayerPrivateGStreamer(player));
    157157}
    158158
  • trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h

    r83598 r86418  
    4848
    4949        public:
     50            ~MediaPlayerPrivateGStreamer();
    5051            static void registerMediaEngine(MediaEngineRegistrar);
    5152            gboolean handleMessage(GstMessage*);
     
    125126        private:
    126127            MediaPlayerPrivateGStreamer(MediaPlayer*);
    127             ~MediaPlayerPrivateGStreamer();
    128128
    129             static MediaPlayerPrivateInterface* create(MediaPlayer* player);
     129            static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*);
    130130
    131131            static void getSupportedTypes(HashSet<String>&);
  • trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h

    r85478 r86418  
    6060class MediaPlayerPrivateQTKit : public MediaPlayerPrivateInterface {
    6161public:
     62    ~MediaPlayerPrivateQTKit();
    6263    static void registerMediaEngine(MediaEngineRegistrar);
    6364
     
    7172private:
    7273    MediaPlayerPrivateQTKit(MediaPlayer*);
    73     ~MediaPlayerPrivateQTKit();
    7474
    7575    // engine support
    76     static MediaPlayerPrivateInterface* create(MediaPlayer* player);
     76    static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*);
    7777    static void getSupportedTypes(HashSet<String>& types);
    7878    static MediaPlayer::SupportsType supportsType(const String& type, const String& codecs);
  • trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm

    r85478 r86418  
    182182namespace WebCore {
    183183
    184 
    185 
    186 MediaPlayerPrivateInterface* MediaPlayerPrivateQTKit::create(MediaPlayer* player)
     184PassOwnPtr<MediaPlayerPrivateInterface> MediaPlayerPrivateQTKit::create(MediaPlayer* player)
    187185{
    188     return new MediaPlayerPrivateQTKit(player);
     186    return adoptPtr(new MediaPlayerPrivateQTKit(player));
    189187}
    190188
  • trunk/Source/WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.cpp

    r80473 r86418  
    119119}
    120120
    121 MediaPlayerPrivateInterface* MediaPlayerPrivatePhonon::create(MediaPlayer* player)
    122 {
    123     return new MediaPlayerPrivatePhonon(player);
     121PassOwnPtr<MediaPlayerPrivateInterface> MediaPlayerPrivatePhonon::create(MediaPlayer* player)
     122{
     123    return adoptPtr(new MediaPlayerPrivatePhonon(player));
    124124}
    125125
  • trunk/Source/WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.h

    r68526 r86418  
    129129    private:
    130130        MediaPlayerPrivatePhonon(MediaPlayer*);
    131         static MediaPlayerPrivateInterface* create(MediaPlayer* player);
     131        static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*);
    132132
    133133        static void getSupportedTypes(HashSet<String>&);
  • trunk/Source/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp

    r86276 r86418  
    6060namespace WebCore {
    6161
    62 MediaPlayerPrivateInterface* MediaPlayerPrivateQt::create(MediaPlayer* player)
    63 {
    64     return new MediaPlayerPrivateQt(player);
     62PassOwnPtr<MediaPlayerPrivateInterface> MediaPlayerPrivateQt::create(MediaPlayer* player)
     63{
     64    return adoptPtr(new MediaPlayerPrivateQt(player));
    6565}
    6666
  • trunk/Source/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.h

    r86276 r86418  
    4747
    4848public:
    49     static MediaPlayerPrivateInterface* create(MediaPlayer* player);
     49    static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*);
    5050    ~MediaPlayerPrivateQt();
    5151
  • trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp

    r85653 r86418  
    149149};
    150150
    151 MediaPlayerPrivateInterface* MediaPlayerPrivateQuickTimeVisualContext::create(MediaPlayer* player)
     151PassOwnPtr<MediaPlayerPrivateInterface> MediaPlayerPrivateQuickTimeVisualContext::create(MediaPlayer* player)
    152152{
    153     return new MediaPlayerPrivateQuickTimeVisualContext(player);
     153    return adoptPtr(new MediaPlayerPrivateQuickTimeVisualContext(player));
    154154}
    155155
  • trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h

    r80442 r86418  
    127127
    128128    // engine support
    129     static MediaPlayerPrivateInterface* create(MediaPlayer*);
     129    static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*);
    130130    static void getSupportedTypes(HashSet<String>& types);
    131131    static MediaPlayer::SupportsType supportsType(const String& type, const String& codecs);
  • trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeWin.cpp

    r85653 r86418  
    7272SOFT_LINK(Wininet, InternetSetCookieExW, DWORD, WINAPI, (LPCWSTR lpszUrl, LPCWSTR lpszCookieName, LPCWSTR lpszCookieData, DWORD dwFlags, DWORD_PTR dwReserved), (lpszUrl, lpszCookieName, lpszCookieData, dwFlags, dwReserved))
    7373
    74 MediaPlayerPrivateInterface* MediaPlayerPrivate::create(MediaPlayer* player)
     74PassOwnPtr<MediaPlayerPrivateInterface> MediaPlayerPrivate::create(MediaPlayer* player)
    7575{
    76     return new MediaPlayerPrivate(player);
     76    return adoptPtr(new MediaPlayerPrivate(player));
    7777}
    7878
  • trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeWin.h

    r65021 r86418  
    138138
    139139    // engine support
    140     static MediaPlayerPrivateInterface* create(MediaPlayer*);
     140    static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*);
    141141    static void getSupportedTypes(HashSet<String>& types);
    142142    static MediaPlayer::SupportsType supportsType(const String& type, const String& codecs);
  • trunk/Source/WebCore/platform/graphics/wince/MediaPlayerPrivateWinCE.h

    r67788 r86418  
    9898
    9999        // engine support
    100         static MediaPlayerPrivateInterface* create(MediaPlayer*);
     100        static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*);
    101101        static void getSupportedTypes(HashSet<String>& types);
    102102        static MediaPlayer::SupportsType supportsType(const String& type, const String& codecs);
  • trunk/Source/WebKit/chromium/ChangeLog

    r86410 r86418  
     12011-05-13  Patrick Gansterer  <paroga@webkit.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        Enable OwnPtr strict mode in MediaPlayer
     6        https://bugs.webkit.org/show_bug.cgi?id=59466
     7
     8        Let the CreateMediaEnginePlayer function return a PassOwnPtr instead of a raw pointer.
     9        Also fix the templete argument of OwnPtr for the m_private member variable.
     10
     11        * src/WebMediaPlayerClientImpl.cpp:
     12        (WebKit::WebMediaPlayerClientImpl::create):
     13        * src/WebMediaPlayerClientImpl.h:
     14
    1152011-05-12  Adam Barth  <abarth@webkit.org>
    216
  • trunk/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp

    r85603 r86418  
    548548#endif
    549549
    550 MediaPlayerPrivateInterface* WebMediaPlayerClientImpl::create(MediaPlayer* player)
    551 {
    552     WebMediaPlayerClientImpl* client = new WebMediaPlayerClientImpl();
     550PassOwnPtr<MediaPlayerPrivateInterface> WebMediaPlayerClientImpl::create(MediaPlayer* player)
     551{
     552    OwnPtr<WebMediaPlayerClientImpl> client = adoptPtr(new WebMediaPlayerClientImpl());
    553553    client->m_mediaPlayer = player;
    554554
     
    565565#endif
    566566
    567     return client;
     567    return client.release();
    568568}
    569569
  • trunk/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h

    r82641 r86418  
    135135    void loadInternal();
    136136
    137     static WebCore::MediaPlayerPrivateInterface* create(WebCore::MediaPlayer*);
     137    static PassOwnPtr<WebCore::MediaPlayerPrivateInterface> create(WebCore::MediaPlayer*);
    138138    static void getSupportedTypes(WTF::HashSet<WTF::String>&);
    139139    static WebCore::MediaPlayer::SupportsType supportsType(
Note: See TracChangeset for help on using the changeset viewer.