Diff
Modified: trunk/Source/WebCore/ChangeLog (197989 => 197990)
--- trunk/Source/WebCore/ChangeLog 2016-03-11 04:25:51 UTC (rev 197989)
+++ trunk/Source/WebCore/ChangeLog 2016-03-11 04:50:10 UTC (rev 197990)
@@ -1,3 +1,24 @@
+2016-03-10 Jeremy Jones <[email protected]>
+
+ Set AVURLAssetUsesNoPersistentCacheKey on AVAsset to match caching policy.
+ https://bugs.webkit.org/show_bug.cgi?id=155117
+ rdar://problem/6802240
+
+ Reviewed by Simon Fraser.
+
+ No new tests because no new functionality was added.
+
+ This will prevent persistent media caches when webkit is using in memory caching.
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::mediaPlayerShouldUsePersistentCache): Added.
+ * html/HTMLMediaElement.h: Declare mediaPlayerShouldUsePersistentCache().
+ * page/ChromeClient.h: Declare mediaPlayerShouldUsePersistentCache().
+ * platform/graphics/MediaPlayer.h:
+ (WebCore::MediaPlayerClient::mediaPlayerShouldUsePersistentCache): Added.
+ * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+ (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Set property on AVAssetOptions.
+
2016-03-10 Jer Noble <[email protected]>
CRASH at WebCore::RenderView::updateVisibleViewportRect
Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (197989 => 197990)
--- trunk/Source/WebCore/html/HTMLMediaElement.cpp 2016-03-11 04:25:51 UTC (rev 197989)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp 2016-03-11 04:50:10 UTC (rev 197990)
@@ -6144,6 +6144,14 @@
return adoptRef(*new MediaResourceLoader(document(), fastGetAttribute(HTMLNames::crossoriginAttr)));
}
+bool HTMLMediaElement::mediaPlayerShouldUsePersistentCache() const
+{
+ if (!document().page())
+ return false;
+
+ return document().page()->chrome().client().mediaShouldUsePersistentCache();
+}
+
bool HTMLMediaElement::mediaPlayerShouldWaitForResponseToAuthenticationChallenge(const AuthenticationChallenge& challenge)
{
Frame* frame = document().frame();
Modified: trunk/Source/WebCore/html/HTMLMediaElement.h (197989 => 197990)
--- trunk/Source/WebCore/html/HTMLMediaElement.h 2016-03-11 04:25:51 UTC (rev 197989)
+++ trunk/Source/WebCore/html/HTMLMediaElement.h 2016-03-11 04:50:10 UTC (rev 197990)
@@ -596,6 +596,7 @@
bool mediaPlayerIsLooping() const override;
CachedResourceLoader* mediaPlayerCachedResourceLoader() override;
RefPtr<PlatformMediaResourceLoader> mediaPlayerCreateResourceLoader() override;
+ bool mediaPlayerShouldUsePersistentCache() const override;
#if PLATFORM(WIN) && USE(AVFOUNDATION)
GraphicsDeviceAdapter* mediaPlayerGraphicsDeviceAdapter(const MediaPlayer*) const override;
Modified: trunk/Source/WebCore/page/ChromeClient.h (197989 => 197990)
--- trunk/Source/WebCore/page/ChromeClient.h 2016-03-11 04:25:51 UTC (rev 197989)
+++ trunk/Source/WebCore/page/ChromeClient.h 2016-03-11 04:50:10 UTC (rev 197990)
@@ -470,6 +470,8 @@
virtual void didInvalidateDocumentMarkerRects() { }
+ virtual bool mediaShouldUsePersistentCache() const { return true; }
+
protected:
virtual ~ChromeClient() { }
};
Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.h (197989 => 197990)
--- trunk/Source/WebCore/platform/graphics/MediaPlayer.h 2016-03-11 04:25:51 UTC (rev 197989)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.h 2016-03-11 04:50:10 UTC (rev 197990)
@@ -235,6 +235,7 @@
virtual CachedResourceLoader* mediaPlayerCachedResourceLoader() { return 0; }
virtual RefPtr<PlatformMediaResourceLoader> mediaPlayerCreateResourceLoader() { return nullptr; }
virtual bool doesHaveAttribute(const AtomicString&, AtomicString* = 0) const { return false; }
+ virtual bool mediaPlayerShouldUsePersistentCache() const { return true; }
#if ENABLE(VIDEO_TRACK)
virtual void mediaPlayerDidAddAudioTrack(PassRefPtr<AudioTrackPrivate>) { }
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (197989 => 197990)
--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2016-03-11 04:25:51 UTC (rev 197989)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm 2016-03-11 04:50:10 UTC (rev 197990)
@@ -229,6 +229,7 @@
#if ENABLE(AVF_CAPTIONS)
SOFT_LINK_POINTER(AVFoundation, AVURLAssetHTTPCookiesKey, NSString*)
SOFT_LINK_POINTER(AVFoundation, AVURLAssetOutOfBandAlternateTracksKey, NSString*)
+SOFT_LINK_POINTER(AVFoundation, AVURLAssetUsesNoPersistentCacheKey, NSString*)
SOFT_LINK_POINTER(AVFoundation, AVOutOfBandAlternateTrackDisplayNameKey, NSString*)
SOFT_LINK_POINTER(AVFoundation, AVOutOfBandAlternateTrackExtendedLanguageTagKey, NSString*)
SOFT_LINK_POINTER(AVFoundation, AVOutOfBandAlternateTrackIsDefaultKey, NSString*)
@@ -241,6 +242,7 @@
#define AVURLAssetHTTPCookiesKey getAVURLAssetHTTPCookiesKey()
#define AVURLAssetOutOfBandAlternateTracksKey getAVURLAssetOutOfBandAlternateTracksKey()
+#define AVURLAssetUsesNoPersistentCacheKey getAVURLAssetUsesNoPersistentCacheKey()
#define AVOutOfBandAlternateTrackDisplayNameKey getAVOutOfBandAlternateTrackDisplayNameKey()
#define AVOutOfBandAlternateTrackExtendedLanguageTagKey getAVOutOfBandAlternateTrackExtendedLanguageTagKey()
#define AVOutOfBandAlternateTrackIsDefaultKey getAVOutOfBandAlternateTrackIsDefaultKey()
@@ -872,6 +874,8 @@
}
#endif
+ [options setObject:[NSNumber numberWithBool:!player()->client().mediaPlayerShouldUsePersistentCache()] forKey:AVURLAssetUsesNoPersistentCacheKey];
+
NSURL *cocoaURL = canonicalURL(url);
m_avAsset = adoptNS([allocAVURLAssetInstance() initWithURL:cocoaURL options:options.get()]);
Modified: trunk/Source/WebKit/mac/ChangeLog (197989 => 197990)
--- trunk/Source/WebKit/mac/ChangeLog 2016-03-11 04:25:51 UTC (rev 197989)
+++ trunk/Source/WebKit/mac/ChangeLog 2016-03-11 04:50:10 UTC (rev 197990)
@@ -1,3 +1,17 @@
+2016-03-10 Jeremy Jones <[email protected]>
+
+ Set AVURLAssetUsesNoPersistentCacheKey on AVAsset to match caching policy.
+ https://bugs.webkit.org/show_bug.cgi?id=155117
+ rdar://problem/6802240
+
+ Reviewed by Simon Fraser.
+
+ Implement mediaShouldUsePersistentCache to disable media caching when NSURLCache is disabled.
+
+ * WebCoreSupport/WebChromeClient.h:
+ * WebCoreSupport/WebChromeClient.mm:
+ (WebChromeClient::mediaShouldUsePersistentCache): Added.
+
2016-03-10 Simon Fraser <[email protected]>
Font antialiasing (smoothing) changes when elements are rendered into compositing layers
Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h (197989 => 197990)
--- trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h 2016-03-11 04:25:51 UTC (rev 197989)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h 2016-03-11 04:50:10 UTC (rev 197990)
@@ -218,6 +218,8 @@
void setMockMediaPlaybackTargetPickerEnabled(bool) override;
void setMockMediaPlaybackTargetPickerState(const String&, WebCore::MediaPlaybackTargetContext::State) override;
#endif
+
+ bool mediaShouldUsePersistentCache() const override;
private:
WebView *m_webView;
Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm (197989 => 197990)
--- trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm 2016-03-11 04:25:51 UTC (rev 197989)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm 2016-03-11 04:50:10 UTC (rev 197990)
@@ -1053,3 +1053,8 @@
}
#endif
+
+bool WebChromeClient::mediaShouldUsePersistentCache() const
+{
+ return [[NSURLCache sharedURLCache] diskCapacity] > 0;
+}
Modified: trunk/Source/WebKit2/ChangeLog (197989 => 197990)
--- trunk/Source/WebKit2/ChangeLog 2016-03-11 04:25:51 UTC (rev 197989)
+++ trunk/Source/WebKit2/ChangeLog 2016-03-11 04:50:10 UTC (rev 197990)
@@ -1,3 +1,28 @@
+2016-03-10 Jeremy Jones <[email protected]>
+
+ Set AVURLAssetUsesNoPersistentCacheKey on AVAsset to match caching policy.
+ https://bugs.webkit.org/show_bug.cgi?id=155117
+ rdar://problem/6802240
+
+ Reviewed by Simon Fraser.
+
+ Make AVAsset AVURLAssetUsesNoPersistentCacheKey match !m_websiteDataStore->isPersistent()
+ This will prevent persistent media caches when webkit is using in-memory caching.
+
+ * Shared/WebPageCreationParameters.cpp: Add mediaShouldUsePersistentCache.
+ (WebKit::WebPageCreationParameters::encode):
+ (WebKit::WebPageCreationParameters::decode):
+ * Shared/WebPageCreationParameters.h:
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::creationParameters): Add mediaShouldUsePersistentCache.
+ * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+ (WebKit::WebChromeClient::mediaShouldUsePersistentCache): Added.
+ * WebProcess/WebCoreSupport/WebChromeClient.h:
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::m_mediaUsesPersistentCache): Added.
+ * WebProcess/WebPage/WebPage.h:
+ (WebKit::WebPage::mediaShouldUsePersistentCache): Added.
+
2016-03-10 Nan Wang <[email protected]>
AX: Force allow user zoom
Modified: trunk/Source/WebKit2/Shared/WebPageCreationParameters.cpp (197989 => 197990)
--- trunk/Source/WebKit2/Shared/WebPageCreationParameters.cpp 2016-03-11 04:25:51 UTC (rev 197989)
+++ trunk/Source/WebKit2/Shared/WebPageCreationParameters.cpp 2016-03-11 04:50:10 UTC (rev 197990)
@@ -55,6 +55,7 @@
encoder << userContentControllerID;
encoder << visitedLinkTableID;
encoder << websiteDataStoreID;
+ encoder << mediaShouldUsePersistentCache;
encoder << canRunBeforeUnloadConfirmPanel;
encoder << canRunModal;
encoder << deviceScaleFactor;
@@ -134,6 +135,8 @@
return false;
if (!decoder.decode(parameters.websiteDataStoreID))
return false;
+ if (!decoder.decode(parameters.mediaShouldUsePersistentCache))
+ return false;
if (!decoder.decode(parameters.canRunBeforeUnloadConfirmPanel))
return false;
if (!decoder.decode(parameters.canRunModal))
Modified: trunk/Source/WebKit2/Shared/WebPageCreationParameters.h (197989 => 197990)
--- trunk/Source/WebKit2/Shared/WebPageCreationParameters.h 2016-03-11 04:25:51 UTC (rev 197989)
+++ trunk/Source/WebKit2/Shared/WebPageCreationParameters.h 2016-03-11 04:50:10 UTC (rev 197990)
@@ -89,6 +89,7 @@
uint64_t userContentControllerID;
uint64_t visitedLinkTableID;
uint64_t websiteDataStoreID;
+ bool mediaShouldUsePersistentCache;
bool canRunBeforeUnloadConfirmPanel;
bool canRunModal;
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (197989 => 197990)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2016-03-11 04:25:51 UTC (rev 197989)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2016-03-11 04:50:10 UTC (rev 197990)
@@ -5167,6 +5167,7 @@
parameters.userContentControllerID = m_userContentController->identifier();
parameters.visitedLinkTableID = m_visitedLinkStore->identifier();
parameters.websiteDataStoreID = m_websiteDataStore->identifier();
+ parameters.mediaShouldUsePersistentCache = m_websiteDataStore->isPersistent();
parameters.canRunBeforeUnloadConfirmPanel = m_uiClient->canRunBeforeUnloadConfirmPanel();
parameters.canRunModal = m_canRunModal;
parameters.deviceScaleFactor = deviceScaleFactor();
Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp (197989 => 197990)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp 2016-03-11 04:25:51 UTC (rev 197989)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp 2016-03-11 04:50:10 UTC (rev 197990)
@@ -1146,5 +1146,10 @@
{
m_page->findController().didInvalidateDocumentMarkerRects();
}
+
+bool WebChromeClient::mediaShouldUsePersistentCache() const
+{
+ return m_page->mediaShouldUsePersistentCache();
+}
} // namespace WebKit
Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h (197989 => 197990)
--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h 2016-03-11 04:25:51 UTC (rev 197989)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h 2016-03-11 04:50:10 UTC (rev 197990)
@@ -335,6 +335,7 @@
#endif
void didInvalidateDocumentMarkerRects() override;
+ bool mediaShouldUsePersistentCache() const override;
String m_cachedToolTip;
mutable RefPtr<WebFrame> m_cachedFrameSetLargestFrame;
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (197989 => 197990)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2016-03-11 04:25:51 UTC (rev 197989)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2016-03-11 04:50:10 UTC (rev 197990)
@@ -365,6 +365,7 @@
#endif
, m_mainFrameProgressCompleted(false)
, m_shouldDispatchFakeMouseMoveEvents(true)
+ , m_mediaShouldUsePersistentCache(parameters.mediaShouldUsePersistentCache)
{
ASSERT(m_pageID);
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (197989 => 197990)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2016-03-11 04:25:51 UTC (rev 197989)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2016-03-11 04:50:10 UTC (rev 197990)
@@ -931,6 +931,8 @@
void didRestoreScrollPosition();
+ bool mediaShouldUsePersistentCache() const { return m_mediaShouldUsePersistentCache; }
+
bool isControlledByAutomation() const;
void setControlledByAutomation(bool);
@@ -1453,6 +1455,8 @@
#if USE(OS_STATE)
std::chrono::system_clock::time_point m_loadCommitTime;
#endif
+
+ bool m_mediaShouldUsePersistentCache;
};
} // namespace WebKit