Changeset 252083 in webkit
- Timestamp:
- Nov 5, 2019 2:22:17 PM (4 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r252081 r252083 1 2019-11-05 Per Arne Vollan <pvollan@apple.com> 2 3 Eliminate mach lookup to cfprefsd on process startup 4 https://bugs.webkit.org/show_bug.cgi?id=202866 5 6 Reviewed by Geoffrey Garen. 7 8 Currently, the WebContent and Networking process is calling CFBundleGetValueForInfoDictionaryKey on startup 9 to get the entry point function name into the WebKit bundle. This causes a mach lookup to cfprefsd which 10 should be avoided. Instead, we can send the service name as part of the bootstrap message when the UI process 11 is starting the process, and have the new process read this value from the message on startup to determine 12 the name of the entry point. This is possibly also an improvement in launch time, since we avoid reading a 13 value from Info.plist. 14 15 * NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkService/Info-OSX.plist: 16 * NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkService/Info-iOS.plist: 17 * PluginProcess/EntryPoint/Cocoa/XPCService/PluginService.64.Info.plist: 18 * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm: 19 (WebKit::XPCServiceEventHandler): 20 * UIProcess/Launcher/mac/ProcessLauncherMac.mm: 21 (WebKit::ProcessLauncher::launchProcess): 22 * WebProcess/EntryPoint/Cocoa/XPCService/WebContentService/Info-OSX.plist: 23 * WebProcess/EntryPoint/Cocoa/XPCService/WebContentService/Info-iOS.plist: 24 1 25 2019-11-05 Per Arne Vollan <pvollan@apple.com> 2 26 -
trunk/Source/WebKit/NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkService/Info-OSX.plist
r239568 r252083 27 27 <key>NSPrincipalClass</key> 28 28 <string>NSApplication</string> 29 <key>WebKitEntryPoint</key>30 <string>NetworkServiceInitializer</string>31 29 <key>LSUIElement</key> 32 30 <true/> -
trunk/Source/WebKit/NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkService/Info-iOS.plist
r239568 r252083 27 27 <key>NSPrincipalClass</key> 28 28 <string>NSApplication</string> 29 <key>WebKitEntryPoint</key>30 <string>NetworkServiceInitializer</string>31 29 <key>LSUIElement</key> 32 30 <true/> -
trunk/Source/WebKit/NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkServiceEntryPoint.mm
r248862 r252083 51 51 using namespace WebKit; 52 52 53 extern "C" WK_EXPORT void N etworkServiceInitializer(xpc_connection_t connection, xpc_object_t initializerMessage, xpc_object_t priorityBoostMessage);53 extern "C" WK_EXPORT void NETWORK_SERVICE_INITIALIZER(xpc_connection_t connection, xpc_object_t initializerMessage, xpc_object_t priorityBoostMessage); 54 54 55 void N etworkServiceInitializer(xpc_connection_t connection, xpc_object_t initializerMessage, xpc_object_t priorityBoostMessage)55 void NETWORK_SERVICE_INITIALIZER(xpc_connection_t connection, xpc_object_t initializerMessage, xpc_object_t priorityBoostMessage) 56 56 { 57 57 WTF::initializeMainThread(); -
trunk/Source/WebKit/PluginProcess/EntryPoint/Cocoa/XPCService/PluginService.64.Info.plist
r239841 r252083 27 27 <key>NSPrincipalClass</key> 28 28 <string>NSApplication</string> 29 <key>WebKitEntryPoint</key>30 <string>PluginServiceInitializer</string>31 29 <key>LSUIElement</key> 32 30 <true/> -
trunk/Source/WebKit/PluginProcess/EntryPoint/Cocoa/XPCService/PluginServiceEntryPoint.mm
r248862 r252083 70 70 #endif // ENABLE(NETSCAPE_PLUGIN_API) 71 71 72 extern "C" WK_EXPORT void P luginServiceInitializer(xpc_connection_t connection, xpc_object_t initializerMessage, xpc_object_t priorityBoostMessage);72 extern "C" WK_EXPORT void PLUGIN_SERVICE_INITIALIZER(xpc_connection_t connection, xpc_object_t initializerMessage, xpc_object_t priorityBoostMessage); 73 73 74 void P luginServiceInitializer(xpc_connection_t connection, xpc_object_t initializerMessage, xpc_object_t priorityBoostMessage)74 void PLUGIN_SERVICE_INITIALIZER(xpc_connection_t connection, xpc_object_t initializerMessage, xpc_object_t priorityBoostMessage) 75 75 { 76 76 #if ENABLE(NETSCAPE_PLUGIN_API) -
trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.h
r249808 r252083 39 39 #endif 40 40 #endif 41 42 #define WEBCONTENT_SERVICE_INITIALIZER WebContentServiceInitializer 43 #define NETWORK_SERVICE_INITIALIZER NetworkServiceInitializer 44 #define PLUGIN_SERVICE_INITIALIZER PluginServiceInitializer 41 45 42 46 namespace WebKit { -
trunk/Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm
r248862 r252083 56 56 if (!strcmp(xpc_dictionary_get_string(event, "message-name"), "bootstrap")) { 57 57 CFBundleRef webKitBundle = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.WebKit")); 58 CFStringRef entryPointFunctionName = (CFStringRef)CFBundleGetValueForInfoDictionaryKey(CFBundleGetMainBundle(), CFSTR("WebKitEntryPoint"));59 58 59 const char* serviceName = xpc_dictionary_get_string(event, "service-name"); 60 CFStringRef entryPointFunctionName = nullptr; 61 if (!strcmp(serviceName, "com.apple.WebKit.WebContent") || !strcmp(serviceName, "com.apple.WebKit.WebContent.Development")) 62 entryPointFunctionName = CFSTR(STRINGIZE_VALUE_OF(WEBCONTENT_SERVICE_INITIALIZER)); 63 else if (!strcmp(serviceName, "com.apple.WebKit.Networking")) 64 entryPointFunctionName = CFSTR(STRINGIZE_VALUE_OF(NETWORK_SERVICE_INITIALIZER)); 65 else if (!strcmp(serviceName, "com.apple.WebKit.Plugin.64")) 66 entryPointFunctionName = CFSTR(STRINGIZE_VALUE_OF(PLUGIN_SERVICE_INITIALIZER)); 67 else 68 RELEASE_ASSERT_NOT_REACHED(); 69 70 60 71 typedef void (*InitializerFunction)(xpc_connection_t, xpc_object_t, xpc_object_t); 61 72 InitializerFunction initializerFunctionPtr = reinterpret_cast<InitializerFunction>(CFBundleGetFunctionPointerForName(webKitBundle, entryPointFunctionName)); -
trunk/Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm
r250186 r252083 190 190 xpc_dictionary_set_string(bootstrapMessage.get(), "process-identifier", String::number(m_launchOptions.processIdentifier.toUInt64()).utf8().data()); 191 191 xpc_dictionary_set_string(bootstrapMessage.get(), "ui-process-name", [[[NSProcessInfo processInfo] processName] UTF8String]); 192 xpc_dictionary_set_string(bootstrapMessage.get(), "service-name", name); 192 193 193 194 bool isWebKitDevelopmentBuild = ![[[[NSBundle bundleWithIdentifier:@"com.apple.WebKit"] bundlePath] stringByDeletingLastPathComponent] hasPrefix:systemDirectoryPath()]; -
trunk/Source/WebKit/WebProcess/EntryPoint/Cocoa/XPCService/WebContentService/Info-OSX.plist
r239568 r252083 29 29 <key>NSPrincipalClass</key> 30 30 <string>NSApplication</string> 31 <key>WebKitEntryPoint</key>32 <string>WebContentServiceInitializer</string>33 31 <key>LSUIElement</key> 34 32 <true/> -
trunk/Source/WebKit/WebProcess/EntryPoint/Cocoa/XPCService/WebContentService/Info-iOS.plist
r239568 r252083 27 27 <key>LSFileQuarantineEnabled</key> 28 28 <true/> 29 <key>WebKitEntryPoint</key>30 <string>WebContentServiceInitializer</string>31 29 <key>XPCService</key> 32 30 <dict> -
trunk/Source/WebKit/WebProcess/EntryPoint/Cocoa/XPCService/WebContentServiceEntryPoint.mm
r248862 r252083 36 36 #endif 37 37 38 extern "C" WK_EXPORT void W ebContentServiceInitializer(xpc_connection_t connection, xpc_object_t initializerMessage, xpc_object_t priorityBoostMessage);38 extern "C" WK_EXPORT void WEBCONTENT_SERVICE_INITIALIZER(xpc_connection_t connection, xpc_object_t initializerMessage, xpc_object_t priorityBoostMessage); 39 39 40 void W ebContentServiceInitializer(xpc_connection_t connection, xpc_object_t initializerMessage, xpc_object_t priorityBoostMessage)40 void WEBCONTENT_SERVICE_INITIALIZER(xpc_connection_t connection, xpc_object_t initializerMessage, xpc_object_t priorityBoostMessage) 41 41 { 42 42 WTF::initializeMainThread();
Note: See TracChangeset
for help on using the changeset viewer.