Title: [236092] trunk/Source/WebKit
Revision
236092
Author
[email protected]
Date
2018-09-17 16:00:54 -0700 (Mon, 17 Sep 2018)

Log Message

+2018-08-17  Ben Richards  <[email protected]>

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:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (236091 => 236092)


--- trunk/Source/WebKit/ChangeLog	2018-09-17 22:43:11 UTC (rev 236091)
+++ trunk/Source/WebKit/ChangeLog	2018-09-17 23:00:54 UTC (rev 236092)
@@ -1,3 +1,18 @@
++2018-08-17  Ben Richards  <[email protected]>
+
+        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:
+
+
 2018-09-17  Simon Fraser  <[email protected]>
 
         Add more Fullscreen logging

Added: trunk/Source/WebKit/Scripts/copy-webcontent-resources-to-private-headers.sh (0 => 236092)


--- trunk/Source/WebKit/Scripts/copy-webcontent-resources-to-private-headers.sh	                        (rev 0)
+++ trunk/Source/WebKit/Scripts/copy-webcontent-resources-to-private-headers.sh	2018-09-17 23:00:54 UTC (rev 236092)
@@ -0,0 +1,59 @@
+#!/bin/sh
+#
+# 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.
+
+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}"
+if [[ ${WK_PLATFORM_NAME} == "macosx" ]]; then
+    ENTITLEMENTS_FILE="${TEMP_FILE_DIR}/${FULL_PRODUCT_NAME}.xcent"
+else
+    ENTITLEMENTS_FILE="${SRCROOT}/Configurations/WebContent-iOS.entitlements"
+fi
+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
Property changes on: trunk/Source/WebKit/Scripts/copy-webcontent-resources-to-private-headers.sh
___________________________________________________________________

Added: svn:executable

+* \ No newline at end of property

Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (236091 => 236092)


--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2018-09-17 22:43:11 UTC (rev 236091)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2018-09-17 23:00:54 UTC (rev 236092)
@@ -3024,6 +3024,7 @@
 		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>"; };
 		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>"; };
@@ -8496,6 +8497,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 */,
@@ -9987,6 +9989,7 @@
 				BCDC308D15FDB99A006B6695 /* Frameworks */,
 				BC3DE46415A91763008D26FC /* Resources */,
 				7AFCBD5420B8911D00F55C9C /* Process WebContent entitlements */,
+				4157853721279CC600DD3800 /* Copy Custom WebContent Resources to Framework Private Headers */,
 			);
 			buildRules = (
 			);
@@ -10355,6 +10358,19 @@
 			shellPath = /bin/sh;
 			shellScript = "if [[ \"${WK_MANUAL_SANDBOXING_ENABLED}\" != \"YES\" || \"${WK_PLATFORM_NAME}\" == \"macosx\" || \"${WK_PLATFORM_NAME}\" == \"iosmac\" ]]; then\n    exit\nfi\n\nif [[ \"${ACTION}\" == \"build\" || \"${ACTION}\" == \"install\" ]]; then\n    for ((i = 0; i < ${SCRIPT_INPUT_FILE_COUNT}; ++i)); do\n        eval SANDBOX_PROFILE=\\${SCRIPT_INPUT_FILE_${i}}\n        ditto \"${SANDBOX_PROFILE}\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/${SANDBOX_PROFILE##*/}\"\n    done\nfi\n";
 		};
+		4157853721279CC600DD3800 /* Copy Custom WebContent Resources to Framework Private Headers */ = {
+			isa = PBXShellScriptBuildPhase;
+			buildActionMask = 2147483647;
+			inputPaths = (
+				"$(TEMP_FILE_DIR)/$(FULL_PRODUCT_NAME).xcent",
+				"$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)",
+				"$(SRCROOT)/Resources/WebContentProcess.xib",
+			);
+			name = "Copy Custom WebContent Resources to Framework Private Headers";
+			runOnlyForDeploymentPostprocessing = 0;
+			shellPath = /bin/sh;
+			shellScript = "Scripts/copy-webcontent-resources-to-private-headers.sh\n";
+		};
 		41D0FC7F20E43B0B00076AE8 /* Remove stale entitlements file */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to