Skip to content

Commit

Permalink
Unreviewed, reverting 271326@main
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=265324
rdar://118776213
https://commits.webkit.org/271326@main

Unreviewed revert.

* Source/WebKit/Configurations/BaseExtension.xcconfig:
* Source/WebKit/Configurations/WebKit.xcconfig:
* Source/WebKit/NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::setIsHoldingLockedFiles):
* Source/WebKit/NetworkProcess/NetworkProcess.h:
* Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::aqcuireLockedFileGrant): Deleted.
(WebKit::NetworkProcess::invalidateGrant): Deleted.
(WebKit::NetworkProcess::hasAcquiredGrant const): Deleted.
* Source/WebKit/Shared/AuxiliaryProcessExtensions/NetworkingProcessExtension.swift:
(NetworkingProcessExtension.handle(_:)):
* Source/WebKit/Shared/AuxiliaryProcessExtensions/WebKitProcessExtension.swift: Removed.
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:

Canonical link: https://commits.webkit.org/271343@main
  • Loading branch information
JonWBedard committed Nov 30, 2023
1 parent dab7a97 commit c49191c
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 173 deletions.
19 changes: 3 additions & 16 deletions Source/WebKit/Configurations/BaseExtension.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -27,29 +27,16 @@ CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_MODULES = YES;
CLANG_INSTRUMENT_FOR_OPTIMIZATION_PROFILING = NO;
INSTALL_PATH = $(WEBKIT_FRAMEWORKS_DIR)/WebKit.framework/$(WK_FRAMEWORK_VERSION_PREFIX)Extensions;
SWIFT_OBJC_BRIDGING_HEADER = $(SWIFT_OBJC_BRIDGING_HEADER_$(USE_INTERNAL_SDK));
SWIFT_OBJC_BRIDGING_HEADER_ = ;
SWIFT_OBJC_BRIDGING_HEADER_YES = ;
SWIFT_OBJC_BRIDGING_HEADER_YES[sdk=iphone*] = Shared/AuxiliaryProcessExtensions/AuxiliaryProcessExtensionBridge.h;
SWIFT_OBJC_BRIDGING_HEADER_YES[sdk=iphone*17.0*] = ;
SWIFT_OBJC_BRIDGING_HEADER_YES[sdk=iphone*17.1*] = ;
SWIFT_OBJC_BRIDGING_HEADER_YES[sdk=iphone*17.2*] = ;
SWIFT_OBJC_BRIDGING_HEADER_YES[sdk=iphone*17.3*] = ;
SWIFT_OBJC_BRIDGING_HEADER[sdk=iphoneos17.4.internal] = Shared/AuxiliaryProcessExtensions/AuxiliaryProcessExtensionBridge.h;
SWIFT_VERSION = 5.0;
SWIFT_OPTIMIZATION_LEVEL = -O;
SWIFT_OPTIMIZATION_LEVEL[config=Debug] = -Onone;
PRODUCT_NAME = $(TARGET_NAME);
SUPPORTS_MACCATALYST = NO;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
TARGETED_DEVICE_FAMILY = 1,2,7;
EXCLUDED_SOURCE_FILE_NAMES = $(EXCLUDED_SOURCE_FILE_NAMES_$(USE_INTERNAL_SDK));
EXCLUDED_SOURCE_FILE_NAMES_ = *;
EXCLUDED_SOURCE_FILE_NAMES_YES = *;
EXCLUDED_SOURCE_FILE_NAMES_YES[sdk=iphone*] = ;
EXCLUDED_SOURCE_FILE_NAMES_YES[sdk=iphone*17.0*] = *;
EXCLUDED_SOURCE_FILE_NAMES_YES[sdk=iphone*17.1*] = *;
EXCLUDED_SOURCE_FILE_NAMES_YES[sdk=iphone*17.2*] = *;
EXCLUDED_SOURCE_FILE_NAMES_YES[sdk=iphone*17.3*] = *;
EXCLUDED_SOURCE_FILE_NAMES = *;
EXCLUDED_SOURCE_FILE_NAMES[sdk=iphoneos17.4.internal] = ;
CODE_SIGN_ENTITLEMENTS[sdk=*simulator] = Shared/AuxiliaryProcessExtensions/AuxiliaryProcessExtension.entitlements;
CODE_SIGN_INJECT_BASE_ENTITLEMENTS = NO;
WK_PROCESSED_XCENT_FILE=$(TEMP_FILE_DIR)/$(FULL_PRODUCT_NAME).entitlements
Expand Down
13 changes: 2 additions & 11 deletions Source/WebKit/Configurations/WebKit.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -236,15 +236,7 @@ WK_EXCLUDED_WEBPUSHD_SANDBOX = $(WK_EXCLUDED_WEBPUSHD_SANDBOX_$(WK_RELOCATABLE_W
WK_EXCLUDED_WEBPUSHD_SANDBOX_NO = com.apple.WebKit.webpushd.relocatable.mac.sb
WK_EXCLUDED_WEBPUSHD_SANDBOX_YES = com.apple.WebKit.webpushd.mac.sb

EXCLUDED_EXTENSION_SOURCE_FILE_NAMES = Shared/AuxiliaryProcessExtensions/*;

INCLUDED_EXTENSION_SOURCE_FILE_NAMES_YES[sdk=iphone*] = Shared/AuxiliaryProcessExtensions/*;
INCLUDED_EXTENSION_SOURCE_FILE_NAMES_YES[sdk=iphone*17.0.internal] = ;
INCLUDED_EXTENSION_SOURCE_FILE_NAMES_YES[sdk=iphone*17.1.internal] = ;
INCLUDED_EXTENSION_SOURCE_FILE_NAMES_YES[sdk=iphone*17.2.internal] = ;
INCLUDED_EXTENSION_SOURCE_FILE_NAMES_YES[sdk=iphone*17.3.internal] = ;

EXCLUDED_SOURCE_FILE_NAMES = $(EXCLUDED_PRODUCT_DEPENDENCY_NAMES) $(EXCLUDED_IOS_RESOURCE_FILE_NAMES) $(EXCLUDED_MACOS_PLUGIN_FILE_NAMES) $(EXCLUDED_MIGRATED_HEADERS_COCOA_TOUCH_$(WK_IS_COCOA_TOUCH)) $(WK_EXCLUDED_WEBPUSHD_SANDBOX) $(EXCLUDED_EXTENSION_SOURCE_FILE_NAMES);
EXCLUDED_SOURCE_FILE_NAMES = $(EXCLUDED_PRODUCT_DEPENDENCY_NAMES) $(EXCLUDED_IOS_RESOURCE_FILE_NAMES) $(EXCLUDED_MACOS_PLUGIN_FILE_NAMES) $(EXCLUDED_MIGRATED_HEADERS_COCOA_TOUCH_$(WK_IS_COCOA_TOUCH)) $(WK_EXCLUDED_WEBPUSHD_SANDBOX);

// These are only available in internal builds, so they must be explicitly ignored for the open-source build to succeed.
EXCLUDED_PRODUCT_DEPENDENCY_NAMES = libWebKitAdditions.a AuthenticationServicesCore.framework;
Expand All @@ -253,8 +245,7 @@ EXCLUDED_IOS_RESOURCE_FILE_NAMES[sdk=iphone*] = ;
EXCLUDED_MIGRATED_HEADERS_COCOA_TOUCH_YES = WebDynamicScrollBarsView.h WebEventRegion.h WebIconDatabase.h WebJavaScriptTextInputPanel.h WebNSEventExtras.h WebNSPasteboardExtras.h WebNSWindowExtras.h WebPanelAuthenticationHandler.h WebStringTruncator.h;
EXCLUDED_MIGRATED_HEADERS_COCOA_TOUCH_NO = AbstractPasteboard.h DOMHTMLTextAreaElementPrivate.h DOMUIKitExtensions.h KeyEventCodesIOS.h WAKAppKitStubs.h WAKResponder.h WAKView.h WAKWindow.h WebCaretChangeListener.h WebCoreThread.h WebCoreThreadMessage.h WebCoreThreadRun.h WebEvent.h WebEventRegion.h WebFixedPositionContent.h WebFrameIOS.h WebFrameIPhone.h WebGeolocationCoreLocationProvider.h WebGeolocationPrivate.h WebGeolocationProviderIOS.h WebItemProviderPasteboard.h WebMIMETypeRegistry.h WebNSStringExtrasIOS.h WebNSStringExtrasIPhone.h WebPDFViewIOS.h WebPDFViewIPhone.h WebPDFViewPlaceholder.h WebSelectionRect.h WebUIKitDelegate.h WebUIKitSupport.h WebVisiblePosition.h WKContentObservation.h WKGraphics.h WKTypes.h;

INCLUDED_SOURCE_FILE_NAMES = $(INCLUDED_MIGRATED_HEADERS_$(USE_INTERNAL_SDK)_$(WK_COCOA_TOUCH)) $(INCLUDED_MIGRATED_HEADERS_$(ENABLE_IOS_TOUCH_EVENTS)) $(INCLUDED_EXTENSION_SOURCE_FILE_NAMES_$(USE_INTERNAL_SDK));

INCLUDED_SOURCE_FILE_NAMES = $(INCLUDED_MIGRATED_HEADERS_$(USE_INTERNAL_SDK)_$(WK_COCOA_TOUCH)) $(INCLUDED_MIGRATED_HEADERS_$(ENABLE_IOS_TOUCH_EVENTS));
// WebEventRegion.h is migrated when building for an iOS family target with an internal SDK...
INCLUDED_MIGRATED_HEADERS_YES_cocoatouch = WebEventRegion.h;
// ...or when --ios-touch-events was passed to build-webkit manually.
Expand Down
10 changes: 0 additions & 10 deletions Source/WebKit/NetworkProcess/NetworkProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2941,22 +2941,12 @@ void NetworkProcess::setIsHoldingLockedFiles(bool isHoldingLockedFiles)
#else
if (!isHoldingLockedFiles) {
m_holdingLockedFileAssertion = nullptr;
#if USE(EXTENSIONKIT)
invalidateGrant();
#endif
return;
}

if (m_holdingLockedFileAssertion && m_holdingLockedFileAssertion->isValid())
return;

#if USE(EXTENSIONKIT)
if (hasAcquiredGrant())
return;
if (aqcuireLockedFileGrant())
return;
#endif

// We synchronously take a process assertion when beginning a SQLite transaction so that we don't get suspended
// while holding a locked file. We would get killed if suspended while holding locked files.
m_holdingLockedFileAssertion = ProcessAssertion::create(getCurrentProcessID(), "Network Process is holding locked files"_s, ProcessAssertionType::FinishTaskInterruptable, ProcessAssertion::Mode::Sync);
Expand Down
12 changes: 0 additions & 12 deletions Source/WebKit/NetworkProcess/NetworkProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@
typedef struct OpaqueCFHTTPCookieStorage* CFHTTPCookieStorageRef;
#endif

#if USE(EXTENSIONKIT)
OBJC_CLASS Grant;
#endif

namespace IPC {
class FormDataReference;
}
Expand Down Expand Up @@ -527,11 +523,6 @@ class NetworkProcess : public AuxiliaryProcess, private DownloadManager::Client,

#if USE(RUNNINGBOARD)
void setIsHoldingLockedFiles(bool);
#endif
#if USE(EXTENSIONKIT)
bool aqcuireLockedFileGrant();
void invalidateGrant();
bool hasAcquiredGrant() const;
#endif
void stopRunLoopIfNecessary();

Expand Down Expand Up @@ -568,9 +559,6 @@ class NetworkProcess : public AuxiliaryProcess, private DownloadManager::Client,

#if USE(RUNNINGBOARD)
WebSQLiteDatabaseTracker m_webSQLiteDatabaseTracker;
#if USE(EXTENSIONKIT)
RetainPtr<Grant> m_holdingLockedFileGrant;
#endif
RefPtr<ProcessAssertion> m_holdingLockedFileAssertion;
#endif

Expand Down
35 changes: 0 additions & 35 deletions Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@
#import <pal/spi/cocoa/NEFilterSourceSPI.h>
#endif

#if USE(EXTENSIONKIT)
#import "ExtensionKitSPI.h"
#import <WebKit-Swift.h>
#endif

namespace WebKit {

static void initializeNetworkSettings()
Expand Down Expand Up @@ -256,34 +251,4 @@ void saveCookies(NSHTTPCookieStorage *cookieStorage, CompletionHandler<void()>&&
}
#endif // HAVE(NW_PROXY_CONFIG)

#if USE(RUNNINGBOARD) && USE(EXTENSIONKIT)
bool NetworkProcess::aqcuireLockedFileGrant()
{
NSError* error = nil;
m_holdingLockedFileGrant = [WKNetworkingProcessExtension.sharedInstance grant:@"com.apple.common" name:@"FinishTaskInterruptable" error:&error];
if (m_holdingLockedFileGrant)
RELEASE_LOG(Process, "Successfully took assertion on Network process for locked file");
else
RELEASE_LOG_ERROR(Process, "Unable to take assertion on Network process for locked file, error = %@", error);
return !!m_holdingLockedFileGrant;
}

void NetworkProcess::invalidateGrant()
{
if (!hasAcquiredGrant())
return;

NSError* error = nil;
[m_holdingLockedFileGrant invalidateWithError:&error];
if (error)
RELEASE_LOG_ERROR(Process, "Unable to invalidate grant, error = %@", error);
m_holdingLockedFileGrant = nil;
}

bool NetworkProcess::hasAcquiredGrant() const
{
return !!m_holdingLockedFileGrant;
}
#endif

} // namespace WebKit
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,14 @@

import ServiceExtensions
@_spi(Private) import ServiceExtensions
@_spi(Private) import WebKit

@main
class NetworkingProcessExtension : WKNetworkingProcessExtension {
required init() {
super.init()
}
class NetworkingProcessExtension {
required init() {}
}

extension NetworkingProcessExtension {
@objc(handle:)
override open func handle(xpcConnection: xpc_connection_t) {
extension NetworkingProcessExtension: NetworkingServiceExtension {
func handle(xpcConnection: xpc_connection_t) {
handleNewConnection(xpcConnection)
}
}

This file was deleted.

Loading

0 comments on commit c49191c

Please sign in to comment.