Diff
Modified: branches/safari-611.1.4-branch/Source/WebCore/ChangeLog (269199 => 269200)
--- branches/safari-611.1.4-branch/Source/WebCore/ChangeLog 2020-10-30 17:42:43 UTC (rev 269199)
+++ branches/safari-611.1.4-branch/Source/WebCore/ChangeLog 2020-10-30 17:42:47 UTC (rev 269200)
@@ -1,5 +1,98 @@
2020-10-29 Alan Coon <alanc...@apple.com>
+ Cherry-pick r269173. rdar://problem/70831161
+
+ [Cocoa] Remove soft linking of NetworkExtension.framework
+ https://bugs.webkit.org/show_bug.cgi?id=218314
+ <rdar://problem/70785239>
+
+ Reviewed by Andy Estes.
+
+ Source/WebCore:
+
+ WebCore should link NetworkExtension.framework normally, to avoid the
+ runtime cost associated with soft linking.
+
+ * Configurations/WebCore.xcconfig:
+
+ On macOS, weak link the framework since NetworkExtension.framework is
+ not available on the Base System.
+
+ * platform/cocoa/NetworkExtensionContentFilter.h:
+
+ Added the isRequired static method to avoid soft linking
+ NetworkExtension.framework in WebKit.
+
+ * platform/cocoa/NetworkExtensionContentFilter.mm:
+
+ Only compile this file in the ENABLE(CONTENT_FILTERING) build, as its
+ functionality is unavailable on tvOS.
+
+ (WebCore::NetworkExtensionContentFilter::enabled):
+ (WebCore::NetworkExtensionContentFilter::initialize):
+ (WebCore::NetworkExtensionContentFilter::unblockHandler const):
+ (WebCore::NetworkExtensionContentFilter::isRequired):
+
+ Source/WebKit:
+
+ * UIProcess/Cocoa/WebPageProxyCocoa.mm:
+ (WebKit::WebPageProxy::addPlatformLoadParameters):
+
+ Replaced the soft linked method call with a new method exported from
+ WebCore.
+
+ * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
+ (WebKit::WebPage::platformDidReceiveLoadParameters):
+
+ Tools:
+
+ Updated a test to reflect that NetworkExtension.framework is no longer
+ loaded at runtime. This test was failing on Catalina after r269109,
+ as the Contacts framework was loading NetworkExtension.
+
+ * TestWebKitAPI/Tests/WebKitCocoa/ContentFiltering.h:
+ * TestWebKitAPI/Tests/WebKitCocoa/ContentFiltering.mm:
+ (-[LazilyLoadPlatformFrameworksController expectParentalControlsLoaded:]):
+ (TEST):
+ * TestWebKitAPI/Tests/WebKitCocoa/ContentFilteringPlugIn.mm:
+ (-[ContentFilteringPlugIn checkIfPlatformFrameworksAreLoaded:]):
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269173 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2020-10-29 Aditya Keerthi <akeer...@apple.com>
+
+ [Cocoa] Remove soft linking of NetworkExtension.framework
+ https://bugs.webkit.org/show_bug.cgi?id=218314
+ <rdar://problem/70785239>
+
+ Reviewed by Andy Estes.
+
+ WebCore should link NetworkExtension.framework normally, to avoid the
+ runtime cost associated with soft linking.
+
+ * Configurations/WebCore.xcconfig:
+
+ On macOS, weak link the framework since NetworkExtension.framework is
+ not available on the Base System.
+
+ * platform/cocoa/NetworkExtensionContentFilter.h:
+
+ Added the isRequired static method to avoid soft linking
+ NetworkExtension.framework in WebKit.
+
+ * platform/cocoa/NetworkExtensionContentFilter.mm:
+
+ Only compile this file in the ENABLE(CONTENT_FILTERING) build, as its
+ functionality is unavailable on tvOS.
+
+ (WebCore::NetworkExtensionContentFilter::enabled):
+ (WebCore::NetworkExtensionContentFilter::initialize):
+ (WebCore::NetworkExtensionContentFilter::unblockHandler const):
+ (WebCore::NetworkExtensionContentFilter::isRequired):
+
+2020-10-29 Alan Coon <alanc...@apple.com>
+
Cherry-pick r269160. rdar://problem/70831130
Unreviewed, reverting r268192.
Modified: branches/safari-611.1.4-branch/Source/WebCore/Configurations/WebCore.xcconfig (269199 => 269200)
--- branches/safari-611.1.4-branch/Source/WebCore/Configurations/WebCore.xcconfig 2020-10-30 17:42:43 UTC (rev 269199)
+++ branches/safari-611.1.4-branch/Source/WebCore/Configurations/WebCore.xcconfig 2020-10-30 17:42:47 UTC (rev 269200)
@@ -105,6 +105,14 @@
WK_MOBILE_GESTALT_LDFLAGS = $(WK_MOBILE_GESTALT_LDFLAGS_$(WK_COCOA_TOUCH));
WK_MOBILE_GESTALT_LDFLAGS_cocoatouch = -lMobileGestalt;
+WK_NETWORK_EXTENSION_LD_FLAGS = $(WK_NETWORK_EXTENSION_LD_FLAGS_$(WK_PLATFORM_NAME));
+WK_NETWORK_EXTENSION_LD_FLAGS_iphoneos = -framework NetworkExtension;
+WK_NETWORK_EXTENSION_LD_FLAGS_iphonesimulator = -framework NetworkExtension;
+WK_NETWORK_EXTENSION_LD_FLAGS_watchos = -framework NetworkExtension;
+WK_NETWORK_EXTENSION_LD_FLAGS_watchsimulator = -framework NetworkExtension;
+WK_NETWORK_EXTENSION_LD_FLAGS_maccatalyst = -framework NetworkExtension;
+WK_NETWORK_EXTENSION_LD_FLAGS_macosx = -weak_framework NetworkExtension;
+
WK_SYSTEM_CONFIGURATION_LDFLAGS = $(WK_SYSTEM_CONFIGURATION_LDFLAGS_$(WK_PLATFORM_NAME));
WK_SYSTEM_CONFIGURATION_LDFLAGS_macosx = -framework SystemConfiguration;
@@ -114,7 +122,7 @@
WK_URL_FORMATTING_LDFLAGS_YES = -framework URLFormatting;
// FIXME: Reduce the number of allowable_clients <rdar://problem/31823969>
-OTHER_LDFLAGS = $(inherited) $(WK_RELOCATABLE_FRAMEWORK_LDFLAGS) -lsqlite3 -lobjc -lANGLE -allowable_client WebCoreTestSupport -allowable_client WebKitLegacy -force_load $(BUILT_PRODUCTS_DIR)/libPAL.a -framework CFNetwork -framework CoreAudio -framework CoreGraphics -framework CoreText -framework Foundation -framework IOSurface -framework ImageIO -framework Metal $(OTHER_LDFLAGS_PLATFORM_$(WK_COCOA_TOUCH)) $(OTHER_LDFLAGS_PLATFORM_$(WK_PLATFORM_NAME)) $(WK_APPKIT_LDFLAGS) $(WK_APPSUPPORT_LDFLAGS) $(WK_AUDIO_UNIT_LDFLAGS) $(WK_CARBON_LDFLAGS) $(WK_CORE_UI_LDFLAGS) $(WK_DATA_DETECTORS_CORE_LDFLAGS) $(WK_GRAPHICS_SERVICES_LDFLAGS) $(WK_IOSURFACE_ACCELERATOR_LDFLAGS) $(WK_LIBWEBRTC_LDFLAGS) $(WK_MOBILE_CORE_SERVICES_LDFLAGS) $(WK_MOBILE_GESTALT_LDFLAGS) $(WK_SYSTEM_CONFIGURATION_LDFLAGS) $(WK_CORE_IMAGE_LDFLAGS) $(WK_URL_FORMATTING_LDFLAGS);
+OTHER_LDFLAGS = $(inherited) $(WK_RELOCATABLE_FRAMEWORK_LDFLAGS) -lsqlite3 -lobjc -lANGLE -allowable_client WebCoreTestSupport -allowable_client WebKitLegacy -force_load $(BUILT_PRODUCTS_DIR)/libPAL.a -framework CFNetwork -framework CoreAudio -framework CoreGraphics -framework CoreText -framework Foundation -framework IOSurface -framework ImageIO -framework Metal $(OTHER_LDFLAGS_PLATFORM_$(WK_COCOA_TOUCH)) $(OTHER_LDFLAGS_PLATFORM_$(WK_PLATFORM_NAME)) $(WK_APPKIT_LDFLAGS) $(WK_APPSUPPORT_LDFLAGS) $(WK_AUDIO_UNIT_LDFLAGS) $(WK_CARBON_LDFLAGS) $(WK_CORE_UI_LDFLAGS) $(WK_DATA_DETECTORS_CORE_LDFLAGS) $(WK_GRAPHICS_SERVICES_LDFLAGS) $(WK_IOSURFACE_ACCELERATOR_LDFLAGS) $(WK_LIBWEBRTC_LDFLAGS) $(WK_MOBILE_CORE_SERVICES_LDFLAGS) $(WK_MOBILE_GESTALT_LDFLAGS) $(WK_NETWORK_EXTENSION_LD_FLAGS) $(WK_SYSTEM_CONFIGURATION_LDFLAGS) $(WK_CORE_IMAGE_LDFLAGS) $(WK_URL_FORMATTING_LDFLAGS);
OTHER_LDFLAGS_PLATFORM_cocoatouch = -allowable_client WebKit -allowable_client iTunesU -allowable_client Casablanca -allowable_client Remote -allowable_client TVBooks -allowable_client DumpRenderTree -allowable_client WebKitTestRunner -allowable_client TestWebKitAPI;
OTHER_LDFLAGS_PLATFORM_macosx = -sub_library libobjc -umbrella WebKit;
Modified: branches/safari-611.1.4-branch/Source/WebCore/platform/cocoa/NetworkExtensionContentFilter.h (269199 => 269200)
--- branches/safari-611.1.4-branch/Source/WebCore/platform/cocoa/NetworkExtensionContentFilter.h 2020-10-30 17:42:43 UTC (rev 269199)
+++ branches/safari-611.1.4-branch/Source/WebCore/platform/cocoa/NetworkExtensionContentFilter.h 2020-10-30 17:42:47 UTC (rev 269200)
@@ -25,6 +25,8 @@
#pragma once
+#if ENABLE(CONTENT_FILTERING)
+
#include "PlatformContentFilter.h"
#include <objc/NSObjCRuntime.h>
#include <wtf/Compiler.h>
@@ -50,10 +52,9 @@
void addData(const char* data, int length) override;
void finishedAddingData() override;
Ref<SharedBuffer> replacementData() const override;
-#if ENABLE(CONTENT_FILTERING)
ContentFilterUnblockHandler unblockHandler() const override;
-#endif
+ WEBCORE_EXPORT static bool isRequired();
WEBCORE_EXPORT static void setHasConsumedSandboxExtensions(bool);
private:
@@ -77,3 +78,5 @@
};
} // namespace WebCore
+
+#endif // ENABLE(CONTENT_FILTERING)
Modified: branches/safari-611.1.4-branch/Source/WebCore/platform/cocoa/NetworkExtensionContentFilter.mm (269199 => 269200)
--- branches/safari-611.1.4-branch/Source/WebCore/platform/cocoa/NetworkExtensionContentFilter.mm 2020-10-30 17:42:43 UTC (rev 269199)
+++ branches/safari-611.1.4-branch/Source/WebCore/platform/cocoa/NetworkExtensionContentFilter.mm 2020-10-30 17:42:47 UTC (rev 269200)
@@ -26,6 +26,8 @@
#import "config.h"
#import "NetworkExtensionContentFilter.h"
+#if ENABLE(CONTENT_FILTERING)
+
#import "ContentFilterUnblockHandler.h"
#import "Logging.h"
#import "ResourceRequest.h"
@@ -38,9 +40,6 @@
#import <wtf/URL.h>
#import <wtf/threads/BinarySemaphore.h>
-SOFT_LINK_FRAMEWORK_OPTIONAL(NetworkExtension);
-SOFT_LINK_CLASS_OPTIONAL(NetworkExtension, NEFilterSource);
-
static inline NSData *replacementDataFromDecisionInfo(NSDictionary *decisionInfo)
{
ASSERT_WITH_SECURITY_IMPLICATION(!decisionInfo || [decisionInfo isKindOfClass:[NSDictionary class]]);
@@ -62,7 +61,7 @@
enabled = false;
break;
case SandboxExtensionsState::NotSet:
- enabled = [getNEFilterSourceClass() filterRequired];
+ enabled = isRequired();
break;
}
LOG(ContentFiltering, "NetworkExtensionContentFilter is %s.\n", enabled ? "enabled" : "not enabled");
@@ -80,7 +79,7 @@
ASSERT(!m_neFilterSource);
m_queue = adoptOSObject(dispatch_queue_create("WebKit NetworkExtension Filtering", DISPATCH_QUEUE_SERIAL));
ASSERT_UNUSED(url, !url);
- m_neFilterSource = adoptNS([allocNEFilterSourceInstance() initWithDecisionQueue:m_queue.get()]);
+ m_neFilterSource = adoptNS([[NEFilterSource alloc] initWithDecisionQueue:m_queue.get()]);
[m_neFilterSource setSourceAppIdentifier:applicationBundleIdentifier()];
[m_neFilterSource setSourceAppPid:presentingApplicationPID()];
}
@@ -182,7 +181,6 @@
return SharedBuffer::create(m_replacementData.get());
}
-#if ENABLE(CONTENT_FILTERING)
ContentFilterUnblockHandler NetworkExtensionContentFilter::unblockHandler() const
{
using DecisionHandlerFunction = ContentFilterUnblockHandler::DecisionHandlerFunction;
@@ -197,7 +195,6 @@
}
};
}
-#endif
void NetworkExtensionContentFilter::handleDecision(NEFilterSourceStatus status, NSData *replacementData)
{
@@ -226,6 +223,11 @@
#endif
}
+bool NetworkExtensionContentFilter::isRequired()
+{
+ return [NEFilterSource filterRequired];
+}
+
void NetworkExtensionContentFilter::setHasConsumedSandboxExtensions(bool hasConsumedSandboxExtensions)
{
if (m_sandboxExtensionsState == SandboxExtensionsState::Consumed)
@@ -235,3 +237,5 @@
}
} // namespace WebCore
+
+#endif // ENABLE(CONTENT_FILTERING)
Modified: branches/safari-611.1.4-branch/Source/WebKit/ChangeLog (269199 => 269200)
--- branches/safari-611.1.4-branch/Source/WebKit/ChangeLog 2020-10-30 17:42:43 UTC (rev 269199)
+++ branches/safari-611.1.4-branch/Source/WebKit/ChangeLog 2020-10-30 17:42:47 UTC (rev 269200)
@@ -1,5 +1,84 @@
2020-10-29 Alan Coon <alanc...@apple.com>
+ Cherry-pick r269173. rdar://problem/70831161
+
+ [Cocoa] Remove soft linking of NetworkExtension.framework
+ https://bugs.webkit.org/show_bug.cgi?id=218314
+ <rdar://problem/70785239>
+
+ Reviewed by Andy Estes.
+
+ Source/WebCore:
+
+ WebCore should link NetworkExtension.framework normally, to avoid the
+ runtime cost associated with soft linking.
+
+ * Configurations/WebCore.xcconfig:
+
+ On macOS, weak link the framework since NetworkExtension.framework is
+ not available on the Base System.
+
+ * platform/cocoa/NetworkExtensionContentFilter.h:
+
+ Added the isRequired static method to avoid soft linking
+ NetworkExtension.framework in WebKit.
+
+ * platform/cocoa/NetworkExtensionContentFilter.mm:
+
+ Only compile this file in the ENABLE(CONTENT_FILTERING) build, as its
+ functionality is unavailable on tvOS.
+
+ (WebCore::NetworkExtensionContentFilter::enabled):
+ (WebCore::NetworkExtensionContentFilter::initialize):
+ (WebCore::NetworkExtensionContentFilter::unblockHandler const):
+ (WebCore::NetworkExtensionContentFilter::isRequired):
+
+ Source/WebKit:
+
+ * UIProcess/Cocoa/WebPageProxyCocoa.mm:
+ (WebKit::WebPageProxy::addPlatformLoadParameters):
+
+ Replaced the soft linked method call with a new method exported from
+ WebCore.
+
+ * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
+ (WebKit::WebPage::platformDidReceiveLoadParameters):
+
+ Tools:
+
+ Updated a test to reflect that NetworkExtension.framework is no longer
+ loaded at runtime. This test was failing on Catalina after r269109,
+ as the Contacts framework was loading NetworkExtension.
+
+ * TestWebKitAPI/Tests/WebKitCocoa/ContentFiltering.h:
+ * TestWebKitAPI/Tests/WebKitCocoa/ContentFiltering.mm:
+ (-[LazilyLoadPlatformFrameworksController expectParentalControlsLoaded:]):
+ (TEST):
+ * TestWebKitAPI/Tests/WebKitCocoa/ContentFilteringPlugIn.mm:
+ (-[ContentFilteringPlugIn checkIfPlatformFrameworksAreLoaded:]):
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269173 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2020-10-29 Aditya Keerthi <akeer...@apple.com>
+
+ [Cocoa] Remove soft linking of NetworkExtension.framework
+ https://bugs.webkit.org/show_bug.cgi?id=218314
+ <rdar://problem/70785239>
+
+ Reviewed by Andy Estes.
+
+ * UIProcess/Cocoa/WebPageProxyCocoa.mm:
+ (WebKit::WebPageProxy::addPlatformLoadParameters):
+
+ Replaced the soft linked method call with a new method exported from
+ WebCore.
+
+ * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
+ (WebKit::WebPage::platformDidReceiveLoadParameters):
+
+2020-10-29 Alan Coon <alanc...@apple.com>
+
Cherry-pick r269082. rdar://problem/70831193
Adopt the UIPointerInteraction API
Modified: branches/safari-611.1.4-branch/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm (269199 => 269200)
--- branches/safari-611.1.4-branch/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm 2020-10-30 17:42:43 UTC (rev 269199)
+++ branches/safari-611.1.4-branch/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm 2020-10-30 17:42:47 UTC (rev 269200)
@@ -46,12 +46,12 @@
#import <WebCore/DragItem.h>
#import <WebCore/GeometryUtilities.h>
#import <WebCore/LocalCurrentGraphicsContext.h>
+#import <WebCore/NetworkExtensionContentFilter.h>
#import <WebCore/NotImplemented.h>
#import <WebCore/RunLoopObserver.h>
#import <WebCore/SearchPopupMenuCocoa.h>
#import <WebCore/TextAlternativeWithRange.h>
#import <WebCore/ValidationBubble.h>
-#import <pal/spi/cocoa/NEFilterSourceSPI.h>
#import <pal/spi/cocoa/QuartzCoreSPI.h>
#import <wtf/BlockPtr.h>
#import <wtf/SoftLinking.h>
@@ -74,9 +74,6 @@
SOFT_LINK_CLASS(WebContentAnalysis, WebFilterEvaluator);
#endif
-SOFT_LINK_FRAMEWORK_OPTIONAL(NetworkExtension);
-SOFT_LINK_CLASS_OPTIONAL(NetworkExtension, NEFilterSource);
-
#define MESSAGE_CHECK(assertion) MESSAGE_CHECK_BASE(assertion, process().connection())
#define MESSAGE_CHECK_COMPLETION(assertion, completion) MESSAGE_CHECK_COMPLETION_BASE(assertion, process().connection(), completion)
@@ -156,7 +153,8 @@
{
loadParameters.dataDetectionContext = m_uiClient->dataDetectionContext();
- if (!process.hasNetworkExtensionSandboxAccess() && [getNEFilterSourceClass() filterRequired]) {
+#if ENABLE(CONTENT_FILTERING)
+ if (!process.hasNetworkExtensionSandboxAccess() && NetworkExtensionContentFilter::isRequired()) {
SandboxExtension::Handle helperHandle;
SandboxExtension::createHandleForMachLookup("com.apple.nehelper"_s, WTF::nullopt, helperHandle);
loadParameters.neHelperExtensionHandle = WTFMove(helperHandle);
@@ -170,6 +168,7 @@
process.markHasNetworkExtensionSandboxAccess();
}
+#endif
#if PLATFORM(IOS)
if (!process.hasManagedSessionSandboxAccess() && [getWebFilterEvaluatorClass() isManagedSession]) {
Modified: branches/safari-611.1.4-branch/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm (269199 => 269200)
--- branches/safari-611.1.4-branch/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm 2020-10-30 17:42:43 UTC (rev 269199)
+++ branches/safari-611.1.4-branch/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm 2020-10-30 17:42:47 UTC (rev 269200)
@@ -81,11 +81,13 @@
m_dataDetectionContext = parameters.dataDetectionContext;
+#if ENABLE(CONTENT_FILTERING)
if (parameters.neHelperExtensionHandle)
SandboxExtension::consumePermanently(*parameters.neHelperExtensionHandle);
if (parameters.neSessionManagerExtensionHandle)
SandboxExtension::consumePermanently(*parameters.neSessionManagerExtensionHandle);
NetworkExtensionContentFilter::setHasConsumedSandboxExtensions(parameters.neHelperExtensionHandle.hasValue() && parameters.neSessionManagerExtensionHandle.hasValue());
+#endif
#if PLATFORM(IOS)
if (parameters.contentFilterExtensionHandle)
Modified: branches/safari-611.1.4-branch/Tools/ChangeLog (269199 => 269200)
--- branches/safari-611.1.4-branch/Tools/ChangeLog 2020-10-30 17:42:43 UTC (rev 269199)
+++ branches/safari-611.1.4-branch/Tools/ChangeLog 2020-10-30 17:42:47 UTC (rev 269200)
@@ -1,5 +1,86 @@
2020-10-29 Alan Coon <alanc...@apple.com>
+ Cherry-pick r269173. rdar://problem/70831161
+
+ [Cocoa] Remove soft linking of NetworkExtension.framework
+ https://bugs.webkit.org/show_bug.cgi?id=218314
+ <rdar://problem/70785239>
+
+ Reviewed by Andy Estes.
+
+ Source/WebCore:
+
+ WebCore should link NetworkExtension.framework normally, to avoid the
+ runtime cost associated with soft linking.
+
+ * Configurations/WebCore.xcconfig:
+
+ On macOS, weak link the framework since NetworkExtension.framework is
+ not available on the Base System.
+
+ * platform/cocoa/NetworkExtensionContentFilter.h:
+
+ Added the isRequired static method to avoid soft linking
+ NetworkExtension.framework in WebKit.
+
+ * platform/cocoa/NetworkExtensionContentFilter.mm:
+
+ Only compile this file in the ENABLE(CONTENT_FILTERING) build, as its
+ functionality is unavailable on tvOS.
+
+ (WebCore::NetworkExtensionContentFilter::enabled):
+ (WebCore::NetworkExtensionContentFilter::initialize):
+ (WebCore::NetworkExtensionContentFilter::unblockHandler const):
+ (WebCore::NetworkExtensionContentFilter::isRequired):
+
+ Source/WebKit:
+
+ * UIProcess/Cocoa/WebPageProxyCocoa.mm:
+ (WebKit::WebPageProxy::addPlatformLoadParameters):
+
+ Replaced the soft linked method call with a new method exported from
+ WebCore.
+
+ * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
+ (WebKit::WebPage::platformDidReceiveLoadParameters):
+
+ Tools:
+
+ Updated a test to reflect that NetworkExtension.framework is no longer
+ loaded at runtime. This test was failing on Catalina after r269109,
+ as the Contacts framework was loading NetworkExtension.
+
+ * TestWebKitAPI/Tests/WebKitCocoa/ContentFiltering.h:
+ * TestWebKitAPI/Tests/WebKitCocoa/ContentFiltering.mm:
+ (-[LazilyLoadPlatformFrameworksController expectParentalControlsLoaded:]):
+ (TEST):
+ * TestWebKitAPI/Tests/WebKitCocoa/ContentFilteringPlugIn.mm:
+ (-[ContentFilteringPlugIn checkIfPlatformFrameworksAreLoaded:]):
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269173 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2020-10-29 Aditya Keerthi <akeer...@apple.com>
+
+ [Cocoa] Remove soft linking of NetworkExtension.framework
+ https://bugs.webkit.org/show_bug.cgi?id=218314
+ <rdar://problem/70785239>
+
+ Reviewed by Andy Estes.
+
+ Updated a test to reflect that NetworkExtension.framework is no longer
+ loaded at runtime. This test was failing on Catalina after r269109,
+ as the Contacts framework was loading NetworkExtension.
+
+ * TestWebKitAPI/Tests/WebKitCocoa/ContentFiltering.h:
+ * TestWebKitAPI/Tests/WebKitCocoa/ContentFiltering.mm:
+ (-[LazilyLoadPlatformFrameworksController expectParentalControlsLoaded:]):
+ (TEST):
+ * TestWebKitAPI/Tests/WebKitCocoa/ContentFilteringPlugIn.mm:
+ (-[ContentFilteringPlugIn checkIfPlatformFrameworksAreLoaded:]):
+
+2020-10-29 Alan Coon <alanc...@apple.com>
+
Cherry-pick r269160. rdar://problem/70831130
Unreviewed, reverting r268192.
Modified: branches/safari-611.1.4-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/ContentFiltering.h (269199 => 269200)
--- branches/safari-611.1.4-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/ContentFiltering.h 2020-10-30 17:42:43 UTC (rev 269199)
+++ branches/safari-611.1.4-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/ContentFiltering.h 2020-10-30 17:42:47 UTC (rev 269200)
@@ -24,5 +24,5 @@
*/
@protocol ContentFilteringProtocol <NSObject>
-- (void)checkIfPlatformFrameworksAreLoaded:(void (^)(BOOL parentalControlsLoaded, BOOL networkExtensionLoaded))completionHandler;
+- (void)checkIfPlatformFrameworksAreLoaded:(void (^)(BOOL parentalControlsLoaded))completionHandler;
@end
Modified: branches/safari-611.1.4-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/ContentFiltering.mm (269199 => 269200)
--- branches/safari-611.1.4-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/ContentFiltering.mm 2020-10-30 17:42:43 UTC (rev 269199)
+++ branches/safari-611.1.4-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/ContentFiltering.mm 2020-10-30 17:42:47 UTC (rev 269200)
@@ -336,7 +336,7 @@
@interface LazilyLoadPlatformFrameworksController : NSObject <WKNavigationDelegate>
@property (nonatomic, readonly) WKWebView *webView;
-- (void)expectParentalControlsLoaded:(BOOL)parentalControlsShouldBeLoaded networkExtensionLoaded:(BOOL)networkExtensionShouldBeLoaded;
+- (void)expectParentalControlsLoaded:(BOOL)parentalControlsShouldBeLoaded;
@end
@implementation LazilyLoadPlatformFrameworksController {
@@ -364,14 +364,13 @@
return _webView.get();
}
-- (void)expectParentalControlsLoaded:(BOOL)parentalControlsShouldBeLoaded networkExtensionLoaded:(BOOL)networkExtensionShouldBeLoaded
+- (void)expectParentalControlsLoaded:(BOOL)parentalControlsShouldBeLoaded
{
isDone = false;
- [_remoteObjectProxy checkIfPlatformFrameworksAreLoaded:^(BOOL parentalControlsLoaded, BOOL networkExtensionLoaded) {
+ [_remoteObjectProxy checkIfPlatformFrameworksAreLoaded:^(BOOL parentalControlsLoaded) {
#if HAVE(PARENTAL_CONTROLS)
EXPECT_EQ(static_cast<bool>(parentalControlsShouldBeLoaded), static_cast<bool>(parentalControlsLoaded));
#endif
- EXPECT_EQ(static_cast<bool>(networkExtensionShouldBeLoaded), static_cast<bool>(networkExtensionLoaded));
isDone = true;
}];
TestWebKitAPI::Util::run(&isDone);
@@ -406,29 +405,29 @@
@autoreleasepool {
auto controller = adoptNS([[LazilyLoadPlatformFrameworksController alloc] init]);
- [controller expectParentalControlsLoaded:NO networkExtensionLoaded:NO];
+ [controller expectParentalControlsLoaded:NO];
isDone = false;
[[controller webView] loadHTMLString:@"PASS" baseURL:[NSURL URLWithString:@"about:blank"]];
TestWebKitAPI::Util::run(&isDone);
- [controller expectParentalControlsLoaded:NO networkExtensionLoaded:NO];
+ [controller expectParentalControlsLoaded:NO];
isDone = false;
[[controller webView] loadData:[NSData dataWithBytes:"PASS" length:4] MIMEType:@"text/html" characterEncodingName:@"UTF-8" baseURL:[NSURL URLWithString:@"about:blank"]];
TestWebKitAPI::Util::run(&isDone);
- [controller expectParentalControlsLoaded:NO networkExtensionLoaded:NO];
+ [controller expectParentalControlsLoaded:NO];
isDone = false;
NSURL *fileURL = [[NSBundle mainBundle] URLForResource:@"ContentFiltering" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"];
[[controller webView] loadFileURL:fileURL allowingReadAccessToURL:fileURL];
TestWebKitAPI::Util::run(&isDone);
- [controller expectParentalControlsLoaded:NO networkExtensionLoaded:NO];
+ [controller expectParentalControlsLoaded:NO];
isDone = false;
[TestProtocol registerWithScheme:@"custom"];
[[controller webView] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"custom://test"]]];
TestWebKitAPI::Util::run(&isDone);
- [controller expectParentalControlsLoaded:NO networkExtensionLoaded:NO];
+ [controller expectParentalControlsLoaded:NO];
[TestProtocol unregister];
isDone = false;
@@ -436,9 +435,9 @@
[[controller webView] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://test"]]];
TestWebKitAPI::Util::run(&isDone);
#if PLATFORM(MAC)
- [controller expectParentalControlsLoaded:NO networkExtensionLoaded:YES];
+ [controller expectParentalControlsLoaded:NO];
#else
- [controller expectParentalControlsLoaded:YES networkExtensionLoaded:YES];
+ [controller expectParentalControlsLoaded:YES];
#endif
[TestProtocol unregister];
@@ -447,7 +446,7 @@
[TestProtocol registerWithScheme:@"https"];
[[controller webView] loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"https://test"]]];
TestWebKitAPI::Util::run(&isDone);
- [controller expectParentalControlsLoaded:YES networkExtensionLoaded:YES];
+ [controller expectParentalControlsLoaded:YES];
[TestProtocol unregister];
#endif
}
Modified: branches/safari-611.1.4-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/ContentFilteringPlugIn.mm (269199 => 269200)
--- branches/safari-611.1.4-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/ContentFilteringPlugIn.mm 2020-10-30 17:42:43 UTC (rev 269199)
+++ branches/safari-611.1.4-branch/Tools/TestWebKitAPI/Tests/WebKitCocoa/ContentFilteringPlugIn.mm 2020-10-30 17:42:47 UTC (rev 269200)
@@ -113,7 +113,7 @@
_contentFilterEnabler = contentFilterEnabler;
}
-- (void)checkIfPlatformFrameworksAreLoaded:(void (^)(BOOL parentalControlsLoaded, BOOL networkExtensionLoaded))completionHandler
+- (void)checkIfPlatformFrameworksAreLoaded:(void (^)(BOOL parentalControlsLoaded))completionHandler
{
bool parentalControlsLoaded = false;
#if HAVE(PARENTAL_CONTROLS)
@@ -120,8 +120,7 @@
parentalControlsLoaded = NSVersionOfRunTimeLibrary("WebContentAnalysis") != -1;
#endif
- bool networkExtensionLoaded = networkExtensionLoaded = NSVersionOfRunTimeLibrary("NetworkExtension") != -1;
- completionHandler(parentalControlsLoaded, networkExtensionLoaded);
+ completionHandler(parentalControlsLoaded);
}
@end