Changeset 86418 in webkit
- Timestamp:
- May 13, 2011 12:37:50 AM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r86417 r86418 1 2011-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 1 38 2011-05-13 Alexey Proskuryakov <ap@apple.com> 2 39 -
trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp
r84881 r86418 26 26 #include "config.h" 27 27 28 // FIXME: Remove this define!29 #define LOOSE_OWN_PTR30 31 28 #if ENABLE(VIDEO) 32 29 #include "MediaPlayer.h" … … 311 308 if (!engines.isEmpty()) { 312 309 m_currentMediaEngine = engines[0]; 313 m_private.clear(); 314 m_private.set(engines[0]->constructor(this)); 310 m_private = engines[0]->constructor(this); 315 311 if (m_mediaPlayerClient) 316 312 m_mediaPlayerClient->mediaPlayerEngineUpdated(this); … … 363 359 if (!engine) { 364 360 m_currentMediaEngine = engine; 365 m_private .clear();361 m_private = nullptr; 366 362 } else if (m_currentMediaEngine != engine) { 367 363 m_currentMediaEngine = engine; 368 m_private.clear(); 369 m_private.set(engine->constructor(this)); 364 m_private = engine->constructor(this); 370 365 if (m_mediaPlayerClient) 371 366 m_mediaPlayerClient->mediaPlayerEngineUpdated(this); -
trunk/Source/WebCore/platform/graphics/MediaPlayer.h
r83667 r86418 311 311 MediaPlayerClient* m_mediaPlayerClient; 312 312 Timer<MediaPlayer> m_reloadTimer; 313 OwnPtr<MediaPlayerPrivateInterface *> m_private;313 OwnPtr<MediaPlayerPrivateInterface> m_private; 314 314 MediaPlayerFactory* m_currentMediaEngine; 315 315 String m_url; … … 331 331 }; 332 332 333 typedef MediaPlayerPrivateInterface*(*CreateMediaEnginePlayer)(MediaPlayer*);333 typedef PassOwnPtr<MediaPlayerPrivateInterface> (*CreateMediaEnginePlayer)(MediaPlayer*); 334 334 typedef void (*MediaEngineSupportedTypes)(HashSet<String>& types); 335 335 typedef MediaPlayer::SupportsType (*MediaEngineSupportsType)(const String& type, const String& codecs); -
trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundationObjC.h
r85913 r86418 67 67 68 68 // engine support 69 static MediaPlayerPrivateInterface* create(MediaPlayer* player);69 static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*); 70 70 static void getSupportedTypes(HashSet<String>& types); 71 71 static MediaPlayer::SupportsType supportsType(const String& type, const String& codecs); -
trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundationObjC.mm
r86163 r86418 124 124 static const float invalidTime = -1.0f; 125 125 126 MediaPlayerPrivateInterface* MediaPlayerPrivateAVFoundationObjC::create(MediaPlayer* player) 126 PassOwnPtr<MediaPlayerPrivateInterface> MediaPlayerPrivateAVFoundationObjC::create(MediaPlayer* player) 127 127 { 128 return new MediaPlayerPrivateAVFoundationObjC(player);128 return adoptPtr(new MediaPlayerPrivateAVFoundationObjC(player)); 129 129 } 130 130 -
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
r85036 r86418 152 152 } 153 153 154 MediaPlayerPrivateInterface*MediaPlayerPrivateGStreamer::create(MediaPlayer* player)155 { 156 return new MediaPlayerPrivateGStreamer(player);154 PassOwnPtr<MediaPlayerPrivateInterface> MediaPlayerPrivateGStreamer::create(MediaPlayer* player) 155 { 156 return adoptPtr(new MediaPlayerPrivateGStreamer(player)); 157 157 } 158 158 -
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
r83598 r86418 48 48 49 49 public: 50 ~MediaPlayerPrivateGStreamer(); 50 51 static void registerMediaEngine(MediaEngineRegistrar); 51 52 gboolean handleMessage(GstMessage*); … … 125 126 private: 126 127 MediaPlayerPrivateGStreamer(MediaPlayer*); 127 ~MediaPlayerPrivateGStreamer();128 128 129 static MediaPlayerPrivateInterface* create(MediaPlayer* player);129 static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*); 130 130 131 131 static void getSupportedTypes(HashSet<String>&); -
trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h
r85478 r86418 60 60 class MediaPlayerPrivateQTKit : public MediaPlayerPrivateInterface { 61 61 public: 62 ~MediaPlayerPrivateQTKit(); 62 63 static void registerMediaEngine(MediaEngineRegistrar); 63 64 … … 71 72 private: 72 73 MediaPlayerPrivateQTKit(MediaPlayer*); 73 ~MediaPlayerPrivateQTKit();74 74 75 75 // engine support 76 static MediaPlayerPrivateInterface* create(MediaPlayer* player);76 static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*); 77 77 static void getSupportedTypes(HashSet<String>& types); 78 78 static MediaPlayer::SupportsType supportsType(const String& type, const String& codecs); -
trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
r85478 r86418 182 182 namespace WebCore { 183 183 184 185 186 MediaPlayerPrivateInterface* MediaPlayerPrivateQTKit::create(MediaPlayer* player) 184 PassOwnPtr<MediaPlayerPrivateInterface> MediaPlayerPrivateQTKit::create(MediaPlayer* player) 187 185 { 188 return new MediaPlayerPrivateQTKit(player);186 return adoptPtr(new MediaPlayerPrivateQTKit(player)); 189 187 } 190 188 -
trunk/Source/WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.cpp
r80473 r86418 119 119 } 120 120 121 MediaPlayerPrivateInterface*MediaPlayerPrivatePhonon::create(MediaPlayer* player)122 { 123 return new MediaPlayerPrivatePhonon(player);121 PassOwnPtr<MediaPlayerPrivateInterface> MediaPlayerPrivatePhonon::create(MediaPlayer* player) 122 { 123 return adoptPtr(new MediaPlayerPrivatePhonon(player)); 124 124 } 125 125 -
trunk/Source/WebCore/platform/graphics/qt/MediaPlayerPrivatePhonon.h
r68526 r86418 129 129 private: 130 130 MediaPlayerPrivatePhonon(MediaPlayer*); 131 static MediaPlayerPrivateInterface* create(MediaPlayer* player);131 static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*); 132 132 133 133 static void getSupportedTypes(HashSet<String>&); -
trunk/Source/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.cpp
r86276 r86418 60 60 namespace WebCore { 61 61 62 MediaPlayerPrivateInterface*MediaPlayerPrivateQt::create(MediaPlayer* player)63 { 64 return new MediaPlayerPrivateQt(player);62 PassOwnPtr<MediaPlayerPrivateInterface> MediaPlayerPrivateQt::create(MediaPlayer* player) 63 { 64 return adoptPtr(new MediaPlayerPrivateQt(player)); 65 65 } 66 66 -
trunk/Source/WebCore/platform/graphics/qt/MediaPlayerPrivateQt.h
r86276 r86418 47 47 48 48 public: 49 static MediaPlayerPrivateInterface* create(MediaPlayer* player);49 static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*); 50 50 ~MediaPlayerPrivateQt(); 51 51 -
trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp
r85653 r86418 149 149 }; 150 150 151 MediaPlayerPrivateInterface* MediaPlayerPrivateQuickTimeVisualContext::create(MediaPlayer* player) 151 PassOwnPtr<MediaPlayerPrivateInterface> MediaPlayerPrivateQuickTimeVisualContext::create(MediaPlayer* player) 152 152 { 153 return new MediaPlayerPrivateQuickTimeVisualContext(player);153 return adoptPtr(new MediaPlayerPrivateQuickTimeVisualContext(player)); 154 154 } 155 155 -
trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.h
r80442 r86418 127 127 128 128 // engine support 129 static MediaPlayerPrivateInterface*create(MediaPlayer*);129 static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*); 130 130 static void getSupportedTypes(HashSet<String>& types); 131 131 static MediaPlayer::SupportsType supportsType(const String& type, const String& codecs); -
trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeWin.cpp
r85653 r86418 72 72 SOFT_LINK(Wininet, InternetSetCookieExW, DWORD, WINAPI, (LPCWSTR lpszUrl, LPCWSTR lpszCookieName, LPCWSTR lpszCookieData, DWORD dwFlags, DWORD_PTR dwReserved), (lpszUrl, lpszCookieName, lpszCookieData, dwFlags, dwReserved)) 73 73 74 MediaPlayerPrivateInterface* MediaPlayerPrivate::create(MediaPlayer* player) 74 PassOwnPtr<MediaPlayerPrivateInterface> MediaPlayerPrivate::create(MediaPlayer* player) 75 75 { 76 return new MediaPlayerPrivate(player);76 return adoptPtr(new MediaPlayerPrivate(player)); 77 77 } 78 78 -
trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateQuickTimeWin.h
r65021 r86418 138 138 139 139 // engine support 140 static MediaPlayerPrivateInterface*create(MediaPlayer*);140 static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*); 141 141 static void getSupportedTypes(HashSet<String>& types); 142 142 static MediaPlayer::SupportsType supportsType(const String& type, const String& codecs); -
trunk/Source/WebCore/platform/graphics/wince/MediaPlayerPrivateWinCE.h
r67788 r86418 98 98 99 99 // engine support 100 static MediaPlayerPrivateInterface*create(MediaPlayer*);100 static PassOwnPtr<MediaPlayerPrivateInterface> create(MediaPlayer*); 101 101 static void getSupportedTypes(HashSet<String>& types); 102 102 static MediaPlayer::SupportsType supportsType(const String& type, const String& codecs); -
trunk/Source/WebKit/chromium/ChangeLog
r86410 r86418 1 2011-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 1 15 2011-05-12 Adam Barth <abarth@webkit.org> 2 16 -
trunk/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp
r85603 r86418 548 548 #endif 549 549 550 MediaPlayerPrivateInterface*WebMediaPlayerClientImpl::create(MediaPlayer* player)551 { 552 WebMediaPlayerClientImpl* client = new WebMediaPlayerClientImpl();550 PassOwnPtr<MediaPlayerPrivateInterface> WebMediaPlayerClientImpl::create(MediaPlayer* player) 551 { 552 OwnPtr<WebMediaPlayerClientImpl> client = adoptPtr(new WebMediaPlayerClientImpl()); 553 553 client->m_mediaPlayer = player; 554 554 … … 565 565 #endif 566 566 567 return client ;567 return client.release(); 568 568 } 569 569 -
trunk/Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h
r82641 r86418 135 135 void loadInternal(); 136 136 137 static WebCore::MediaPlayerPrivateInterface*create(WebCore::MediaPlayer*);137 static PassOwnPtr<WebCore::MediaPlayerPrivateInterface> create(WebCore::MediaPlayer*); 138 138 static void getSupportedTypes(WTF::HashSet<WTF::String>&); 139 139 static WebCore::MediaPlayer::SupportsType supportsType(
Note: See TracChangeset
for help on using the changeset viewer.