Title: [289910] trunk/Source
- Revision
- 289910
- Author
- achristen...@apple.com
- Date
- 2022-02-16 10:23:26 -0800 (Wed, 16 Feb 2022)
Log Message
Move Safe Browsing knowledge into SafariSafeBrowsing framework
https://bugs.webkit.org/show_bug.cgi?id=231692
Patch by Eliot Hsu <eliot_...@apple.com> on 2022-02-16
Reviewed by Alex Christensen.
Following up on an old FIXME, move Safari Safe Browsing-specific
knowledge out of WebKit and into the SafariSafeBrowsing framework.
This includes things like the Learn More URL, the Report an Error URL,
etc.
Source/WebKit:
* Platform/spi/Cocoa/SafeBrowsingSPI.h:
* UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm:
(WebKit::malwareDetailsBase):
(WebKit::learnMoreURL):
(WebKit::reportAnErrorBase):
(WebKit::localizedProvider):
Rely on new SafariSafeBrowsing calls to provide
URL/provider information about Safe Browsing,
when available
Source/WTF:
* wtf/PlatformHave.h:
Modified Paths
Diff
Modified: trunk/Source/WTF/ChangeLog (289909 => 289910)
--- trunk/Source/WTF/ChangeLog 2022-02-16 18:21:05 UTC (rev 289909)
+++ trunk/Source/WTF/ChangeLog 2022-02-16 18:23:26 UTC (rev 289910)
@@ -1,3 +1,17 @@
+2022-02-16 Eliot Hsu <eliot_...@apple.com>
+
+ Move Safe Browsing knowledge into SafariSafeBrowsing framework
+ https://bugs.webkit.org/show_bug.cgi?id=231692
+
+ Reviewed by Alex Christensen.
+
+ Following up on an old FIXME, move Safari Safe Browsing-specific
+ knowledge out of WebKit and into the SafariSafeBrowsing framework.
+ This includes things like the Learn More URL, the Report an Error URL,
+ etc.
+
+ * wtf/PlatformHave.h:
+
2022-02-16 Philippe Normand <pnorm...@igalia.com>
Add a dedicated ENABLE flag for MediaRecorder
Modified: trunk/Source/WTF/wtf/PlatformHave.h (289909 => 289910)
--- trunk/Source/WTF/wtf/PlatformHave.h 2022-02-16 18:21:05 UTC (rev 289909)
+++ trunk/Source/WTF/wtf/PlatformHave.h 2022-02-16 18:23:26 UTC (rev 289910)
@@ -1195,3 +1195,7 @@
#if ((PLATFORM(IOS) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 150400)
#define HAVE_UIACTIVITYTYPE_SHAREPLAY 1
#endif
+
+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 130000) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 160000) || (PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 90000)
+#define HAVE_SAFE_BROWSING_RESULT_DETAILS 1
+#endif
Modified: trunk/Source/WebKit/ChangeLog (289909 => 289910)
--- trunk/Source/WebKit/ChangeLog 2022-02-16 18:21:05 UTC (rev 289909)
+++ trunk/Source/WebKit/ChangeLog 2022-02-16 18:23:26 UTC (rev 289910)
@@ -1,3 +1,25 @@
+2022-02-16 Eliot Hsu <eliot_...@apple.com>
+
+ Move Safe Browsing knowledge into SafariSafeBrowsing framework
+ https://bugs.webkit.org/show_bug.cgi?id=231692
+
+ Reviewed by Alex Christensen.
+
+ Following up on an old FIXME, move Safari Safe Browsing-specific
+ knowledge out of WebKit and into the SafariSafeBrowsing framework.
+ This includes things like the Learn More URL, the Report an Error URL,
+ etc.
+
+ * Platform/spi/Cocoa/SafeBrowsingSPI.h:
+ * UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm:
+ (WebKit::malwareDetailsBase):
+ (WebKit::learnMoreURL):
+ (WebKit::reportAnErrorBase):
+ (WebKit::localizedProvider):
+ Rely on new SafariSafeBrowsing calls to provide
+ URL/provider information about Safe Browsing,
+ when available
+
2022-02-16 Wenson Hsieh <wenson_hs...@apple.com>
[Cocoa] Clean up some unused context menu identifier SPI constants
Modified: trunk/Source/WebKit/Platform/spi/Cocoa/SafeBrowsingSPI.h (289909 => 289910)
--- trunk/Source/WebKit/Platform/spi/Cocoa/SafeBrowsingSPI.h 2022-02-16 18:21:05 UTC (rev 289909)
+++ trunk/Source/WebKit/Platform/spi/Cocoa/SafeBrowsingSPI.h 2022-02-16 18:23:26 UTC (rev 289910)
@@ -50,6 +50,13 @@
@property (nonatomic, readonly, getter=isMalware) BOOL malware;
@property (nonatomic, readonly, getter=isUnwantedSoftware) BOOL unwantedSoftware;
+#if HAVE(SAFE_BROWSING_RESULT_DETAILS)
+@property (nonatomic, readonly) NSString *malwareDetailsBaseURLString;
+@property (nonatomic, readonly) NSURL *learnMoreURL;
+@property (nonatomic, readonly) NSString *reportAnErrorBaseURLString;
+@property (nonatomic, readonly) NSString *localizedProviderDisplayName;
+#endif
+
@end
@interface SSBLookupResult : NSObject <NSCopying, NSSecureCoding>
Modified: trunk/Source/WebKit/UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm (289909 => 289910)
--- trunk/Source/WebKit/UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm 2022-02-16 18:21:05 UTC (rev 289909)
+++ trunk/Source/WebKit/UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm 2022-02-16 18:23:26 UTC (rev 289910)
@@ -35,34 +35,48 @@
#if HAVE(SAFE_BROWSING)
-// FIXME: These four functions ought to be API calls to the SafariSafeBrowsing framework when such SPI is available.
-// That way WebKit does not need to know about the SafariSafeBrowsing framework's possible providers.
-static const char* malwareDetailsBase(SSBServiceLookupResult *result)
+static String malwareDetailsBase(SSBServiceLookupResult *result)
{
+#if HAVE(SAFE_BROWSING_RESULT_DETAILS)
+ return result.malwareDetailsBaseURLString;
+#else
if ([result.provider isEqualToString:SSBProviderTencent])
return "https://www.urlsec.qq.com/check.html?tpl=safari";
return "https://google.com/safebrowsing/diagnostic?tpl=safari";
+#endif
}
static NSURL *learnMoreURL(SSBServiceLookupResult *result)
{
+#if HAVE(SAFE_BROWSING_RESULT_DETAILS)
+ return result.learnMoreURL;
+#else
if ([result.provider isEqualToString:SSBProviderTencent])
return [NSURL URLWithString:@"https://www.urlsec.qq.com/standard/s1.html?tpl=safari"];
return [NSURL URLWithString:@"https://www.google.com/support/bin/answer.py?answer=106318"];
+#endif
}
-static const char* reportAnErrorBase(SSBServiceLookupResult *result)
+static String reportAnErrorBase(SSBServiceLookupResult *result)
{
+#if HAVE(SAFE_BROWSING_RESULT_DETAILS)
+ return result.reportAnErrorBaseURLString;
+#else
if ([result.provider isEqualToString:SSBProviderTencent])
return "https://www.urlsec.qq.com/complain.html?tpl=safari";
return "https://www.google.com/safebrowsing/report_error/?tpl=safari";
+#endif
}
static String localizedProvider(SSBServiceLookupResult *result)
{
+#if HAVE(SAFE_BROWSING_RESULT_DETAILS)
+ return result.localizedProviderDisplayName;
+#else
if ([result.provider isEqualToString:SSBProviderTencent])
return WEB_UI_NSSTRING(@"Tencent Safe Browsing", "Tencent Safe Browsing");
return WEB_UI_NSSTRING(@"Google Safe Browsing", "Google Safe Browsing");
+#endif
}
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes