Drop unused WKPageSetResourceCachingDisabled() SPI
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Oct 2019 18:24:25 +0000 (18:24 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Oct 2019 18:24:25 +0000 (18:24 +0000)
https://bugs.webkit.org/show_bug.cgi?id=203035

Reviewed by Alex Christensen.

Source/WebCore:

* history/PageCache.cpp:
(WebCore::canCachePage):
(WebCore::PageCache::take):
(WebCore::PageCache::get):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerShouldUsePersistentCache const):
* inspector/agents/page/PageNetworkAgent.cpp:
(WebCore::PageNetworkAgent::setResourceCachingDisabled):
* inspector/agents/worker/WorkerNetworkAgent.cpp:
(WebCore::WorkerNetworkAgent::setResourceCachingDisabled):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::subresourceCachePolicy const):
(WebCore::FrameLoader::addExtraFieldsToRequest):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::cachePolicy const):
* page/Page.h:
(WebCore::Page::isResourceCachingDisabledByWebInspector const):
(WebCore::Page::setResourceCachingDisabledByWebInspector):
(WebCore::Page::isResourceCachingDisabled const): Deleted.
(WebCore::Page::setResourceCachingDisabled): Deleted.
(WebCore::Page::setResourceCachingDisabledOverride): Deleted.
* workers/WorkerDebuggerProxy.h:
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::setResourceCachingDisabledByWebInspector):
(WebCore::WorkerMessagingProxy::setResourceCachingDisabled): Deleted.
* workers/WorkerMessagingProxy.h:
* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::ServiceWorkerThreadProxy::setResourceCachingDisabledByWebInspector):
(WebCore::ServiceWorkerThreadProxy::setResourceCachingDisabled): Deleted.
* workers/service/context/ServiceWorkerThreadProxy.h:

Source/WebKit:

* UIProcess/API/C/WKPage.cpp:
(WKPageGetResourceCachingDisabled): Deleted.
(WKPageSetResourceCachingDisabled): Deleted.
* UIProcess/API/C/WKPagePrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setResourceCachingDisabled): Deleted.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::isResourceCachingDisabled const): Deleted.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setResourceCachingDisabled): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251194 268f45cc-cd09-0410-ab3c-d52691b4dbfc

21 files changed:
Source/WebCore/ChangeLog
Source/WebCore/history/PageCache.cpp
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/inspector/agents/page/PageNetworkAgent.cpp
Source/WebCore/inspector/agents/worker/WorkerNetworkAgent.cpp
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/cache/CachedResourceLoader.cpp
Source/WebCore/page/Page.h
Source/WebCore/workers/WorkerDebuggerProxy.h
Source/WebCore/workers/WorkerMessagingProxy.cpp
Source/WebCore/workers/WorkerMessagingProxy.h
Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.cpp
Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.h
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/C/WKPage.cpp
Source/WebKit/UIProcess/API/C/WKPagePrivate.h
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.h
Source/WebKit/WebProcess/WebPage/WebPage.cpp
Source/WebKit/WebProcess/WebPage/WebPage.h
Source/WebKit/WebProcess/WebPage/WebPage.messages.in

index 79be63a..1be2437 100644 (file)
@@ -1,3 +1,41 @@
+2019-10-16  Chris Dumez  <cdumez@apple.com>
+
+        Drop unused WKPageSetResourceCachingDisabled() SPI
+        https://bugs.webkit.org/show_bug.cgi?id=203035
+
+        Reviewed by Alex Christensen.
+
+        * history/PageCache.cpp:
+        (WebCore::canCachePage):
+        (WebCore::PageCache::take):
+        (WebCore::PageCache::get):
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::mediaPlayerShouldUsePersistentCache const):
+        * inspector/agents/page/PageNetworkAgent.cpp:
+        (WebCore::PageNetworkAgent::setResourceCachingDisabled):
+        * inspector/agents/worker/WorkerNetworkAgent.cpp:
+        (WebCore::WorkerNetworkAgent::setResourceCachingDisabled):
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::subresourceCachePolicy const):
+        (WebCore::FrameLoader::addExtraFieldsToRequest):
+        * loader/cache/CachedResourceLoader.cpp:
+        (WebCore::CachedResourceLoader::cachePolicy const):
+        * page/Page.h:
+        (WebCore::Page::isResourceCachingDisabledByWebInspector const):
+        (WebCore::Page::setResourceCachingDisabledByWebInspector):
+        (WebCore::Page::isResourceCachingDisabled const): Deleted.
+        (WebCore::Page::setResourceCachingDisabled): Deleted.
+        (WebCore::Page::setResourceCachingDisabledOverride): Deleted.
+        * workers/WorkerDebuggerProxy.h:
+        * workers/WorkerMessagingProxy.cpp:
+        (WebCore::WorkerMessagingProxy::setResourceCachingDisabledByWebInspector):
+        (WebCore::WorkerMessagingProxy::setResourceCachingDisabled): Deleted.
+        * workers/WorkerMessagingProxy.h:
+        * workers/service/context/ServiceWorkerThreadProxy.cpp:
+        (WebCore::ServiceWorkerThreadProxy::setResourceCachingDisabledByWebInspector):
+        (WebCore::ServiceWorkerThreadProxy::setResourceCachingDisabled): Deleted.
+        * workers/service/context/ServiceWorkerThreadProxy.h:
+
 2019-10-16  Fujii Hironori  <Hironori.Fujii@sony.com>
 
         DumpRenderTree should clear WTFLogChannelState::OnWithAccumulation state set by testRunner.accummulateLogsForChannel
index b264516..cd1f382 100644 (file)
@@ -194,7 +194,7 @@ static bool canCachePage(Page& page)
     DiagnosticLoggingClient& diagnosticLoggingClient = page.diagnosticLoggingClient();
     bool isCacheable = canCacheFrame(page.mainFrame(), diagnosticLoggingClient, indentLevel + 1);
 
-    if (!page.settings().usesPageCache() || page.isResourceCachingDisabled()) {
+    if (!page.settings().usesPageCache() || page.isResourceCachingDisabledByWebInspector()) {
         PCLOG("   -Page settings says b/f cache disabled");
         logPageCacheFailureDiagnosticMessage(diagnosticLoggingClient, DiagnosticLoggingKeys::isDisabledKey());
         isCacheable = false;
@@ -484,7 +484,7 @@ std::unique_ptr<CachedPage> PageCache::take(HistoryItem& item, Page* page)
 
     RELEASE_LOG(BackForwardCache, "PageCache::take item: %s, size: %u / %u", item.identifier().string().utf8().data(), pageCount(), maxSize());
 
-    if (cachedPage->hasExpired() || (page && page->isResourceCachingDisabled())) {
+    if (cachedPage->hasExpired() || (page && page->isResourceCachingDisabledByWebInspector())) {
         LOG(BackForwardCache, "Not restoring page for %s from back/forward cache because cache entry has expired", item.url().string().ascii().data());
         logPageCacheFailureDiagnosticMessage(page, DiagnosticLoggingKeys::expiredKey());
         return nullptr;
@@ -521,7 +521,7 @@ CachedPage* PageCache::get(HistoryItem& item, Page* page)
         return nullptr;
     }
 
-    if (cachedPage->hasExpired() || (page && page->isResourceCachingDisabled())) {
+    if (cachedPage->hasExpired() || (page && page->isResourceCachingDisabledByWebInspector())) {
         LOG(BackForwardCache, "Not restoring page for %s from back/forward cache because cache entry has expired", item.url().string().ascii().data());
         logPageCacheFailureDiagnosticMessage(page, DiagnosticLoggingKeys::expiredKey());
         remove(item);
index 383a416..cfea271 100644 (file)
@@ -7104,7 +7104,7 @@ const MediaResourceLoader* HTMLMediaElement::lastMediaResourceLoaderForTesting()
 bool HTMLMediaElement::mediaPlayerShouldUsePersistentCache() const
 {
     if (Page* page = document().page())
-        return !page->usesEphemeralSession() && !page->isResourceCachingDisabled();
+        return !page->usesEphemeralSession() && !page->isResourceCachingDisabledByWebInspector();
 
     return false;
 }
index 694d16c..714f036 100644 (file)
@@ -97,7 +97,7 @@ Vector<WebSocket*> PageNetworkAgent::activeWebSockets(const LockHolder& lock)
 
 void PageNetworkAgent::setResourceCachingDisabled(bool disabled)
 {
-    m_inspectedPage.setResourceCachingDisabledOverride(disabled);
+    m_inspectedPage.setResourceCachingDisabledByWebInspector(disabled);
 }
 
 ScriptExecutionContext* PageNetworkAgent::scriptExecutionContext(ErrorString& errorString, const String& frameId)
index 68d3cf9..53fa883 100644 (file)
@@ -61,7 +61,7 @@ Vector<WebSocket*> WorkerNetworkAgent::activeWebSockets(const LockHolder&)
 
 void WorkerNetworkAgent::setResourceCachingDisabled(bool disabled)
 {
-    m_workerGlobalScope.thread().workerDebuggerProxy().setResourceCachingDisabled(disabled);
+    m_workerGlobalScope.thread().workerDebuggerProxy().setResourceCachingDisabledByWebInspector(disabled);
 }
 
 ScriptExecutionContext* WorkerNetworkAgent::scriptExecutionContext(ErrorString&, const String&)
index 079727e..c973e17 100644 (file)
@@ -2414,7 +2414,7 @@ FrameLoadType FrameLoader::loadType() const
 CachePolicy FrameLoader::subresourceCachePolicy(const URL& url) const
 {
     if (Page* page = m_frame.page()) {
-        if (page->isResourceCachingDisabled())
+        if (page->isResourceCachingDisabledByWebInspector())
             return CachePolicyReload;
     }
 
@@ -2955,7 +2955,7 @@ void FrameLoader::addExtraFieldsToRequest(ResourceRequest& request, FrameLoadTyp
     Page* page = frame().page();
     bool hasSpecificCachePolicy = request.cachePolicy() != ResourceRequestCachePolicy::UseProtocolCachePolicy;
 
-    if (page && page->isResourceCachingDisabled()) {
+    if (page && page->isResourceCachingDisabledByWebInspector()) {
         request.setCachePolicy(ResourceRequestCachePolicy::ReloadIgnoringCacheData);
         loadType = FrameLoadType::ReloadFromOrigin;
     } else if (!hasSpecificCachePolicy)
index fa3d1c8..78e31f6 100644 (file)
@@ -1350,7 +1350,7 @@ CachePolicy CachedResourceLoader::cachePolicy(CachedResource::Type type, const U
         return frame->loader().subresourceCachePolicy(url);
 
     if (Page* page = frame->page()) {
-        if (page->isResourceCachingDisabled())
+        if (page->isResourceCachingDisabledByWebInspector())
             return CachePolicyReload;
     }
 
index 3c11c60..99a5eeb 100644 (file)
@@ -679,11 +679,8 @@ public:
     String captionUserPreferencesStyleSheet();
     void setCaptionUserPreferencesStyleSheet(const String&);
 
-    bool isResourceCachingDisabled() const { return m_resourceCachingDisabled || m_resourceCachingDisabledOverride; }
-    void setResourceCachingDisabled(bool disabled) { m_resourceCachingDisabled = disabled; }
-
-    // Web Inspector can override whatever value is set via WebKit SPI, but only while it is open.
-    void setResourceCachingDisabledOverride(bool disabled) { m_resourceCachingDisabledOverride = disabled; }
+    bool isResourceCachingDisabledByWebInspector() const { return m_resourceCachingDisabledByWebInspector; }
+    void setResourceCachingDisabledByWebInspector(bool disabled) { m_resourceCachingDisabledByWebInspector = disabled; }
 
     Optional<EventThrottlingBehavior> eventThrottlingBehaviorOverride() const { return m_eventThrottlingBehaviorOverride; }
     void setEventThrottlingBehaviorOverride(Optional<EventThrottlingBehavior> throttling) { m_eventThrottlingBehaviorOverride = throttling; }
@@ -949,8 +946,7 @@ private:
     bool m_allowsPlaybackControlsForAutoplayingAudio { false };
     bool m_showAllPlugins { false };
     bool m_controlledByAutomation { false };
-    bool m_resourceCachingDisabled { false };
-    bool m_resourceCachingDisabledOverride { false };
+    bool m_resourceCachingDisabledByWebInspector { false };
     bool m_isUtilityPage;
     UserInterfaceLayoutDirection m_userInterfaceLayoutDirection { UserInterfaceLayoutDirection::LTR };
     
index b1e118a..459d1c7 100644 (file)
@@ -36,7 +36,7 @@ class WorkerDebuggerProxy {
 public:
     virtual ~WorkerDebuggerProxy() = default;
     virtual void postMessageToDebugger(const String&) = 0;
-    virtual void setResourceCachingDisabled(bool) = 0;
+    virtual void setResourceCachingDisabledByWebInspector(bool) = 0;
 };
 
 } // namespace WebCore
index 59f7960..a77bb7e 100644 (file)
@@ -173,12 +173,12 @@ void WorkerMessagingProxy::postMessageToDebugger(const String& message)
     });
 }
 
-void WorkerMessagingProxy::setResourceCachingDisabled(bool disabled)
+void WorkerMessagingProxy::setResourceCachingDisabledByWebInspector(bool disabled)
 {
     postTaskToLoader([disabled] (ScriptExecutionContext& context) {
         ASSERT(isMainThread());
         if (auto* page = downcast<Document>(context).page())
-            page->setResourceCachingDisabled(disabled);
+            page->setResourceCachingDisabledByWebInspector(disabled);
     });
 }
 
index 8bf7573..ed17fc3 100644 (file)
@@ -69,7 +69,7 @@ private:
     // Implementation of WorkerDebuggerProxy.
     // (Only use these functions in the worker context thread.)
     void postMessageToDebugger(const String&) final;
-    void setResourceCachingDisabled(bool) final;
+    void setResourceCachingDisabledByWebInspector(bool) final;
 
     // Implementation of WorkerLoaderProxy.
     // These functions are called on different threads to schedule loading
index 877948b..57e9321 100644 (file)
@@ -147,11 +147,11 @@ void ServiceWorkerThreadProxy::postMessageToDebugger(const String& message)
     });
 }
 
-void ServiceWorkerThreadProxy::setResourceCachingDisabled(bool disabled)
+void ServiceWorkerThreadProxy::setResourceCachingDisabledByWebInspector(bool disabled)
 {
     postTaskToLoader([this, protectedThis = makeRef(*this), disabled] (ScriptExecutionContext&) {
         ASSERT(isMainThread());
-        m_page->setResourceCachingDisabled(disabled);
+        m_page->setResourceCachingDisabledByWebInspector(disabled);
     });   
 }
 
index 2768ace..e412d53 100644 (file)
@@ -88,7 +88,7 @@ private:
 
     // WorkerDebuggerProxy
     void postMessageToDebugger(const String&) final;
-    void setResourceCachingDisabled(bool) final;
+    void setResourceCachingDisabledByWebInspector(bool) final;
 
     UniqueRef<Page> m_page;
     Ref<Document> m_document;
index 8355b86..c4e45c5 100644 (file)
@@ -1,3 +1,23 @@
+2019-10-16  Chris Dumez  <cdumez@apple.com>
+
+        Drop unused WKPageSetResourceCachingDisabled() SPI
+        https://bugs.webkit.org/show_bug.cgi?id=203035
+
+        Reviewed by Alex Christensen.
+
+        * UIProcess/API/C/WKPage.cpp:
+        (WKPageGetResourceCachingDisabled): Deleted.
+        (WKPageSetResourceCachingDisabled): Deleted.
+        * UIProcess/API/C/WKPagePrivate.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::setResourceCachingDisabled): Deleted.
+        * UIProcess/WebPageProxy.h:
+        (WebKit::WebPageProxy::isResourceCachingDisabled const): Deleted.
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::setResourceCachingDisabled): Deleted.
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/WebPage.messages.in:
+
 2019-10-16  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         Unreviewed, fix the internal macOS 10.13 and 10.14 builds after r251171
index 4141b6b..bb048bb 100644 (file)
@@ -2870,16 +2870,6 @@ void WKPageCallAfterNextPresentationUpdate(WKPageRef pageRef, void* context, WKP
     });
 }
 
-bool WKPageGetResourceCachingDisabled(WKPageRef page)
-{
-    return toImpl(page)->isResourceCachingDisabled();
-}
-
-void WKPageSetResourceCachingDisabled(WKPageRef page, bool disabled)
-{
-    toImpl(page)->setResourceCachingDisabled(disabled);
-}
-
 void WKPageSetIgnoresViewportScaleLimits(WKPageRef page, bool ignoresViewportScaleLimits)
 {
 #if PLATFORM(IOS_FAMILY)
index 3d959ff..ea2360a 100644 (file)
@@ -169,9 +169,6 @@ WK_EXPORT void WKPageLoadURLWithShouldOpenExternalURLsPolicy(WKPageRef page, WKU
 typedef void (*WKPagePostPresentationUpdateFunction)(WKErrorRef, void*);
 WK_EXPORT void WKPageCallAfterNextPresentationUpdate(WKPageRef page, void* context, WKPagePostPresentationUpdateFunction function);
 
-WK_EXPORT bool WKPageGetResourceCachingDisabled(WKPageRef page);
-WK_EXPORT void WKPageSetResourceCachingDisabled(WKPageRef page, bool disabled);
-
 WK_EXPORT void WKPageRestoreFromSessionStateWithoutNavigation(WKPageRef page, WKTypeRef sessionState);
 
 WK_EXPORT void WKPageSetIgnoresViewportScaleLimits(WKPageRef page, bool ignoresViewportScaleLimits);
index 7f89fb9..b372558 100644 (file)
@@ -8685,19 +8685,6 @@ void WebPageProxy::finishedLoadingIcon(CallbackID callbackID, const IPC::DataRef
     dataCallback(data, callbackID);
 }
 
-void WebPageProxy::setResourceCachingDisabled(bool disabled)
-{
-    if (m_isResourceCachingDisabled == disabled)
-        return;
-
-    m_isResourceCachingDisabled = disabled;
-
-    if (!hasRunningProcess())
-        return;
-
-    m_process->send(Messages::WebPage::SetResourceCachingDisabled(disabled), m_webPageID);
-}
-
 WebCore::UserInterfaceLayoutDirection WebPageProxy::userInterfaceLayoutDirection()
 {
     return pageClient().userInterfaceLayoutDirection();
index 0ebf71b..785cc73 100644 (file)
@@ -1430,9 +1430,6 @@ public:
     void getWindowFrame(Messages::WebPageProxy::GetWindowFrame::DelayedReply&&);
     void getWindowFrameWithCallback(Function<void(WebCore::FloatRect)>&&);
 
-    bool isResourceCachingDisabled() const { return m_isResourceCachingDisabled; }
-    void setResourceCachingDisabled(bool);
-
     WebCore::UserInterfaceLayoutDirection userInterfaceLayoutDirection();
     void setUserInterfaceLayoutDirection(WebCore::UserInterfaceLayoutDirection);
 
@@ -2499,8 +2496,6 @@ private:
 
     WebCore::MediaProducer::MediaStateFlags m_mediaState { WebCore::MediaProducer::IsNotPlaying };
 
-    bool m_isResourceCachingDisabled { false };
-
     bool m_hasHadSelectionChangesFromUserInteraction { false };
     bool m_isTouchBarUpdateSupressedForHiddenContentEditable { false };
     bool m_isNeverRichlyEditableForTouchBar { false };
index 98d52b0..15cd623 100644 (file)
@@ -6385,11 +6385,6 @@ void WebPage::didRestoreScrollPosition()
     send(Messages::WebPageProxy::DidRestoreScrollPosition());
 }
 
-void WebPage::setResourceCachingDisabled(bool disabled)
-{
-    m_page->setResourceCachingDisabled(disabled);
-}
-
 void WebPage::setUserInterfaceLayoutDirection(uint32_t direction)
 {
     m_userInterfaceLayoutDirection = static_cast<WebCore::UserInterfaceLayoutDirection>(direction);
index 22b3875..3a1e5f4 100644 (file)
@@ -1580,7 +1580,6 @@ private:
     void didEndRequestInstallMissingMediaPlugins(uint32_t result);
 #endif
 
-    void setResourceCachingDisabled(bool);
     void setUserInterfaceLayoutDirection(uint32_t);
 
     bool canPluginHandleResponse(const WebCore::ResourceResponse&);
index f6c0264..672af6f 100644 (file)
@@ -523,8 +523,6 @@ GenerateSyntheticEditingCommand(enum:uint8_t WebKit::SyntheticEditingCommandType
     DidEndRequestInstallMissingMediaPlugins(uint32_t result)
 #endif
 
-    SetResourceCachingDisabled(bool disabled)
-
     SetUserInterfaceLayoutDirection(uint32_t direction)
 
     DidGetLoadDecisionForIcon(bool decision, WebKit::CallbackID loadIdentifier, WebKit::OptionalCallbackID newCallbackID)