Improve launch time of WebKit processes, v2#18651
Improve launch time of WebKit processes, v2#18651webkit-commit-queue merged 1 commit intoWebKit:mainfrom
Conversation
|
EWS run on previous version of this PR (hash 15a8da9) Details
|
15a8da9 to
e2e352a
Compare
|
EWS run on previous version of this PR (hash e2e352a) Details
|
e2e352a to
7d2875e
Compare
|
EWS run on previous version of this PR (hash 7d2875e) Details
|
7d2875e to
b64dc60
Compare
|
EWS run on previous version of this PR (hash b64dc60) Details
|
|
EWS run on previous version of this PR (hash ab156ae) Details
|
b64dc60 to
ab156ae
Compare
|
EWS run on previous version of this PR (hash 6f31d7e) Details
|
ab156ae to
6f31d7e
Compare
6f31d7e to
eaa99c0
Compare
|
EWS run on previous version of this PR (hash eaa99c0) Details
|
eaa99c0 to
3e52605
Compare
|
EWS run on previous version of this PR (hash 3e52605) Details
|
brentfulgham
left a comment
There was a problem hiding this comment.
Looks good. Can you double-check the const char* handling of name for the cross-thread issues I asked about? r=me
There was a problem hiding this comment.
I wonder if we could do these imports in the implementation files, since the new declaration just needs a definition for xpc_conneciton_t, which we could forward declare. I think these are fairly big headers, so avoiding them in this header could be a nice build-time benefit.
There was a problem hiding this comment.
That is a good point! I tried doing the forward declaration, although it became a bit complicated since the definition of xpc_connection_t depends on the language. If you are ok with it, I'll keep the include for now.
There was a problem hiding this comment.
Maybe add the objc include headers here instead of in the AuxiliaryProcessExtensionBridge.h header.
There was a problem hiding this comment.
I removed the objc header in the latest patch, since it was not required.
There was a problem hiding this comment.
Nit: Unneeded whitespace.
There was a problem hiding this comment.
Fixed in all 3 places in latest patch.
There was a problem hiding this comment.
Should this maybe just be an Objective C NSDictionary, since it's only really needed for Cocoa APIs?
There was a problem hiding this comment.
Actually, maybe not since the key is used for regular WebKit C++ code.
There was a problem hiding this comment.
Please use ASCIILiteral instead of const char*, then thread-safety is not a concern.
There was a problem hiding this comment.
That is a good point! I will change this to ASCIILiteral.
Thanks for reviewing!
There was a problem hiding this comment.
The use of callOnMainRunLoop makes it seem like some of this code might run off the main thread. Do we need to be doing an isolated copy of name here? Or adding asserts that the other code referencing this name (which comes from serviceNameAndIdentifier) is on the right thread?
There was a problem hiding this comment.
If manager does this work off the main thread, we might need to use isolated copy on name.
There was a problem hiding this comment.
Ditto for the other case sections.
3e52605 to
c6eba03
Compare
|
EWS run on previous version of this PR (hash c6eba03) Details
|
That is a good point. In this case, I do not think we need to do an isolated copy, since Thanks for reviewing! |
There was a problem hiding this comment.
You should use a local variable for the result of weakProcessLauncher.get(). Calling weakProcessLauncher.get() is as cheap as you might expect in this case. So calling it 3 times in a row is not ideal.
There was a problem hiding this comment.
That is a good point! Will fix in upcoming patch.
There was a problem hiding this comment.
Yes, will fix in upcoming patch.
c6eba03 to
6fda08a
Compare
|
EWS run on previous version of this PR (hash 6fda08a) Details
|
6fda08a to
7755c87
Compare
|
EWS run on current version of this PR (hash 7755c87) Details
|
https://bugs.webkit.org/show_bug.cgi?id=261966 rdar://problem/115906222 Reviewed by Brent Fulgham. To benefit of the launch time improvements by launching WebKit processes as extensions, this patch implements this approach by using ExtensionKit for launching. The feature is currently behind a flags, which is not being turned on in this patch. The extensions are currently being installed in the WebKit framework. * Source/WebKit/Configurations/BaseExtension.xcconfig: * Source/WebKit/Platform/spi/Cocoa/ExtensionKitSPI.h: Copied from Source/WebKit/Shared/AuxiliaryProcessExtensions/AuxiliaryProcessExtensionBridge.h. * Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb.in: * Source/WebKit/Scripts/process-entitlements.sh: * Source/WebKit/Shared/API/Cocoa/WKMain.h: * Source/WebKit/Shared/API/Cocoa/WKMain.mm: (WKExtensionEventHandler): (WKExtensionMain): Deleted. * Source/WebKit/Shared/AuxiliaryProcessExtensions/AuxiliaryProcessExtension.entitlements: Removed. * Source/WebKit/Shared/AuxiliaryProcessExtensions/AuxiliaryProcessExtension.swift: (GPUProcessExtension.handle(_:)): (AuxiliaryProcessExtension.main): Deleted. * Source/WebKit/Shared/AuxiliaryProcessExtensions/AuxiliaryProcessExtensionBridge.h: * Source/WebKit/Shared/AuxiliaryProcessExtensions/AuxiliaryProcessExtensionBridge.mm: (handleNewConnection): (extensionMain): Deleted. * Source/WebKit/Shared/AuxiliaryProcessExtensions/GPUProcessExtension.swift: Renamed from Source/WebKit/Shared/AuxiliaryProcessExtensions/AuxiliaryProcessExtension.swift. (GPUProcessExtension.handle(_:)): * Source/WebKit/Shared/AuxiliaryProcessExtensions/NetworkingProcessExtension.swift: Copied from Source/WebKit/Shared/AuxiliaryProcessExtensions/AuxiliaryProcessExtension.swift. (NetworkingProcessExtension.handle(_:)): * Source/WebKit/Shared/AuxiliaryProcessExtensions/WebContentProcessExtension.swift: Copied from Source/WebKit/Shared/AuxiliaryProcessExtensions/AuxiliaryProcessExtension.swift. (WebContentProcessExtension.handle(_:)): * Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h: * Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm: (WebKit::XPCServiceEventHandler): (WebKit::XPCServiceMain): * Source/WebKit/UIProcess/Launcher/ProcessLauncher.h: * Source/WebKit/UIProcess/Launcher/cocoa/ProcessLauncherCocoa.mm: (WebKit::serviceNameAndIdentifier): (WebKit::launchWithExtensionKit): (WebKit::ProcessLauncher::launchProcess): (WebKit::ProcessLauncher::finishLaunchingProcess): * Source/WebKit/WebKit.xcodeproj/project.pbxproj: Canonical link: https://commits.webkit.org/268990@main
7755c87 to
9590b61
Compare
|
Committed 268990@main (9590b61): https://commits.webkit.org/268990@main Reviewed commits have been landed. Closing PR #18651 and removing active labels. |
9590b61
7755c87