Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(327)

Unified Diff: Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp

Issue 8333009: Merge 97451 - Clear WebMediaPlayerClientImpl back pointer on destruction (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/874/
Patch Set: Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp
===================================================================
--- Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp (revision 97678)
+++ Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp (working copy)
@@ -100,11 +100,10 @@
WebMediaPlayerClientImpl::~WebMediaPlayerClientImpl()
{
- // VideoLayerChromium may outlive this object so make sure all frames are
- // released.
+ // VideoLayerChromium may outlive this object so clear the back pointer.
#if USE(ACCELERATED_COMPOSITING)
if (m_videoLayer.get())
- m_videoLayer->releaseCurrentFrame();
+ m_videoLayer->releaseProvider();
#endif
}
@@ -220,13 +219,6 @@
{
m_url = url;
- // Video frame object is owned by WebMediaPlayer. Before destroying
- // WebMediaPlayer all frames need to be released.
-#if USE(ACCELERATED_COMPOSITING)
- if (m_videoLayer.get())
- m_videoLayer->releaseCurrentFrame();
-#endif
-
if (m_preload == MediaPlayer::None) {
m_webMediaPlayer.clear();
m_delayingLoad = true;
@@ -577,23 +569,24 @@
VideoFrameChromium* WebMediaPlayerClientImpl::getCurrentFrame()
{
- VideoFrameChromium* videoFrame = 0;
- if (m_webMediaPlayer.get()) {
+ ASSERT(!m_currentVideoFrame);
+ if (m_webMediaPlayer && !m_currentVideoFrame) {
WebVideoFrame* webkitVideoFrame = m_webMediaPlayer->getCurrentFrame();
if (webkitVideoFrame)
- videoFrame = new VideoFrameChromiumImpl(webkitVideoFrame);
+ m_currentVideoFrame = adoptPtr(new VideoFrameChromiumImpl(webkitVideoFrame));
}
- return videoFrame;
+ return m_currentVideoFrame.get();
}
void WebMediaPlayerClientImpl::putCurrentFrame(VideoFrameChromium* videoFrame)
{
- if (videoFrame) {
+ if (videoFrame && videoFrame == m_currentVideoFrame) {
if (m_webMediaPlayer.get()) {
m_webMediaPlayer->putCurrentFrame(
VideoFrameChromiumImpl::toWebVideoFrame(videoFrame));
}
- delete videoFrame;
+ ASSERT(videoFrame == m_currentVideoFrame);
+ m_currentVideoFrame.clear();
}
}
#endif
« no previous file with comments | « Source/WebKit/chromium/src/WebMediaPlayerClientImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698