-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move some WebKit code to WebKit framework #21058
Move some WebKit code to WebKit framework #21058
Conversation
EWS run on previous version of this PR (hash ab980c1) |
ab980c1
to
7ace39f
Compare
EWS run on previous version of this PR (hash 7ace39f) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not thrilled about adding Swift code into the main WebKit target at this time, for a couple of reasons:
- There's a build time cost of turning WebKit into a three-stage compilation process. By adding Swift to the target, we have to, in sequence, compile the module interface; then the swift code; then the rest of the code.
- This change is iOS only, so it would modify the build in a way that's not uniform across the Xcode-based platforms.
EXCLUDED_EXTENSION_SOURCE_FILE_NAMES = Shared/AuxiliaryProcessExtensions/*; | ||
EXCLUDED_EXTENSION_SOURCE_FILE_NAMES[sdk=iphoneos17.4.internal] = ; | ||
EXCLUDED_EXTENSION_SOURCE_FILE_NAMES[sdk=iphonesimulator17.4.internal] = ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd recommend inverting this and adding some extra boilerplate to prevent this from being immediately out of date in future iOS versions.
EXCLUDED_EXTENSION_SOURCE_FILE_NAMES = Shared/AuxiliaryProcessExtensions/*; | |
EXCLUDED_EXTENSION_SOURCE_FILE_NAMES[sdk=iphoneos17.4.internal] = ; | |
EXCLUDED_EXTENSION_SOURCE_FILE_NAMES[sdk=iphonesimulator17.4.internal] = ; | |
EXCLUDED_EXTENSION_SOURCE_FILE_NAMES = Shared/AuxiliaryProcessExtensions/*; | |
// already defined further down⦠| |
INCLUDED_SOURCE_FILE_NAMES = $(INCLUDED_EXTENSION_SOURCE_FILE_NAMES_$(USE_INTERNAL_SDK)); | |
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] = ;``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that's a good point. I have updated the patch with this change.
Thanks for reviewing!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I didn't mean for you to write "already defined further downβ¦" literally. There is already a INCLUDED_SOURCE_FILE_NAMES
definition in the file, so this change needs to be incorporated to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I realized that when I built locally :)
Thanks for reviewing!
@@ -54,6 +54,11 @@ | |||
#import <pal/spi/cocoa/NEFilterSourceSPI.h> | |||
#endif | |||
|
|||
#if USE(EXTENSIONKIT) && __has_include(<WebKit-Swift.h>) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? It seems like USE(EXTENSIONKIT)
implies that we're compiling swift code and generating the Swift header.
#if USE(RUNNINGBOARD) && USE(EXTENSIONKIT) | ||
bool NetworkProcess::aqcuireLockedFileGrant() | ||
{ | ||
#if __has_include(<WebKit-Swift.h>) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was resolved by your request to invert the logic above.
7ace39f
to
92cb264
Compare
EWS run on previous version of this PR (hash 92cb264) |
92cb264
to
8e040af
Compare
EWS run on previous version of this PR (hash 8e040af) |
SWIFT_OBJC_BRIDGING_HEADER[sdk=iphoneos17.4.internal] = Shared/AuxiliaryProcessExtensions/AuxiliaryProcessExtensionBridge.h; | ||
SWIFT_OBJC_BRIDGING_HEADER[sdk=iphonesimulator17.4.internal] = Shared/AuxiliaryProcessExtensions/AuxiliaryProcessExtensionBridge.h; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to do a similar dance here: make this setting the default, and then override it to empty on 17.0-17.3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed!
EXCLUDED_SOURCE_FILE_NAMES = *; | ||
EXCLUDED_SOURCE_FILE_NAMES[sdk=iphoneos17.4.internal] = ; | ||
EXCLUDED_SOURCE_FILE_NAMES[sdk=iphonesimulator17.4.internal] = ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto. Here, it's may be to do something like:
EXCLUDED_SOURCE_FILE_NAMES = *; | |
EXCLUDED_SOURCE_FILE_NAMES[sdk=iphoneos17.4.internal] = ; | |
EXCLUDED_SOURCE_FILE_NAMES[sdk=iphonesimulator17.4.internal] = ; | |
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*] = *; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good catch, will fix!
8e040af
to
aaecd27
Compare
EWS run on current version of this PR (hash aaecd27) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per Arne and I talked and we're going to land this as-is, with a plan to remove the Swift code from the WebKit target as a follow-up.
One benefit of this is that it'll help quantify the cost of introducing Swift to the main target.
https://bugs.webkit.org/show_bug.cgi?id=265324 rdar://118776213 Reviewed by Brent Fulgham. Move some WebKit code related to WebKit process extensions to WebKit framework. This change enables us to use new assertion API to take out an assertion on the Networking process when holding locked files, which is also included in this patch. * Source/WebKit/NetworkProcess/NetworkProcess.cpp: (WebKit::NetworkProcess::setIsHoldingLockedFiles): * Source/WebKit/NetworkProcess/NetworkProcess.h: * Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm: (WebKit::NetworkProcess::aqcuireLockedFileGrant): (WebKit::NetworkProcess::invalidateGrant): (WebKit::NetworkProcess::hasAcquiredGrant const): * Source/WebKit/Shared/AuxiliaryProcessExtensions/NetworkingProcessExtension.swift: (NetworkingProcessExtension.handle(_:)): * Source/WebKit/Shared/AuxiliaryProcessExtensions/WebKitProcessExtension.swift: Copied from Source/WebKit/Shared/AuxiliaryProcessExtensions/NetworkingProcessExtension.swift. (WKProcessExtension.sharedInstance): (WKNetworkingProcessExtension.handle(_:)): (WKNetworkingProcessExtension.grant(_:name:)): * Source/WebKit/WebKit.xcodeproj/project.pbxproj: Canonical link: https://commits.webkit.org/271326@main
aaecd27
to
c0b5c33
Compare
Committed 271326@main (c0b5c33): https://commits.webkit.org/271326@main Reviewed commits have been landed. Closing PR #21058 and removing active labels. |
c0b5c33
aaecd27