-
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 #21140
Move some WebKit code to WebKit framework #21140
Conversation
EWS run on previous version of this PR (hash 8295ff1) |
EWS run on previous version of this PR (hash 409ec4b) |
409ec4b
to
11531db
Compare
EWS run on previous version of this PR (hash 11531db) |
11531db
to
f51acb3
Compare
EWS run on previous version of this PR (hash f51acb3) |
EWS run on previous version of this PR (hash 42987e4) |
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.
The code changes look good to me, but I'm less confident about the hard-coded iPhone OS release numbers. I'm approving, but would appreciate it if you could check with @emw-apple before landing.
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*] = ; |
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 pattern of hard-coding specific iOS releases seems unusual. I'd prefer for @emw-apple to review these bits.
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 my request, actually. We need to enable this functionality for all builds after iOS 17.3. The more normal thing to do is to use build setting macros from WebKitTargetConditionals.xcconfig
, but we generally only define those for major OS releases.
42987e4
to
183187d
Compare
EWS run on previous version of this PR (hash 183187d) |
183187d
to
70e275a
Compare
EWS run on previous version of this PR (hash 70e275a) |
70e275a
to
e2df860
Compare
EWS run on previous version of this PR (hash e2df860) |
e2df860
to
876f446
Compare
EWS run on previous version of this PR (hash 876f446) |
876f446
to
49019d9
Compare
EWS run on previous version of this PR (hash 49019d9) |
49019d9
to
b7d9f6d
Compare
EWS run on previous version of this PR (hash b7d9f6d) |
b7d9f6d
to
7421567
Compare
EWS run on previous version of this PR (hash 7421567) |
7421567
to
e376dd9
Compare
EWS run on previous version of this PR (hash e376dd9) |
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*] = ; |
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 my request, actually. We need to enable this functionality for all builds after iOS 17.3. The more normal thing to do is to use build setting macros from WebKitTargetConditionals.xcconfig
, but we generally only define those for major OS releases.
|
||
- (void)setSharedInstance:(WKProcessExtension*)instance | ||
{ | ||
NSLog(@"WKProcessExtension setSharedInstance %@", instance); |
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.
nit: This and the other NSLog calls in this file feel like debugging statements to me, that probably shouldn't make it to production and will only cause log spam. What do you think?
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.
Thanks for reviewing!
override func grant(_ domain: String, name: String) -> Any { | ||
do { | ||
let grant = try self._request(capabilities: _Capabilities.assertion(domain, name)) | ||
return Grant(inner: grant) | ||
} catch { | ||
return WKGrant() | ||
} | ||
} |
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.
Instead of having an abstract -[WKProcessExtension grant:name:]
method that you override from Swift, you could declare this extension method as @objc
. Then, from NetworkProcessCocoa.mm
, you could do a respondsToSelector(@selector(grant:name:))
to check that the method exists (assertion-failing if it does not), then call it.
That might be easier to follow than the abstract method, which should never be called, but has to be written nonetheless.
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.
That is a good point, although I think it also would be good to avoid the respondsToSelector call. I went ahead and landed as-is, but please let me know if you still think this should be changed, and I can follow up in a new patch :)
e376dd9
to
c45ea31
Compare
EWS run on previous version of this PR (hash c45ea31) |
c45ea31
to
7fc0483
Compare
EWS run on current version of this PR (hash 7fc0483) |
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/Configurations/BaseExtension.xcconfig: * Source/WebKit/Configurations/WebKit.xcconfig: * Source/WebKit/Modules/iOS_Private.modulemap: * 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/AuxiliaryProcessExtensionBridge.h: * Source/WebKit/Shared/AuxiliaryProcessExtensions/NetworkingProcessExtension.swift: (Grant.invalidate): (NetworkingProcessExtension.grant(_:name:)): * Source/WebKit/WebKit.xcodeproj/project.pbxproj: Canonical link: https://commits.webkit.org/271478@main
7fc0483
to
676f48d
Compare
Committed 271478@main (676f48d): https://commits.webkit.org/271478@main Reviewed commits have been landed. Closing PR #21140 and removing active labels. |
676f48d
7fc0483
π§ͺ wpe-wk2π§ͺ ios-wk2-wptπ§ͺ mac-wk2