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

Side by Side Diff: Source/web/WebMediaPlayerClientImpl.cpp

Issue 1180073014: Invalidate video elements when starting up media players and changing DisplayMode. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/layout/LayoutVideo.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "web/WebMediaPlayerClientImpl.h" 6 #include "web/WebMediaPlayerClientImpl.h"
7 7
8 #include "core/frame/LocalFrame.h" 8 #include "core/frame/LocalFrame.h"
9 #include "core/html/HTMLMediaElement.h" 9 #include "core/html/HTMLMediaElement.h"
10 #include "core/html/TimeRanges.h" 10 #include "core/html/TimeRanges.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 { 52 {
53 return m_webMediaPlayer.get(); 53 return m_webMediaPlayer.get();
54 } 54 }
55 55
56 // WebMediaPlayerClient -------------------------------------------------------- 56 // WebMediaPlayerClient --------------------------------------------------------
57 57
58 WebMediaPlayerClientImpl::~WebMediaPlayerClientImpl() 58 WebMediaPlayerClientImpl::~WebMediaPlayerClientImpl()
59 { 59 {
60 // Explicitly destroy the WebMediaPlayer to allow verification of tear down. 60 // Explicitly destroy the WebMediaPlayer to allow verification of tear down.
61 m_webMediaPlayer.clear(); 61 m_webMediaPlayer.clear();
62
63 if (mediaElement().layoutObject())
sof 2015/06/18 14:02:49 Is this a safe thing to do? And is it needed? Web
chrishtr 2015/06/18 14:37:09 clearMediaPlayerAndAudioSourceProviderClientWithou
64 mediaElement().layoutObject()->setShouldDoFullPaintInvalidation();
62 } 65 }
63 66
64 void WebMediaPlayerClientImpl::networkStateChanged() 67 void WebMediaPlayerClientImpl::networkStateChanged()
65 { 68 {
66 m_client->mediaPlayerNetworkStateChanged(); 69 m_client->mediaPlayerNetworkStateChanged();
67 } 70 }
68 71
69 void WebMediaPlayerClientImpl::readyStateChanged() 72 void WebMediaPlayerClientImpl::readyStateChanged()
70 { 73 {
71 m_client->mediaPlayerReadyStateChanged(); 74 m_client->mediaPlayerReadyStateChanged();
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 // FIXME: Remove this cast 198 // FIXME: Remove this cast
196 LocalFrame* frame = mediaElement().document().frame(); 199 LocalFrame* frame = mediaElement().document().frame();
197 200
198 WebURL poster = m_client->mediaPlayerPosterURL(); 201 WebURL poster = m_client->mediaPlayerPosterURL();
199 202
200 KURL kurl(ParsedURLString, url); 203 KURL kurl(ParsedURLString, url);
201 m_webMediaPlayer = createWebMediaPlayer(this, kurl, frame, HTMLMediaElementE ncryptedMedia::contentDecryptionModule(mediaElement())); 204 m_webMediaPlayer = createWebMediaPlayer(this, kurl, frame, HTMLMediaElementE ncryptedMedia::contentDecryptionModule(mediaElement()));
202 if (!m_webMediaPlayer) 205 if (!m_webMediaPlayer)
203 return; 206 return;
204 207
208 if (mediaElement().layoutObject())
209 mediaElement().layoutObject()->setShouldDoFullPaintInvalidation();
210
205 #if ENABLE(WEB_AUDIO) 211 #if ENABLE(WEB_AUDIO)
206 // Make sure if we create/re-create the WebMediaPlayer that we update our wr apper. 212 // Make sure if we create/re-create the WebMediaPlayer that we update our wr apper.
207 m_audioSourceProvider.wrap(m_webMediaPlayer->audioSourceProvider()); 213 m_audioSourceProvider.wrap(m_webMediaPlayer->audioSourceProvider());
208 #endif 214 #endif
209 215
210 m_webMediaPlayer->setVolume(mediaElement().effectiveMediaVolume()); 216 m_webMediaPlayer->setVolume(mediaElement().effectiveMediaVolume());
211 217
212 m_webMediaPlayer->setPoster(poster); 218 m_webMediaPlayer->setPoster(poster);
213 219
214 setPreload(mediaElement().effectivePreloadType()); 220 setPreload(mediaElement().effectivePreloadType());
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 } 308 }
303 309
304 DEFINE_TRACE(WebMediaPlayerClientImpl::AudioClientImpl) 310 DEFINE_TRACE(WebMediaPlayerClientImpl::AudioClientImpl)
305 { 311 {
306 visitor->trace(m_client); 312 visitor->trace(m_client);
307 } 313 }
308 314
309 #endif 315 #endif
310 316
311 } // namespace blink 317 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutVideo.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698