WebKit Bugzilla
Attachment 347405 Details for
Bug 188601
: Add script to generate WebContent service resource files and change XPC service main SPI to have it's own header
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188601-20180817160204.patch (text/plain), 15.43 KB, created by
Ben Richards
on 2018-08-17 16:02:06 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Ben Richards
Created:
2018-08-17 16:02:06 PDT
Size:
15.43 KB
patch
obsolete
>Subversion Revision: 234994 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 9a0427e1004f0f9fd5a418fd8feda26c4827c89b..ea61704cff299068ab9e789671f2c51babd94ee2 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,27 @@ >+2018-08-17 Ben Richards <benton_richards@apple.com> >+ >+ Add script to generate WebContent service resource files and change XPC service main SPI to have it's own header >+ https://bugs.webkit.org/show_bug.cgi?id=188601 >+ >+ Reviewed by Dan Bernstein. >+ >+ Added a script to the process entitlements build phase of the WebContent service that copies resource >+ files to WebKit.framework/PrivateHeaders/CustomWebContentResources. These resource files are to >+ be used by clients who would like to make a custom WebContent service. >+ >+ * Scripts/copy-webcontent-resources-to-private-headers.sh: Added. >+ * WebKit.xcodeproj/project.pbxproj: >+ >+ Changed XPCServiceMain SPI from being a class method of WKProcessPool to having its own header >+ and seperate C function. >+ >+ * Shared/API/c/WKXPCServiceMain.cpp: Added. >+ (WKXPCServiceMain): >+ * Shared/API/c/WKXPCServiceMain.h: Added. >+ * UIProcess/API/Cocoa/WKProcessPool.mm: >+ (+[WKProcessPool _webContentProcessXPCMain]): Deleted. >+ * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: >+ > 2018-08-17 Andy Estes <aestes@apple.com> > > [Xcode] Fix up file reference paths in Source/WebKit/NetworkProcess >diff --git a/Source/WebKit/Scripts/copy-webcontent-resources-to-private-headers.sh b/Source/WebKit/Scripts/copy-webcontent-resources-to-private-headers.sh >new file mode 100755 >index 0000000000000000000000000000000000000000..de2d96189d7d3fe97a0874b53837a27a23d23541 >--- /dev/null >+++ b/Source/WebKit/Scripts/copy-webcontent-resources-to-private-headers.sh >@@ -0,0 +1,31 @@ >+#!/bin/sh >+set -e >+ >+WEB_CONTENT_RESOURCES_PATH="${BUILT_PRODUCTS_DIR}/WebKit.framework/PrivateHeaders/CustomWebContentResources" >+mkdir -p "${WEB_CONTENT_RESOURCES_PATH}" >+ >+echo "Copying WebContent entitlements to ${WEB_CONTENT_RESOURCES_PATH}" >+ENTITLEMENTS_FILE="${TEMP_FILE_DIR}/${FULL_PRODUCT_NAME}.xcent" >+ditto "${ENTITLEMENTS_FILE}" "${WEB_CONTENT_RESOURCES_PATH}/WebContent.entitlements" >+ >+echo "Copying WebContentProcess.xib to ${WEB_CONTENT_RESOURCES_PATH}" >+WEBCONTENT_XIB="${SRCROOT}/Resources/WebContentProcess.xib" >+ditto "${WEBCONTENT_XIB}" "${WEB_CONTENT_RESOURCES_PATH}/WebContentProcess.xib" >+ >+echo "Copying Info.plist to ${WEB_CONTENT_RESOURCES_PATH}" >+PROCESSED_INFOPLIST="${BUILT_PRODUCTS_DIR}/${INFOPLIST_PATH}" >+UNPROCESSED_INFOPLIST="${INFOPLIST_FILE}" >+COPIED_INFOPLIST="${WEB_CONTENT_RESOURCES_PATH}/Info.plist" >+ditto "${UNPROCESSED_INFOPLIST}" "${COPIED_INFOPLIST}" >+ >+echo "Setting fixed entry values for ${COPIED_INFOPLIST}" >+if [[ ${WK_PLATFORM_NAME} == "macosx" ]]; then >+ FIXED_ENTRIES=( ":XPCService:RunLoopType" ) >+else >+ FIXED_ENTRIES=() >+fi >+ >+for ((i = 0; i < ${#FIXED_ENTRIES[@]}; ++i)); do >+ ENTRY_VALUE=$(/usr/libexec/PlistBuddy -c "Print ${FIXED_ENTRIES[$i]}" "${PROCESSED_INFOPLIST}") >+ /usr/libexec/PlistBuddy -c "Set ${FIXED_ENTRIES[$i]} ${ENTRY_VALUE}" "${COPIED_INFOPLIST}" >+done >diff --git a/Source/WebKit/Shared/API/c/WKXPCServiceMain.cpp b/Source/WebKit/Shared/API/c/WKXPCServiceMain.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..0bade3a42de50f7e444ba5773559f53f5e530207 >--- /dev/null >+++ b/Source/WebKit/Shared/API/c/WKXPCServiceMain.cpp >@@ -0,0 +1,34 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "WKXPCServiceMain.h" >+ >+#include "XPCServiceEntryPoint.h" >+ >+int WKXPCServiceMain() >+{ >+ return WebKit::XPCServiceMain(); >+} >diff --git a/Source/WebKit/Shared/API/c/WKXPCServiceMain.h b/Source/WebKit/Shared/API/c/WKXPCServiceMain.h >new file mode 100644 >index 0000000000000000000000000000000000000000..80842f5d1867bcb891d6f1f058a28af04f510499 >--- /dev/null >+++ b/Source/WebKit/Shared/API/c/WKXPCServiceMain.h >@@ -0,0 +1,38 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#include <WebKit/WKBase.h> >+ >+#ifdef __cplusplus >+extern "C" { >+#endif >+ >+WK_EXPORT int WKXPCServiceMain(); >+ >+#ifdef __cplusplus >+} >+#endif >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm b/Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm >index ab319e79edd17915fe9b15b69a8dbcaab5de1263..acefae518de852bc7ff00d39cb5c749a1d78e004 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm >@@ -40,7 +40,6 @@ > #import "WebCookieManagerProxy.h" > #import "WebProcessMessages.h" > #import "WebProcessPool.h" >-#import "XPCServiceEntryPoint.h" > #import "_WKAutomationDelegate.h" > #import "_WKAutomationSessionInternal.h" > #import "_WKDownloadDelegate.h" >@@ -182,11 +181,6 @@ + (NSURL *)_websiteDataURLForContainerWithURL:(NSURL *)containerURL bundleIdenti > return [url URLByAppendingPathComponent:@"WebsiteData" isDirectory:YES]; > } > >-+ (int)_webContentProcessXPCMain >-{ >- return WebKit::XPCServiceMain(); >-} >- > - (void)_setAllowsSpecificHTTPSCertificate:(NSArray *)certificateChain forHost:(NSString *)host > { > _processPool->allowSpecificHTTPSCertificateForHost(WebKit::WebCertificateInfo::create(WebCore::CertificateInfo((__bridge CFArrayRef)certificateChain)).ptr(), host); >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKProcessPoolPrivate.h b/Source/WebKit/UIProcess/API/Cocoa/WKProcessPoolPrivate.h >index 364535a5f273d6aba1a9b07f91c5a6d70dc834cd..7099a4464416239408586243d579cec41282e04e 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKProcessPoolPrivate.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKProcessPoolPrivate.h >@@ -79,8 +79,6 @@ > > - (void)_registerURLSchemeAsCanDisplayOnlyIfCanRequest:(NSString *)scheme WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); > >-+ (int)_webContentProcessXPCMain WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); >- > // Test only. Should be called only while no web content processes are running. > - (void)_terminateStorageProcess; > - (void)_terminateNetworkProcess; >diff --git a/Source/WebKit/WebKit.xcodeproj/project.pbxproj b/Source/WebKit/WebKit.xcodeproj/project.pbxproj >index 7dd4009e24680f39376ab44146d1c02ccd4ae6a9..d30c411e218ccac3d1a1076d155cdc258aeae391 100644 >--- a/Source/WebKit/WebKit.xcodeproj/project.pbxproj >+++ b/Source/WebKit/WebKit.xcodeproj/project.pbxproj >@@ -956,6 +956,8 @@ > 414DD37A20BF49A5006959FB /* com.cisco.webex.plugin.gpc64.sb in Copy Plug-in Sandbox Profiles */ = {isa = PBXBuildFile; fileRef = 414DD37820BF43EA006959FB /* com.cisco.webex.plugin.gpc64.sb */; }; > 414DEDD71F9EDDE50047C40D /* ServiceWorkerProcessProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 414DEDD51F9EDDDF0047C40D /* ServiceWorkerProcessProxy.h */; }; > 414DEDD81F9EDDE50047C40D /* ServiceWorkerProcessProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 414DEDD61F9EDDE00047C40D /* ServiceWorkerProcessProxy.cpp */; }; >+ 415785332127858F00DD3800 /* WKXPCServiceMain.h in Headers */ = {isa = PBXBuildFile; fileRef = 415785322127856D00DD3800 /* WKXPCServiceMain.h */; settings = {ATTRIBUTES = (Private, ); }; }; >+ 41578534212785A700DD3800 /* WKXPCServiceMain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 415785312127856D00DD3800 /* WKXPCServiceMain.cpp */; }; > 4157E4B020E2ECDF00A6C0D7 /* com.google.o1dbrowserplugin.sb in Copy Plug-in Sandbox Profiles */ = {isa = PBXBuildFile; fileRef = 4157E4AF20E2EC9800A6C0D7 /* com.google.o1dbrowserplugin.sb */; }; > 41639A89211933ED001CEF14 /* XPCServiceMain.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC82839616B47EC400A278FE /* XPCServiceMain.mm */; }; > 41897ECF1F415D620016FA42 /* WebCacheStorageConnection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 41897ECE1F415D5C0016FA42 /* WebCacheStorageConnection.cpp */; }; >@@ -3450,6 +3452,9 @@ > 414DEDD51F9EDDDF0047C40D /* ServiceWorkerProcessProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ServiceWorkerProcessProxy.h; sourceTree = "<group>"; }; > 414DEDD61F9EDDE00047C40D /* ServiceWorkerProcessProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ServiceWorkerProcessProxy.cpp; sourceTree = "<group>"; }; > 4151E5C31FBB90A900E47E2D /* FormDataReference.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FormDataReference.h; sourceTree = "<group>"; }; >+ 4157853021276B6F00DD3800 /* copy-webcontent-resources-to-private-headers.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = "copy-webcontent-resources-to-private-headers.sh"; sourceTree = "<group>"; }; >+ 415785312127856D00DD3800 /* WKXPCServiceMain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKXPCServiceMain.cpp; sourceTree = "<group>"; }; >+ 415785322127856D00DD3800 /* WKXPCServiceMain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKXPCServiceMain.h; sourceTree = "<group>"; }; > 4157E4AF20E2EC9800A6C0D7 /* com.google.o1dbrowserplugin.sb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = com.google.o1dbrowserplugin.sb; sourceTree = "<group>"; }; > 4188C154211377700012ABCD /* process-network-sandbox-entitlements.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "process-network-sandbox-entitlements.sh"; sourceTree = "<group>"; }; > 4188C156211377E80012ABCD /* process-webcontent-sandbox-entitlements.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = "process-webcontent-sandbox-entitlements.sh"; sourceTree = "<group>"; }; >@@ -8456,6 +8461,8 @@ > F6113E26126CE19B0057D0A7 /* WKUserContentURLPattern.cpp */, > F6113E27126CE19B0057D0A7 /* WKUserContentURLPattern.h */, > 377EAD4717E2C77B002D193D /* WKUserScriptInjectionTime.h */, >+ 415785312127856D00DD3800 /* WKXPCServiceMain.cpp */, >+ 415785322127856D00DD3800 /* WKXPCServiceMain.h */, > ); > name = C; > path = c; >@@ -8672,6 +8679,7 @@ > children = ( > 7CDE73A21F9DA59700390312 /* PreferencesTemplates */, > 0FC0856E187CE0A900780D86 /* __init__.py */, >+ 4157853021276B6F00DD3800 /* copy-webcontent-resources-to-private-headers.sh */, > C0CE73361247F70E00BC0EC4 /* generate-message-receiver.py */, > C0CE73371247F70E00BC0EC4 /* generate-messages-header.py */, > 7CDE73A11F9DA41400390312 /* GeneratePreferences.rb */, >@@ -10029,6 +10037,7 @@ > 1AD60F6018E20F740020C034 /* WKWindowFeaturesInternal.h in Headers */, > 6A5080BF1F0EDAAA00E617C5 /* WKWindowFeaturesPrivate.h in Headers */, > 1A7C0DF71B7D1F1000A9B848 /* WKWindowFeaturesRef.h in Headers */, >+ 415785332127858F00DD3800 /* WKXPCServiceMain.h in Headers */, > BCBECDE816B6416800047A1A /* XPCServiceEntryPoint.h in Headers */, > ); > runOnlyForDeploymentPostprocessing = 0; >@@ -10161,7 +10170,7 @@ > BC3DE46215A91763008D26FC /* Sources */, > BCDC308D15FDB99A006B6695 /* Frameworks */, > BC3DE46415A91763008D26FC /* Resources */, >- 7AFCBD5420B8911D00F55C9C /* Process WebContent entitlements */, >+ 7AFCBD5420B8911D00F55C9C /* Process WebContent Entitlements and Copy Custom WebContent Resources to Framework Private Headers */, > ); > buildRules = ( > ); >@@ -10661,20 +10670,22 @@ > shellPath = /bin/sh; > shellScript = "Scripts/process-webcontent-or-plugin-entitlements.sh\n"; > }; >- 7AFCBD5420B8911D00F55C9C /* Process WebContent entitlements */ = { >+ 7AFCBD5420B8911D00F55C9C /* Process WebContent Entitlements and Copy Custom WebContent Resources to Framework Private Headers */ = { > isa = PBXShellScriptBuildPhase; > buildActionMask = 2147483647; > files = ( > ); > inputPaths = ( > "$(TEMP_FILE_DIR)/$(FULL_PRODUCT_NAME).xcent", >+ "$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)", >+ "$(SRCROOT)/Resources/WebContentProcess.xib", > ); >- name = "Process WebContent entitlements"; >+ name = "Process WebContent Entitlements and Copy Custom WebContent Resources to Framework Private Headers"; > outputPaths = ( > ); > runOnlyForDeploymentPostprocessing = 0; > shellPath = /bin/sh; >- shellScript = "Scripts/process-webcontent-or-plugin-entitlements.sh\nScripts/process-webcontent-sandbox-entitlements.sh\n"; >+ shellScript = "Scripts/process-webcontent-or-plugin-entitlements.sh\nScripts/process-webcontent-sandbox-entitlements.sh\nScripts/copy-webcontent-resources-to-private-headers.sh\n"; > }; > 7AFCBD5520B8917D00F55C9C /* Process WebContent entitlements */ = { > isa = PBXShellScriptBuildPhase; >@@ -11829,6 +11840,7 @@ > 2DC6D9C418C44A610043BAD4 /* WKWebViewContentProviderRegistry.mm in Sources */, > 1AD60F5D18E20F4C0020C034 /* WKWindowFeatures.mm in Sources */, > 1A7C0DF61B7D1F1000A9B848 /* WKWindowFeaturesRef.cpp in Sources */, >+ 41578534212785A700DD3800 /* WKXPCServiceMain.cpp in Sources */, > BCBECDE716B6416800047A1A /* XPCServiceEntryPoint.mm in Sources */, > 41639A89211933ED001CEF14 /* XPCServiceMain.mm in Sources */, > );
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188601
:
347162
|
347166
|
347178
|
347228
|
347285
|
347297
|
347371
|
347405
|
347418
|
349958
|
350038
|
350047