Title: [193783] trunk/Source
Revision
193783
Author
joep...@webkit.org
Date
2015-12-08 13:49:26 -0800 (Tue, 08 Dec 2015)

Log Message

Create a Sandbox SPI header
https://bugs.webkit.org/show_bug.cgi?id=151981

Reviewed by Andy Estes.

Source/_javascript_Core:

* inspector/remote/RemoteInspector.mm:

Source/WebKit2:

* PluginProcess/mac/PluginProcessShim.mm:
* Shared/ios/ChildProcessIOS.mm:
* Shared/mac/ChildProcessMac.mm:
* Shared/mac/SandboxUtilities.mm:

Source/WTF:

* WTF.xcodeproj/project.pbxproj:
* wtf/spi/darwin/SandboxSPI.h: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (193782 => 193783)


--- trunk/Source/_javascript_Core/ChangeLog	2015-12-08 21:45:54 UTC (rev 193782)
+++ trunk/Source/_javascript_Core/ChangeLog	2015-12-08 21:49:26 UTC (rev 193783)
@@ -1,3 +1,12 @@
+2015-12-08  Joseph Pecoraro  <pecor...@apple.com>
+
+        Create a Sandbox SPI header
+        https://bugs.webkit.org/show_bug.cgi?id=151981
+
+        Reviewed by Andy Estes.
+
+        * inspector/remote/RemoteInspector.mm:
+
 2015-12-08  Filip Pizlo  <fpi...@apple.com>
 
         DFG::UnificationPhase should merge isProfitableToUnbox, since this may have been set in ByteCodeParser

Modified: trunk/Source/_javascript_Core/inspector/remote/RemoteInspector.mm (193782 => 193783)


--- trunk/Source/_javascript_Core/inspector/remote/RemoteInspector.mm	2015-12-08 21:45:54 UTC (rev 193782)
+++ trunk/Source/_javascript_Core/inspector/remote/RemoteInspector.mm	2015-12-08 21:49:26 UTC (rev 193783)
@@ -39,20 +39,10 @@
 #import <wtf/Assertions.h>
 #import <wtf/MainThread.h>
 #import <wtf/NeverDestroyed.h>
+#import <wtf/spi/darwin/SandboxSPI.h>
 #import <wtf/spi/darwin/XPCSPI.h>
 #import <wtf/text/WTFString.h>
 
-#if __has_include(<sandbox/private.h>)
-#import <sandbox/private.h>
-#else
-enum sandbox_filter_type {
-    SANDBOX_FILTER_GLOBAL_NAME = 2,
-};
-#endif
-
-extern "C" int sandbox_check(pid_t, const char *operation, enum sandbox_filter_type, ...);
-extern "C" const enum sandbox_filter_type SANDBOX_CHECK_NO_REPORT;
-
 namespace Inspector {
 
 static bool canAccessWebInspectorMachPort()

Modified: trunk/Source/WTF/ChangeLog (193782 => 193783)


--- trunk/Source/WTF/ChangeLog	2015-12-08 21:45:54 UTC (rev 193782)
+++ trunk/Source/WTF/ChangeLog	2015-12-08 21:49:26 UTC (rev 193783)
@@ -1,3 +1,13 @@
+2015-12-08  Joseph Pecoraro  <pecor...@apple.com>
+
+        Create a Sandbox SPI header
+        https://bugs.webkit.org/show_bug.cgi?id=151981
+
+        Reviewed by Andy Estes.
+
+        * WTF.xcodeproj/project.pbxproj:
+        * wtf/spi/darwin/SandboxSPI.h: Added.
+
 2015-12-07  Filip Pizlo  <fpi...@apple.com>
 
         FTL B3 should be able to flag the tag constants as being super important so that B3 can hoist them and Air can force them into registers

Modified: trunk/Source/WTF/WTF.xcodeproj/project.pbxproj (193782 => 193783)


--- trunk/Source/WTF/WTF.xcodeproj/project.pbxproj	2015-12-08 21:45:54 UTC (rev 193782)
+++ trunk/Source/WTF/WTF.xcodeproj/project.pbxproj	2015-12-08 21:49:26 UTC (rev 193783)
@@ -114,6 +114,7 @@
 		974CFC8E16A4F327006D5404 /* WeakPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 974CFC8D16A4F327006D5404 /* WeakPtr.h */; };
 		9BC70F05176C379D00101DEC /* AtomicStringTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9BC70F04176C379D00101DEC /* AtomicStringTable.cpp */; };
 		9BD8F40B176C2B470002D865 /* AtomicStringTable.h in Headers */ = {isa = PBXBuildFile; fileRef = 9BD8F40A176C2AD80002D865 /* AtomicStringTable.h */; };
+		A5098B001C169E0700087797 /* SandboxSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A5098AFF1C169E0700087797 /* SandboxSPI.h */; };
 		A5BA15F3182433A900A82E69 /* StringMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15F2182433A900A82E69 /* StringMac.mm */; };
 		A5BA15F51824348000A82E69 /* StringImplMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15F41824348000A82E69 /* StringImplMac.mm */; };
 		A5BA15FA182435A600A82E69 /* AtomicStringImplCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A5BA15F7182435A600A82E69 /* AtomicStringImplCF.cpp */; };
@@ -420,6 +421,7 @@
 		974CFC8D16A4F327006D5404 /* WeakPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WeakPtr.h; sourceTree = "<group>"; };
 		9BC70F04176C379D00101DEC /* AtomicStringTable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AtomicStringTable.cpp; sourceTree = "<group>"; };
 		9BD8F40A176C2AD80002D865 /* AtomicStringTable.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AtomicStringTable.h; sourceTree = "<group>"; };
+		A5098AFF1C169E0700087797 /* SandboxSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SandboxSPI.h; sourceTree = "<group>"; };
 		A5BA15F2182433A900A82E69 /* StringMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = StringMac.mm; path = mac/StringMac.mm; sourceTree = "<group>"; };
 		A5BA15F41824348000A82E69 /* StringImplMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = StringImplMac.mm; path = mac/StringImplMac.mm; sourceTree = "<group>"; };
 		A5BA15F7182435A600A82E69 /* AtomicStringImplCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AtomicStringImplCF.cpp; path = cf/AtomicStringImplCF.cpp; sourceTree = "<group>"; };
@@ -1057,6 +1059,7 @@
 			isa = PBXGroup;
 			children = (
 				DE5A09FB1BA36992003D4424 /* CommonCryptoSPI.h */,
+				A5098AFF1C169E0700087797 /* SandboxSPI.h */,
 				CE73E02419DCB7AB00580D5C /* XPCSPI.h */,
 			);
 			path = darwin;
@@ -1274,6 +1277,7 @@
 				A8A4747D151A825B004123FF /* ValueCheck.h in Headers */,
 				A8A4747E151A825B004123FF /* Vector.h in Headers */,
 				A8A4747F151A825B004123FF /* VectorTraits.h in Headers */,
+				A5098B001C169E0700087797 /* SandboxSPI.h in Headers */,
 				A8A47480151A825B004123FF /* VMTags.h in Headers */,
 				974CFC8E16A4F327006D5404 /* WeakPtr.h in Headers */,
 				1FA47C8B152502DA00568D1B /* WebCoreThread.h in Headers */,

Added: trunk/Source/WTF/wtf/spi/darwin/SandboxSPI.h (0 => 193783)


--- trunk/Source/WTF/wtf/spi/darwin/SandboxSPI.h	                        (rev 0)
+++ trunk/Source/WTF/wtf/spi/darwin/SandboxSPI.h	2015-12-08 21:49:26 UTC (rev 193783)
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2015 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. ``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
+ * 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.
+ */
+
+#ifndef SandboxSPI_h
+#define SandboxSPI_h
+
+#if OS(DARWIN)
+
+#import <sandbox.h>
+
+#if USE(APPLE_INTERNAL_SDK)
+#import <sandbox/private.h>
+#else
+enum sandbox_filter_type {
+    SANDBOX_FILTER_NONE,
+    SANDBOX_FILTER_GLOBAL_NAME = 2,
+};
+
+#define SANDBOX_NAMED_EXTERNAL 0x0003
+#endif
+
+EXTERN_C const enum sandbox_filter_type SANDBOX_CHECK_NO_REPORT;
+EXTERN_C int sandbox_check(pid_t, const char *operation, enum sandbox_filter_type, ...);
+EXTERN_C int sandbox_container_path_for_pid(pid_t, char *buffer, size_t bufsize);
+EXTERN_C int sandbox_init_with_parameters(const char *profile, uint64_t flags, const char *const parameters[], char **errorbuf);
+
+#endif // OS(DARWIN)
+
+#endif // SandboxSPI_h

Modified: trunk/Source/WebKit2/ChangeLog (193782 => 193783)


--- trunk/Source/WebKit2/ChangeLog	2015-12-08 21:45:54 UTC (rev 193782)
+++ trunk/Source/WebKit2/ChangeLog	2015-12-08 21:49:26 UTC (rev 193783)
@@ -1,3 +1,15 @@
+2015-12-08  Joseph Pecoraro  <pecor...@apple.com>
+
+        Create a Sandbox SPI header
+        https://bugs.webkit.org/show_bug.cgi?id=151981
+
+        Reviewed by Andy Estes.
+
+        * PluginProcess/mac/PluginProcessShim.mm:
+        * Shared/ios/ChildProcessIOS.mm:
+        * Shared/mac/ChildProcessMac.mm:
+        * Shared/mac/SandboxUtilities.mm:
+
 2015-12-08  Eric Carlson  <eric.carl...@apple.com>
 
         [MediaStream] Rename UserMediaClient and UserMediaController methods

Modified: trunk/Source/WebKit2/PluginProcess/mac/PluginProcessShim.mm (193782 => 193783)


--- trunk/Source/WebKit2/PluginProcess/mac/PluginProcessShim.mm	2015-12-08 21:45:54 UTC (rev 193782)
+++ trunk/Source/WebKit2/PluginProcess/mac/PluginProcessShim.mm	2015-12-08 21:49:26 UTC (rev 193783)
@@ -32,23 +32,13 @@
 #import <Carbon/Carbon.h>
 #import <WebCore/DynamicLinkerInterposing.h>
 #import <WebKitSystemInterface.h>
-#import <stdio.h>
 #import <objc/message.h>
+#import <stdio.h>
+#import <sys/ipc.h>
+#import <sys/mman.h>
+#import <sys/shm.h>
+#import <wtf/spi/darwin/SandboxSPI.h>
 
-#include <sys/shm.h>
-#include <sys/ipc.h>
-#include <sys/mman.h>
-
-#undef __APPLE_API_PRIVATE
-#include <sandbox.h>
-
-#ifndef _SANDBOX_PRIVATE_H_
-enum sandbox_filter_type {
-        SANDBOX_FILTER_NONE,
-};
-extern "C" int sandbox_check(pid_t pid, const char *operation, enum sandbox_filter_type type, ...);
-#endif
-
 namespace WebKit {
 
 extern "C" void WebKitPluginProcessShimInitialize(const PluginProcessShimCallbacks& callbacks);

Modified: trunk/Source/WebKit2/Shared/ios/ChildProcessIOS.mm (193782 => 193783)


--- trunk/Source/WebKit2/Shared/ios/ChildProcessIOS.mm	2015-12-08 21:45:54 UTC (rev 193782)
+++ trunk/Source/WebKit2/Shared/ios/ChildProcessIOS.mm	2015-12-08 21:49:26 UTC (rev 193783)
@@ -32,6 +32,7 @@
 #import "SandboxInitializationParameters.h"
 #import "WebKitSystemInterface.h"
 #import <WebCore/FileSystem.h>
+#import <WebCore/FloatingPointEnvironment.h>
 #import <WebCore/SystemVersion.h>
 #import <mach/mach.h>
 #import <mach/task.h>
@@ -39,17 +40,8 @@
 #import <stdlib.h>
 #import <sysexits.h>
 
-#import <WebCore/FloatingPointEnvironment.h> 
-
 #if ENABLE(MANUAL_SANDBOXING)
-
-// We have to #undef __APPLE_API_PRIVATE to prevent sandbox.h from looking for a header file that does not exist (<rdar://problem/9679211>).
-#undef __APPLE_API_PRIVATE
-#import <sandbox.h>
-
-#define SANDBOX_NAMED_EXTERNAL 0x0003
-extern "C" int sandbox_init_with_parameters(const char *profile, uint64_t flags, const char *const parameters[], char **errorbuf);
-
+#import <wtf/spi/darwin/SandboxSPI.h>
 #endif
 
 using namespace WebCore;

Modified: trunk/Source/WebKit2/Shared/mac/ChildProcessMac.mm (193782 => 193783)


--- trunk/Source/WebKit2/Shared/mac/ChildProcessMac.mm	2015-12-08 21:45:54 UTC (rev 193782)
+++ trunk/Source/WebKit2/Shared/mac/ChildProcessMac.mm	2015-12-08 21:49:26 UTC (rev 193783)
@@ -38,14 +38,8 @@
 #import <pwd.h>
 #import <stdlib.h>
 #import <sysexits.h>
+#import <wtf/spi/darwin/SandboxSPI.h>
 
-// We have to #undef __APPLE_API_PRIVATE to prevent sandbox.h from looking for a header file that does not exist (<rdar://problem/9679211>). 
-#undef __APPLE_API_PRIVATE
-#import <sandbox.h>
-
-#define SANDBOX_NAMED_EXTERNAL 0x0003
-extern "C" int sandbox_init_with_parameters(const char *profile, uint64_t flags, const char *const parameters[], char **errorbuf);
-
 #ifdef __has_include
 #if __has_include(<HIServices/ProcessesPriv.h>)
 #include <HIServices/ProcessesPriv.h>

Modified: trunk/Source/WebKit2/Shared/mac/SandboxUtilities.mm (193782 => 193783)


--- trunk/Source/WebKit2/Shared/mac/SandboxUtilities.mm	2015-12-08 21:45:54 UTC (rev 193782)
+++ trunk/Source/WebKit2/Shared/mac/SandboxUtilities.mm	2015-12-08 21:49:26 UTC (rev 193783)
@@ -29,20 +29,9 @@
 #import <WebCore/SecuritySPI.h>
 #import <array>
 #import <sys/param.h>
+#import <wtf/spi/darwin/SandboxSPI.h>
 #import <wtf/text/WTFString.h>
 
-#if __has_include(<sandbox/private.h>)
-#import <sandbox/private.h>
-#else
-enum sandbox_filter_type {
-    SANDBOX_FILTER_NONE,
-};
-extern "C" {
-int sandbox_check(pid_t, const char *operation, enum sandbox_filter_type, ...);
-int sandbox_container_path_for_pid(pid_t, char *buffer, size_t bufsize);
-}
-#endif
-
 namespace WebKit {
 
 bool processIsSandboxed(pid_t pid)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to