Diff
Modified: branches/safari-600.5-branch/Source/WebCore/ChangeLog (178555 => 178556)
--- branches/safari-600.5-branch/Source/WebCore/ChangeLog 2015-01-16 01:58:08 UTC (rev 178555)
+++ branches/safari-600.5-branch/Source/WebCore/ChangeLog 2015-01-16 01:58:16 UTC (rev 178556)
@@ -1,5 +1,42 @@
2015-01-15 Matthew Hanson <matthew_han...@apple.com>
+ Merge r174505. rdar://problem/19451946
+
+ 2014-10-09 Carlos Garcia Campos <cgar...@igalia.com>
+
+ Layering violation: MediaPlayer should not reference/use FrameView
+ https://bugs.webkit.org/show_bug.cgi?id=21562
+
+ Reviewed by Darin Adler.
+
+ Remove FrameView dependency from MediaPlayer.
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::mediaPlayerIsInMediaDocument): Check if
+ the element document is a media document.
+ * html/HTMLMediaElement.h:
+ * platform/graphics/MediaPlayer.cpp:
+ (WebCore::MediaPlayer::MediaPlayer): Remove m_frameView initialization.
+ (WebCore::MediaPlayer::inMediaDocument): Use the MediaPlayerClient
+ to check if the media player is in a media document.
+ * platform/graphics/MediaPlayer.h:
+ (WebCore::MediaPlayerClient::mediaPlayerIsInMediaDocument):
+ (WebCore::MediaPlayer::setFrameView): Deleted.
+ (WebCore::MediaPlayer::frameView): Deleted.
+ * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
+ (WebCore::MediaPlayerPrivateAVFoundation::preferredRenderingMode):
+ Do not check if the media player has a frame view, checking whether it's visible
+ is enough.
+ * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
+ Remove unneeded header include.
+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: Ditto.
+ * platform/graphics/mac/MediaPlayerPrivateQTKit.mm: Ditto.
+ * rendering/RenderVideo.cpp:
+ (WebCore::RenderVideo::~RenderVideo): Do not call MediaPlayer::setFrameView().
+ (WebCore::RenderVideo::updatePlayer): Ditto.
+
+2015-01-15 Matthew Hanson <matthew_han...@apple.com>
+
Merge r174350. rdar://problem/19451946
2014-10-06 Brent Fulgham <bfulg...@apple.com>
Modified: branches/safari-600.5-branch/Source/WebCore/html/HTMLMediaElement.cpp (178555 => 178556)
--- branches/safari-600.5-branch/Source/WebCore/html/HTMLMediaElement.cpp 2015-01-16 01:58:08 UTC (rev 178555)
+++ branches/safari-600.5-branch/Source/WebCore/html/HTMLMediaElement.cpp 2015-01-16 01:58:16 UTC (rev 178556)
@@ -5784,6 +5784,11 @@
}
#endif
+bool HTMLMediaElement::mediaPlayerIsInMediaDocument() const
+{
+ return document().isMediaDocument();
+}
+
void HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture()
{
m_mediaSession->removeBehaviorRestriction(HTMLMediaSession::RequireUserGestureForLoad);
Modified: branches/safari-600.5-branch/Source/WebCore/html/HTMLMediaElement.h (178555 => 178556)
--- branches/safari-600.5-branch/Source/WebCore/html/HTMLMediaElement.h 2015-01-16 01:58:08 UTC (rev 178555)
+++ branches/safari-600.5-branch/Source/WebCore/html/HTMLMediaElement.h 2015-01-16 01:58:16 UTC (rev 178556)
@@ -589,6 +589,8 @@
virtual bool mediaPlayerGetRawCookies(const URL&, Vector<Cookie>&) const override;
#endif
+ virtual bool mediaPlayerIsInMediaDocument() const override final;
+
void loadTimerFired(Timer&);
void progressEventTimerFired(Timer&);
void playbackProgressTimerFired(Timer&);
Modified: branches/safari-600.5-branch/Source/WebCore/platform/graphics/MediaPlayer.cpp (178555 => 178556)
--- branches/safari-600.5-branch/Source/WebCore/platform/graphics/MediaPlayer.cpp 2015-01-16 01:58:08 UTC (rev 178555)
+++ branches/safari-600.5-branch/Source/WebCore/platform/graphics/MediaPlayer.cpp 2015-01-16 01:58:16 UTC (rev 178556)
@@ -30,8 +30,6 @@
#include "ContentType.h"
#include "Document.h"
-#include "Frame.h"
-#include "FrameView.h"
#include "IntRect.h"
#include "Logging.h"
#include "MIMETypeRegistry.h"
@@ -315,7 +313,6 @@
, m_reloadTimer(this, &MediaPlayer::reloadTimerFired)
, m_private(createNullMediaPlayer(this))
, m_currentMediaEngine(0)
- , m_frameView(0)
, m_preload(Auto)
, m_visible(false)
, m_rate(1.0f)
@@ -592,12 +589,9 @@
return m_private->hasAudio();
}
-bool MediaPlayer::inMediaDocument()
+bool MediaPlayer::inMediaDocument() const
{
- if (!m_frameView)
- return false;
- Document* document = m_frameView->frame().document();
- return document && document->isMediaDocument();
+ return m_visible && m_mediaPlayerClient && m_mediaPlayerClient->mediaPlayerIsInMediaDocument();
}
PlatformMedia MediaPlayer::platformMedia() const
Modified: branches/safari-600.5-branch/Source/WebCore/platform/graphics/MediaPlayer.h (178555 => 178556)
--- branches/safari-600.5-branch/Source/WebCore/platform/graphics/MediaPlayer.h 2015-01-16 01:58:08 UTC (rev 178555)
+++ branches/safari-600.5-branch/Source/WebCore/platform/graphics/MediaPlayer.h 2015-01-16 01:58:16 UTC (rev 178556)
@@ -130,7 +130,6 @@
class CachedResourceLoader;
class ContentType;
-class FrameView;
class GraphicsContext;
class GraphicsContext3D;
class HostWindow;
@@ -273,6 +272,8 @@
virtual void mediaPlayerHandlePlaybackCommand(MediaSession::RemoteControlCommandType) { }
virtual String mediaPlayerSourceApplicationIdentifier() const { return emptyString(); }
+
+ virtual bool mediaPlayerIsInMediaDocument() const { return false; }
};
class MediaPlayerSupportsTypeClient {
@@ -325,9 +326,7 @@
bool hasVideo() const;
bool hasAudio() const;
- void setFrameView(FrameView* frameView) { m_frameView = frameView; }
- FrameView* frameView() { return m_frameView; }
- bool inMediaDocument();
+ bool inMediaDocument() const;
IntSize size() const { return m_size; }
void setSize(const IntSize& size);
@@ -611,7 +610,6 @@
String m_contentMIMEType;
String m_contentTypeCodecs;
String m_keySystem;
- FrameView* m_frameView;
IntSize m_size;
Preload m_preload;
bool m_visible;
Modified: branches/safari-600.5-branch/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp (178555 => 178556)
--- branches/safari-600.5-branch/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp 2015-01-16 01:58:08 UTC (rev 178555)
+++ branches/safari-600.5-branch/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp 2015-01-16 01:58:16 UTC (rev 178556)
@@ -31,8 +31,6 @@
#include "DocumentLoader.h"
#include "FloatConversion.h"
-#include "Frame.h"
-#include "FrameView.h"
#include "GraphicsContext.h"
#include "InbandTextTrackPrivateAVF.h"
#include "InbandTextTrackPrivateClient.h"
@@ -103,7 +101,7 @@
MediaPlayerPrivateAVFoundation::MediaRenderingMode MediaPlayerPrivateAVFoundation::preferredRenderingMode() const
{
- if (!m_player->visible() || !m_player->frameView() || assetStatus() == MediaPlayerAVAssetStatusUnknown)
+ if (!m_player->visible() || assetStatus() == MediaPlayerAVAssetStatusUnknown)
return MediaRenderingNone;
if (supportsAcceleratedRendering() && m_player->mediaPlayerClient()->mediaPlayerRenderingCanBeAccelerated(m_player))
Modified: branches/safari-600.5-branch/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp (178555 => 178556)
--- branches/safari-600.5-branch/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp 2015-01-16 01:58:08 UTC (rev 178555)
+++ branches/safari-600.5-branch/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp 2015-01-16 01:58:16 UTC (rev 178556)
@@ -35,7 +35,6 @@
#include "CDMSessionAVFoundationCF.h"
#include "COMPtr.h"
#include "FloatConversion.h"
-#include "FrameView.h"
#include "GraphicsContext.h"
#if HAVE(AVFOUNDATION_LEGIBLE_OUTPUT_SUPPORT)
#include "InbandTextTrackPrivateAVCF.h"
Modified: branches/safari-600.5-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (178555 => 178556)
--- branches/safari-600.5-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2015-01-16 01:58:08 UTC (rev 178555)
+++ branches/safari-600.5-branch/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2015-01-16 01:58:16 UTC (rev 178556)
@@ -37,7 +37,6 @@
#import "ExceptionCodePlaceholder.h"
#import "FloatConversion.h"
#import "FloatConversion.h"
-#import "FrameView.h"
#import "GraphicsContext.h"
#import "GraphicsContextCG.h"
#import "InbandMetadataTextTrackPrivateAVF.h"
Modified: branches/safari-600.5-branch/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm (178555 => 178556)
--- branches/safari-600.5-branch/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm 2015-01-16 01:58:08 UTC (rev 178555)
+++ branches/safari-600.5-branch/Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm 2015-01-16 01:58:16 UTC (rev 178556)
@@ -31,9 +31,7 @@
#import "BlockExceptions.h"
#import "DocumentLoader.h"
-#import "Frame.h"
#import "FrameView.h"
-#import "HostWindow.h"
#import "GraphicsContext.h"
#import "URL.h"
#import "Logging.h"
Modified: branches/safari-600.5-branch/Source/WebCore/rendering/RenderVideo.cpp (178555 => 178556)
--- branches/safari-600.5-branch/Source/WebCore/rendering/RenderVideo.cpp 2015-01-16 01:58:08 UTC (rev 178555)
+++ branches/safari-600.5-branch/Source/WebCore/rendering/RenderVideo.cpp 2015-01-16 01:58:16 UTC (rev 178556)
@@ -56,10 +56,8 @@
RenderVideo::~RenderVideo()
{
- if (MediaPlayer* player = videoElement().player()) {
+ if (MediaPlayer* player = videoElement().player())
player->setVisible(false);
- player->setFrameView(0);
- }
}
IntSize RenderVideo::defaultSize()
@@ -233,7 +231,6 @@
contentChanged(VideoChanged);
IntRect videoBounds = videoBox();
- mediaPlayer->setFrameView(&view().frameView());
mediaPlayer->setSize(IntSize(videoBounds.width(), videoBounds.height()));
mediaPlayer->setVisible(true);
mediaPlayer->setShouldMaintainAspectRatio(style().objectFit() != ObjectFitFill);