Title: [295695] trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
Revision
295695
Author
[email protected]
Date
2022-06-21 15:34:05 -0700 (Tue, 21 Jun 2022)

Log Message

Only support downloading previews in captive portal mode
https://bugs.webkit.org/show_bug.cgi?id=241741
<rdar://92037537>

Reviewed by Brent Fulgham.

* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForResponseShared):
Set policy for previews to download

Canonical link: https://commits.webkit.org/251700@main

Modified Paths

Diff

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (295694 => 295695)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2022-06-21 22:11:33 UTC (rev 295694)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2022-06-21 22:34:05 UTC (rev 295695)
@@ -320,6 +320,10 @@
 #import <WebCore/ScreenCaptureKitSharingSessionManager.h>
 #endif
 
+#if USE(QUICK_LOOK)
+#include <WebCore/PreviewConverter.h>
+#endif
+
 #define MESSAGE_CHECK(process, assertion) MESSAGE_CHECK_BASE(assertion, process->connection())
 #define MESSAGE_CHECK_URL(process, url) MESSAGE_CHECK_BASE(checkURLReceivedFromCurrentOrPreviousWebProcess(process, url), process->connection())
 #define MESSAGE_CHECK_COMPLETION(process, assertion, completion) MESSAGE_CHECK_COMPLETION_BASE(assertion, process->connection(), completion)
@@ -5833,9 +5837,10 @@
 #endif
         ), webPageID);
         });
-        if (process->captivePortalMode() == WebProcessProxy::CaptivePortalMode::Enabled && MIMETypeRegistry::isPDFOrPostScriptMIMEType(navigationResponse->response().mimeType()))
+#if USE(QUICK_LOOK)
+        if (process->captivePortalMode() == WebProcessProxy::CaptivePortalMode::Enabled && (MIMETypeRegistry::isPDFOrPostScriptMIMEType(navigationResponse->response().mimeType()) || PreviewConverter::supportsMIMEType(navigationResponse->response().mimeType())))
             policyAction = PolicyAction::Download;
-        
+#endif
         receivedPolicyDecision(policyAction, navigation.get(), nullptr, WTFMove(navigationResponse), WTFMove(sender));
     }, ShouldExpectSafeBrowsingResult::No, ShouldExpectAppBoundDomainResult::No);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to