Changeset 174505 in webkit
- Timestamp:
- Oct 9, 2014 9:18:46 AM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r174504 r174505 1 2014-10-09 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 Layering violation: MediaPlayer should not reference/use FrameView 4 https://bugs.webkit.org/show_bug.cgi?id=21562 5 6 Reviewed by Darin Adler. 7 8 Remove FrameView dependency from MediaPlayer. 9 10 * html/HTMLMediaElement.cpp: 11 (WebCore::HTMLMediaElement::mediaPlayerIsInMediaDocument): Check if 12 the element document is a media document. 13 * html/HTMLMediaElement.h: 14 * platform/graphics/MediaPlayer.cpp: 15 (WebCore::MediaPlayer::MediaPlayer): Remove m_frameView initialization. 16 (WebCore::MediaPlayer::inMediaDocument): Use the MediaPlayerClient 17 to check if the media player is in a media document. 18 * platform/graphics/MediaPlayer.h: 19 (WebCore::MediaPlayerClient::mediaPlayerIsInMediaDocument): 20 (WebCore::MediaPlayer::setFrameView): Deleted. 21 (WebCore::MediaPlayer::frameView): Deleted. 22 * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: 23 (WebCore::MediaPlayerPrivateAVFoundation::preferredRenderingMode): 24 Do not check if the media player has a frame view, checking whether it's visible 25 is enough. 26 * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: 27 Remove unneeded header include. 28 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: Ditto. 29 * platform/graphics/mac/MediaPlayerPrivateQTKit.mm: Ditto. 30 * rendering/RenderVideo.cpp: 31 (WebCore::RenderVideo::~RenderVideo): Do not call MediaPlayer::setFrameView(). 32 (WebCore::RenderVideo::updatePlayer): Ditto. 33 1 34 2014-10-09 Christophe Dumez <cdumez@apple.com> 2 35 -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r174353 r174505 5709 5709 } 5710 5710 #endif 5711 5711 5712 bool HTMLMediaElement::mediaPlayerIsInMediaDocument() const 5713 { 5714 return document().isMediaDocument(); 5715 } 5716 5712 5717 void HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture() 5713 5718 { -
trunk/Source/WebCore/html/HTMLMediaElement.h
r174353 r174505 584 584 #endif 585 585 586 virtual bool mediaPlayerIsInMediaDocument() const override final; 587 586 588 void loadTimerFired(Timer<HTMLMediaElement>&); 587 589 void progressEventTimerFired(Timer<HTMLMediaElement>&); -
trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp
r174071 r174505 31 31 #include "ContentType.h" 32 32 #include "Document.h" 33 #include "Frame.h"34 #include "FrameView.h"35 33 #include "IntRect.h" 36 34 #include "Logging.h" … … 313 311 , m_private(createNullMediaPlayer(this)) 314 312 , m_currentMediaEngine(0) 315 , m_frameView(0)316 313 , m_preload(Auto) 317 314 , m_visible(false) … … 590 587 } 591 588 592 bool MediaPlayer::inMediaDocument() 593 { 594 if (!m_frameView) 595 return false; 596 Document* document = m_frameView->frame().document(); 597 return document && document->isMediaDocument(); 589 bool MediaPlayer::inMediaDocument() const 590 { 591 return m_visible && m_mediaPlayerClient && m_mediaPlayerClient->mediaPlayerIsInMediaDocument(); 598 592 } 599 593 -
trunk/Source/WebCore/platform/graphics/MediaPlayer.h
r174071 r174505 130 130 class CachedResourceLoader; 131 131 class ContentType; 132 class FrameView;133 132 class GraphicsContext; 134 133 class GraphicsContext3D; … … 265 264 266 265 virtual String mediaPlayerSourceApplicationIdentifier() const { return emptyString(); } 266 267 virtual bool mediaPlayerIsInMediaDocument() const { return false; } 267 268 }; 268 269 … … 317 318 bool hasAudio() const; 318 319 319 void setFrameView(FrameView* frameView) { m_frameView = frameView; } 320 FrameView* frameView() { return m_frameView; } 321 bool inMediaDocument(); 320 bool inMediaDocument() const; 322 321 323 322 IntSize size() const { return m_size; } … … 595 594 String m_contentTypeCodecs; 596 595 String m_keySystem; 597 FrameView* m_frameView;598 596 IntSize m_size; 599 597 Preload m_preload; -
trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp
r173453 r174505 32 32 #include "DocumentLoader.h" 33 33 #include "FloatConversion.h" 34 #include "Frame.h"35 #include "FrameView.h"36 34 #include "GraphicsContext.h" 37 35 #include "InbandTextTrackPrivateAVF.h" … … 105 103 MediaPlayerPrivateAVFoundation::MediaRenderingMode MediaPlayerPrivateAVFoundation::preferredRenderingMode() const 106 104 { 107 if (!m_player->visible() || !m_player->frameView() ||assetStatus() == MediaPlayerAVAssetStatusUnknown)105 if (!m_player->visible() || assetStatus() == MediaPlayerAVAssetStatusUnknown) 108 106 return MediaRenderingNone; 109 107 -
trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp
r174350 r174505 36 36 #include "COMPtr.h" 37 37 #include "FloatConversion.h" 38 #include "FrameView.h"39 38 #include "GraphicsContext.h" 40 39 #if HAVE(AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT) -
trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
r174277 r174505 39 39 #import "FloatConversion.h" 40 40 #import "FloatConversion.h" 41 #import "FrameView.h"42 41 #import "GraphicsContext.h" 43 42 #import "GraphicsContextCG.h" -
trunk/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
r174106 r174505 32 32 #import "BlockExceptions.h" 33 33 #import "DocumentLoader.h" 34 #import "Frame.h"35 #import "HostWindow.h"36 34 #import "GraphicsContext.h" 37 35 #import "URL.h" -
trunk/Source/WebCore/rendering/RenderVideo.cpp
r173893 r174505 57 57 RenderVideo::~RenderVideo() 58 58 { 59 if (MediaPlayer* player = videoElement().player()) {59 if (MediaPlayer* player = videoElement().player()) 60 60 player->setVisible(false); 61 player->setFrameView(0);62 }63 61 } 64 62 … … 234 232 235 233 IntRect videoBounds = videoBox(); 236 mediaPlayer->setFrameView(&view().frameView());237 234 mediaPlayer->setSize(IntSize(videoBounds.width(), videoBounds.height())); 238 235 mediaPlayer->setVisible(true);
Note: See TracChangeset
for help on using the changeset viewer.