[iOS] Libdispatch, Dyld, IOKit, Mach, NSPointerFunctions, MobileGestalt
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Nov 2014 21:59:03 +0000 (21:59 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Nov 2014 21:59:03 +0000 (21:59 +0000)
SPI are not available in public SDK
https://bugs.webkit.org/show_bug.cgi?id=138802

Reviewed by David Kilzer.

Source/WebCore:

Add SPI wrapper headers {Dispatch, DynamicLinker, IOPMLib, MachVM, NSPointerFunctions, MobileGestalt}SPI.h
that forward declare applicable libdispatch, dyld, IOKit, mach, Foundation, MobileGestalt SPI
and use these headers instead of the including private headers corresponding to these libraries/frameworks.

* WebCore.xcodeproj/project.pbxproj: Add private headers MobileGestaltSPI.h and
MachVMSPI.h, and project headers DynamicLinkerSPI.h, NSPointerFunctionsSPI.h,
DispatchSPI.h and IOPMLibSPI.h. Also, sort files in Xcode project.
* bindings/objc/DOMInternal.mm: Include header NSPointerFunctionsSPI.h.
* bridge/objc/objc_instance.mm: Ditto; Also, sort #import directives.
* platform/cocoa/DisplaySleepDisablerCocoa.cpp: Substitute header IOPMLibSPI.h
for private header IOKit/pwr_mgt/IOPMLib.h.
* platform/cocoa/MemoryPressureHandlerCocoa.mm: Substitute header DispatchSPI.h
for private header dispatch/private.h.
* platform/graphics/ios/FontServicesIOS.mm: Substitute header DynamicLinkerSPI.h
for private header mach-o/dyld_priv.h.
* platform/ios/PlatformScreenIOS.mm: Substitute header MobileGestaltSPI.h for
private header MobileGestalt.h.
* platform/spi/cocoa/DispatchSPI.h: Added.
* platform/spi/cocoa/DynamicLinkerSPI.h: Added.
* platform/spi/cocoa/IOPMLibSPI.h: Added.
* platform/spi/cocoa/MachVMSPI.h: Added.
* platform/spi/cocoa/NSPointerFunctionsSPI.h: Added.
* platform/spi/ios/MobileGestaltSPI.h: Added.

Source/WebKit/mac:

Include headers DispatchSPI.h and MobileGestaltSPI.h instead of including
libdispatch and MobileGestalt headers directly.

* WebView/WebView.mm:

Source/WebKit2:

Include headers DispatchSPI.h and MachVMSPI.h.h instead of including
libdispatch and Mach headers directly.

* Platform/mac/SharedMemoryMac.cpp:
* UIProcess/ios/WebMemoryPressureHandlerIOS.mm:

Tools:

Include header MachVMSPI.h instead of including the private header mach/mach_vm.h.

* DumpRenderTree/mac/CheckedMalloc.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176232 268f45cc-cd09-0410-ab3c-d52691b4dbfc

21 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/objc/DOMInternal.mm
Source/WebCore/bridge/objc/objc_instance.mm
Source/WebCore/platform/cocoa/DisplaySleepDisablerCocoa.cpp
Source/WebCore/platform/cocoa/MemoryPressureHandlerCocoa.mm
Source/WebCore/platform/graphics/ios/FontServicesIOS.mm
Source/WebCore/platform/ios/PlatformScreenIOS.mm
Source/WebCore/platform/spi/cocoa/DispatchSPI.h [new file with mode: 0644]
Source/WebCore/platform/spi/cocoa/DynamicLinkerSPI.h [new file with mode: 0644]
Source/WebCore/platform/spi/cocoa/IOPMLibSPI.h [new file with mode: 0644]
Source/WebCore/platform/spi/cocoa/MachVMSPI.h [new file with mode: 0644]
Source/WebCore/platform/spi/cocoa/NSPointerFunctionsSPI.h [new file with mode: 0644]
Source/WebCore/platform/spi/ios/MobileGestaltSPI.h [new file with mode: 0644]
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit2/ChangeLog
Source/WebKit2/Platform/mac/SharedMemoryMac.cpp
Source/WebKit2/UIProcess/ios/WebMemoryPressureHandlerIOS.mm
Tools/ChangeLog
Tools/DumpRenderTree/mac/CheckedMalloc.cpp

index b2a19f3..32b4ddb 100644 (file)
@@ -1,5 +1,37 @@
 2014-11-17  Daniel Bates  <dabates@apple.com>
 
+        [iOS] Libdispatch, Dyld, IOKit, Mach, NSPointerFunctions, MobileGestalt
+        SPI are not available in public SDK
+        https://bugs.webkit.org/show_bug.cgi?id=138802
+
+        Reviewed by David Kilzer.
+
+        Add SPI wrapper headers {Dispatch, DynamicLinker, IOPMLib, MachVM, NSPointerFunctions, MobileGestalt}SPI.h
+        that forward declare applicable libdispatch, dyld, IOKit, mach, Foundation, MobileGestalt SPI
+        and use these headers instead of the including private headers corresponding to these libraries/frameworks.
+
+        * WebCore.xcodeproj/project.pbxproj: Add private headers MobileGestaltSPI.h and
+        MachVMSPI.h, and project headers DynamicLinkerSPI.h, NSPointerFunctionsSPI.h,
+        DispatchSPI.h and IOPMLibSPI.h. Also, sort files in Xcode project.
+        * bindings/objc/DOMInternal.mm: Include header NSPointerFunctionsSPI.h.
+        * bridge/objc/objc_instance.mm: Ditto; Also, sort #import directives.
+        * platform/cocoa/DisplaySleepDisablerCocoa.cpp: Substitute header IOPMLibSPI.h
+        for private header IOKit/pwr_mgt/IOPMLib.h.
+        * platform/cocoa/MemoryPressureHandlerCocoa.mm: Substitute header DispatchSPI.h
+        for private header dispatch/private.h.
+        * platform/graphics/ios/FontServicesIOS.mm: Substitute header DynamicLinkerSPI.h
+        for private header mach-o/dyld_priv.h.
+        * platform/ios/PlatformScreenIOS.mm: Substitute header MobileGestaltSPI.h for
+        private header MobileGestalt.h.
+        * platform/spi/cocoa/DispatchSPI.h: Added.
+        * platform/spi/cocoa/DynamicLinkerSPI.h: Added.
+        * platform/spi/cocoa/IOPMLibSPI.h: Added.
+        * platform/spi/cocoa/MachVMSPI.h: Added.
+        * platform/spi/cocoa/NSPointerFunctionsSPI.h: Added.
+        * platform/spi/ios/MobileGestaltSPI.h: Added.
+
+2014-11-17  Daniel Bates  <dabates@apple.com>
+
         [iOS] CoreText and CoreUI SPI are not available in public SDK
         https://bugs.webkit.org/show_bug.cgi?id=138760
 
index 899ef51..1cb9c2f 100644 (file)
                CE12523F1A16AE1200864480 /* AVKitSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE12523E1A16AE1200864480 /* AVKitSPI.h */; };
                CE1252411A16B1B600864480 /* MPAVRoutingControllerSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE1252401A16B1B600864480 /* MPAVRoutingControllerSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
                CE1252431A16C01A00864480 /* CoreUISPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE1252421A16C01A00864480 /* CoreUISPI.h */; };
+               CE1252451A16C22500864480 /* DynamicLinkerSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE1252441A16C22500864480 /* DynamicLinkerSPI.h */; };
+               CE1252471A16C2C200864480 /* NSPointerFunctionsSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE1252461A16C2C200864480 /* NSPointerFunctionsSPI.h */; };
+               CE1252491A16C3BC00864480 /* MobileGestaltSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE1252481A16C3BC00864480 /* MobileGestaltSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               CE12524B1A16C79B00864480 /* DispatchSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE12524A1A16C79B00864480 /* DispatchSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               CE12524D1A1A77DE00864480 /* IOPMLibSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE12524C1A1A77DE00864480 /* IOPMLibSPI.h */; };
+               CE12524F1A1A78D200864480 /* MachVMSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE12524E1A1A78D200864480 /* MachVMSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
                CE7B2DB31586ABAD0098B3FA /* AlternativeTextUIController.h in Headers */ = {isa = PBXBuildFile; fileRef = CE7B2DAF1586ABAD0098B3FA /* AlternativeTextUIController.h */; settings = {ATTRIBUTES = (Private, ); }; };
                CE7B2DB41586ABAD0098B3FA /* AlternativeTextUIController.mm in Sources */ = {isa = PBXBuildFile; fileRef = CE7B2DB01586ABAD0098B3FA /* AlternativeTextUIController.mm */; };
                CE7B2DB51586ABAD0098B3FA /* TextAlternativeWithRange.h in Headers */ = {isa = PBXBuildFile; fileRef = CE7B2DB11586ABAD0098B3FA /* TextAlternativeWithRange.h */; settings = {ATTRIBUTES = (Private, ); }; };
                CE12523E1A16AE1200864480 /* AVKitSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AVKitSPI.h; path = ios/AVKitSPI.h; sourceTree = "<group>"; };
                CE1252401A16B1B600864480 /* MPAVRoutingControllerSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MPAVRoutingControllerSPI.h; path = ios/MPAVRoutingControllerSPI.h; sourceTree = "<group>"; };
                CE1252421A16C01A00864480 /* CoreUISPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CoreUISPI.h; path = ios/CoreUISPI.h; sourceTree = "<group>"; };
+               CE1252441A16C22500864480 /* DynamicLinkerSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DynamicLinkerSPI.h; sourceTree = "<group>"; };
+               CE1252461A16C2C200864480 /* NSPointerFunctionsSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSPointerFunctionsSPI.h; sourceTree = "<group>"; };
+               CE1252481A16C3BC00864480 /* MobileGestaltSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MobileGestaltSPI.h; path = ios/MobileGestaltSPI.h; sourceTree = "<group>"; };
+               CE12524A1A16C79B00864480 /* DispatchSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DispatchSPI.h; sourceTree = "<group>"; };
+               CE12524C1A1A77DE00864480 /* IOPMLibSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOPMLibSPI.h; sourceTree = "<group>"; };
+               CE12524E1A1A78D200864480 /* MachVMSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MachVMSPI.h; sourceTree = "<group>"; };
                CE5CB1B314EDAB6F00BB2795 /* EventSender.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventSender.h; sourceTree = "<group>"; };
                CE6D89294C7AACE0AD89B3DD /* MathMLMencloseElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathMLMencloseElement.h; sourceTree = "<group>"; };
                CE7B2DAF1586ABAD0098B3FA /* AlternativeTextUIController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AlternativeTextUIController.h; sourceTree = "<group>"; };
                        isa = PBXGroup;
                        children = (
                                1C5E980F1A02CEFA002DB55F /* CoreTextSPI.h */,
+                               CE12524A1A16C79B00864480 /* DispatchSPI.h */,
+                               CE1252441A16C22500864480 /* DynamicLinkerSPI.h */,
+                               CE12524C1A1A77DE00864480 /* IOPMLibSPI.h */,
+                               CE12524E1A1A78D200864480 /* MachVMSPI.h */,
                                2DDB97F319F9AECA002025D8 /* NSExtensionSPI.h */,
-                               653EF83819A043AE0052202C /* NSURLFileTypeMappingsSPI.h */,
                                CE12523A1A16711000864480 /* NSFileManagerSPI.h */,
+                               CE1252461A16C2C200864480 /* NSPointerFunctionsSPI.h */,
+                               653EF83819A043AE0052202C /* NSURLFileTypeMappingsSPI.h */,
                                CE12523C1A1676CD00864480 /* QuartzCoreSPI.h */,
                        );
                        path = cocoa;
                                CE12523E1A16AE1200864480 /* AVKitSPI.h */,
                                CE1252421A16C01A00864480 /* CoreUISPI.h */,
                                CE1252401A16B1B600864480 /* MPAVRoutingControllerSPI.h */,
+                               CE1252481A16C3BC00864480 /* MobileGestaltSPI.h */,
                                CE1252381A166FA000864480 /* QuickLookSPI.h */,
                        );
                        name = ios;
                                937FF3D51A1012D6008EBA31 /* DictionaryLookup.h in Headers */,
                                FDAF19991513D131008DB0C3 /* DirectConvolver.h in Headers */,
                                7EDAAFC919A2CCDC0034DFD1 /* DiskCacheMonitorCocoa.h in Headers */,
+                               CE12524B1A16C79B00864480 /* DispatchSPI.h in Headers */,
                                49AF2D6914435D050016A784 /* DisplayRefreshMonitor.h in Headers */,
                                2D29ECC6192ECC8300984B78 /* DisplayRefreshMonitorClient.h in Headers */,
                                2D29ECCA192F1F1D00984B78 /* DisplayRefreshMonitorIOS.h in Headers */,
                                81F65FF613788FAA00FF6F2D /* DragState.h in Headers */,
                                498770DC1242C535002226BA /* DrawingBuffer.h in Headers */,
                                E1BA66F11742BD8600C20251 /* DynamicLinkerInterposing.h in Headers */,
+                               CE1252451A16C22500864480 /* DynamicLinkerSPI.h in Headers */,
                                FD6ED2C8136B8E66003CF072 /* DynamicsCompressor.h in Headers */,
                                FD537357137B653B00008DCE /* DynamicsCompressorKernel.h in Headers */,
                                FD6ED2C4136B8E42003CF072 /* DynamicsCompressorNode.h in Headers */,
                                E134F5AB12EE343F004EC58D /* IntRectHash.h in Headers */,
                                B27535750B053814002CE64F /* IntSize.h in Headers */,
                                B27535760B053814002CE64F /* IntSizeHash.h in Headers */,
+                               CE12524D1A1A77DE00864480 /* IOPMLibSPI.h in Headers */,
                                2D0B4AAB18DA1CCD00434DE1 /* IOSurface.h in Headers */,
                                1C21E57D183ED1FF001C289D /* IOSurfacePool.h in Headers */,
                                07AC47021952102100EE9723 /* ISOVTTCue.h in Headers */,
                                BCE1C41B0D982980003B02F2 /* Location.h in Headers */,
                                A8239E0109B3CF8A00B60641 /* Logging.h in Headers */,
                                9BA273F4172206BB0097CE47 /* LogicalSelectionOffsetCaches.h in Headers */,
+                               CE12524F1A1A78D200864480 /* MachVMSPI.h in Headers */,
                                932AD70617EFA2C40038F8FF /* MainFrame.h in Headers */,
                                1A8F6BC60DB55CDC001DB794 /* ManifestParser.h in Headers */,
                                93309DF8099E64920056E581 /* markup.h in Headers */,
                                37DDCD9513844FD50008B793 /* MIMEHeader.h in Headers */,
                                BC772C4F0C4EB3040083285F /* MIMETypeRegistry.h in Headers */,
                                52F10866162B6DA8009AC81E /* MixedContentChecker.h in Headers */,
+                               CE1252491A16C3BC00864480 /* MobileGestaltSPI.h in Headers */,
                                CDF2B0111820540600F2B424 /* MockBox.h in Headers */,
                                CDF2B0131820540600F2B424 /* MockMediaPlayerMediaSource.h in Headers */,
                                CDF2B0151820540600F2B424 /* MockMediaSourcePrivate.h in Headers */,
                                2DDB97F419F9AECA002025D8 /* NSExtensionSPI.h in Headers */,
                                CE12523B1A16711000864480 /* NSFileManagerSPI.h in Headers */,
                                1C6466281A12C4200094603C /* NSFontSPI.h in Headers */,
+                               CE1252471A16C2C200864480 /* NSPointerFunctionsSPI.h in Headers */,
                                93500F3213FDE3BE0099EC24 /* NSScrollerImpDetails.h in Headers */,
                                2DCB837919F99BBA00A7FBE4 /* NSSharingServicePickerSPI.h in Headers */,
                                2DCB837A19F99BBA00A7FBE4 /* NSSharingServiceSPI.h in Headers */,
index 5e77361..853549d 100644 (file)
@@ -29,6 +29,7 @@
 #import "DOMNodeInternal.h"
 #import "Frame.h"
 #import "JSNode.h"
+#import "NSPointerFunctionsSPI.h"
 #import "ScriptController.h"
 #import "WebScriptObjectPrivate.h"
 #import "runtime_root.h"
index 015a6fb..96bef23 100644 (file)
 #import "config.h"
 #import "objc_instance.h"
 
-#import "runtime_method.h"
-#import <runtime/ObjectPrototype.h>
 #import "JSDOMBinding.h"
+#import "NSPointerFunctionsSPI.h"
 #import "ObjCRuntimeObject.h"
 #import "WebScriptObject.h"
+#import "runtime/FunctionPrototype.h"
+#import "runtime_method.h"
 #import <objc/objc-auto.h>
 #import <runtime/Error.h>
 #import <runtime/JSLock.h>
-#import "runtime/FunctionPrototype.h"
+#import <runtime/ObjectPrototype.h>
 #import <wtf/Assertions.h>
 
 #if PLATFORM(IOS)
 #import <Foundation/NSMapTable.h>
-#endif // PLATFORM(IOS)
+#endif
 
 #ifdef NDEBUG
 #define OBJC_LOG(formatAndArgs...) ((void)0)
index 7ee2e08..ab9e231 100644 (file)
@@ -28,7 +28,7 @@
 
 #if PLATFORM(COCOA)
 
-#include <IOKit/pwr_mgt/IOPMLib.h>
+#include "IOPMLibSPI.h"
 #include <wtf/RetainPtr.h>
 
 namespace WebCore {
index 804250a..3441aba 100644 (file)
@@ -26,6 +26,7 @@
 #import "config.h"
 #import "MemoryPressureHandler.h"
 
+#import "DispatchSPI.h"
 #import "IOSurfacePool.h"
 #import "GCController.h"
 #import "JSDOMWindowBase.h"
@@ -41,7 +42,6 @@
 #if PLATFORM(IOS)
 #import "SystemMemory.h"
 #import "WebCoreThread.h"
-#import <dispatch/private.h>
 #endif
 
 namespace WebCore {
index 819c362..15483c1 100644 (file)
@@ -26,8 +26,8 @@
 #import "FontServicesIOS.h"
 
 #import "CoreGraphicsSPI.h"
+#import "DynamicLinkerSPI.h"
 #import "FontMetrics.h"
-#import <mach-o/dyld_priv.h>
 #import <wtf/RetainPtr.h>
 
 namespace WebCore {
index 7389f27..a208fe9 100644 (file)
 #import "FrameView.h"
 #import "HostWindow.h"
 #import "IntRect.h"
+#import "MobileGestaltSPI.h"
 #import "SoftLinking.h"
 #import "WAKWindow.h"
 #import "WebCoreSystemInterface.h"
 #import "Widget.h"
-#import <MobileGestalt.h>
 
 SOFT_LINK_FRAMEWORK(UIKit)
 SOFT_LINK(UIKit, UIAccessibilityIsGrayscaleEnabled, bool, (void), ())
diff --git a/Source/WebCore/platform/spi/cocoa/DispatchSPI.h b/Source/WebCore/platform/spi/cocoa/DispatchSPI.h
new file mode 100644 (file)
index 0000000..9581ce0
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2014 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.
+ */
+
+#ifndef DispatchSPI_h
+#define DispatchSPI_h
+
+#include <dispatch/dispatch.h>
+
+#if USE(APPLE_INTERNAL_SDK)
+
+// FIXME: As a workaround for <rdar://problem/18337182>, we conditionally enclose the header
+// <dispatch/private.h> in an extern "C" linkage block to make it suitable for C++ use.
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <dispatch/private.h>
+
+#ifdef __cplusplus
+}
+#endif
+
+#else // USE(APPLE_INTERNAL_SDK)
+
+enum {
+    DISPATCH_MEMORYSTATUS_PRESSURE_NORMAL = 0x01,
+    DISPATCH_MEMORYSTATUS_PRESSURE_WARN = 0x02,
+    DISPATCH_MEMORYSTATUS_PRESSURE_CRITICAL = 0x04,
+};
+#define DISPATCH_SOURCE_TYPE_MEMORYSTATUS (&_dispatch_source_type_memorystatus)
+
+#endif
+
+EXTERN_C const struct dispatch_source_type_s _dispatch_source_type_memorystatus;
+
+#endif // DispatchSPI_h
diff --git a/Source/WebCore/platform/spi/cocoa/DynamicLinkerSPI.h b/Source/WebCore/platform/spi/cocoa/DynamicLinkerSPI.h
new file mode 100644 (file)
index 0000000..460da91
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2014 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.
+ */
+
+#ifndef DynamicLinkerSPI_h
+#define DynamicLinkerSPI_h
+
+#include <mach-o/dyld.h>
+
+#if USE(APPLE_INTERNAL_SDK)
+
+#include <mach-o/dyld_priv.h>
+
+#else
+
+#define DYLD_IOS_VERSION_3_0 0x00030000
+#define DYLD_IOS_VERSION_6_0 0x00060000;
+#define DYLD_IOS_VERSION_7_0 0x00070000;
+
+#endif
+
+EXTERN_C uint32_t dyld_get_program_sdk_version();
+
+#endif // DynamicLinkerSPI_h
diff --git a/Source/WebCore/platform/spi/cocoa/IOPMLibSPI.h b/Source/WebCore/platform/spi/cocoa/IOPMLibSPI.h
new file mode 100644 (file)
index 0000000..6a03a5f
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2014 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.
+ */
+
+#ifndef IOPMLibSPI_h
+#define IOPMLibSPI_h
+
+#include <CoreFoundation/CoreFoundation.h>
+
+#if PLATFORM(MAC) || USE(APPLE_INTERNAL_SDK)
+
+#include <IOKit/pwr_mgt/IOPMLib.h>
+
+#else
+
+#include <mach/kern_return.h>
+
+typedef kern_return_t IOReturn;
+typedef uint32_t IOPMAssertionID;
+
+EXTERN_C const CFStringRef kIOPMAssertionTypePreventUserIdleDisplaySleep = CFSTR("PreventUserIdleDisplaySleep");
+
+#endif
+
+EXTERN_C IOReturn IOPMAssertionCreateWithDescription(CFStringRef assertionType, CFStringRef name, CFStringRef details, CFStringRef humanReadableReason,
+                                                     CFStringRef localizationBundlePath, CFTimeInterval timeout, CFStringRef timeoutAction, IOPMAssertionID *);
+EXTERN_C IOReturn IOPMAssertionRelease(IOPMAssertionID);
+
+#endif // IOPMLibSPI_h
diff --git a/Source/WebCore/platform/spi/cocoa/MachVMSPI.h b/Source/WebCore/platform/spi/cocoa/MachVMSPI.h
new file mode 100644 (file)
index 0000000..17901b1
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2014 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.
+ */
+
+#ifndef MachVMSPI_h
+#define MachVMSPI_h
+
+#include <mach/boolean.h>
+#include <mach/kern_return.h>
+#include <mach/mach_types.h>
+
+#if PLATFORM(MAC) || USE(APPLE_INTERNAL_SDK)
+#include <mach/mach_vm.h>
+#endif
+
+EXTERN_C kern_return_t mach_vm_allocate(vm_map_t target, mach_vm_address_t*, mach_vm_size_t, int flags);
+EXTERN_C kern_return_t mach_vm_deallocate(vm_map_t target, mach_vm_address_t, mach_vm_size_t);
+EXTERN_C kern_return_t mach_vm_map(vm_map_t targetTask, mach_vm_address_t*, mach_vm_size_t, mach_vm_offset_t mask, int flags,
+                                   mem_entry_name_port_t, memory_object_offset_t, boolean_t copy, vm_prot_t currentProtection, vm_prot_t maximumProtection, vm_inherit_t);
+EXTERN_C kern_return_t mach_vm_protect(vm_map_t targetTask, mach_vm_address_t, mach_vm_size_t, boolean_t setMaximum, vm_prot_t newProtection);
+EXTERN_C kern_return_t mach_vm_region(vm_map_t targetTask, mach_vm_address_t*, mach_vm_size_t*, vm_region_flavor_t, vm_region_info_t,
+                                      mach_msg_type_number_t* infoCount, mach_port_t* objectName);
+
+#endif // MachVMSPI_h
diff --git a/Source/WebCore/platform/spi/cocoa/NSPointerFunctionsSPI.h b/Source/WebCore/platform/spi/cocoa/NSPointerFunctionsSPI.h
new file mode 100644 (file)
index 0000000..9079ef0
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2014 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.
+ */
+
+#ifndef NSPointerFunctionsSPI_h
+#define NSPointerFunctionsSPI_h
+
+#include <Foundation/NSPointerFunctions.h>
+
+#if !USE(APPLE_INTERNAL_SDK)
+
+enum {
+    NSPointerFunctionsZeroingWeakMemory = 1UL << 0,
+};
+
+#endif
+
+#endif // NSPointerFunctionsSPI_h
diff --git a/Source/WebCore/platform/spi/ios/MobileGestaltSPI.h b/Source/WebCore/platform/spi/ios/MobileGestaltSPI.h
new file mode 100644 (file)
index 0000000..53d03c5
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2014 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.
+ */
+
+#ifndef MobileGestaltSPI_h
+#define MobileGestaltSPI_h
+
+#include <CoreFoundation/CoreFoundation.h>
+
+#if USE(APPLE_INTERNAL_SDK)
+
+#include <MobileGestalt.h>
+
+#else
+
+EXTERN_C const CFStringRef kMGQAppleInternalInstallCapability = CFSTR("apple-internal-install");
+EXTERN_C const CFStringRef kMGQMainScreenPitch = CFSTR("main-screen-pitch");
+EXTERN_C const CFStringRef kMGQMainScreenScale = CFSTR("main-screen-scale");
+
+#endif
+
+EXTERN_C CFTypeRef MGCopyAnswer(CFStringRef question, CFDictionaryRef options);
+
+#ifndef MGGetBoolAnswer
+EXTERN_C bool MGGetBoolAnswer(CFStringRef question);
+#endif
+
+#endif // MobileGestaltSPI_h
index 61072a2..d97ee0d 100644 (file)
@@ -1,3 +1,16 @@
+2014-11-17  Daniel Bates  <dabates@apple.com>
+
+        [iOS] Libdispatch, Dyld, IOKit, Mach, NSPointerFunctions, MobileGestalt
+        SPI are not available in public SDK
+        https://bugs.webkit.org/show_bug.cgi?id=138802
+
+        Reviewed by David Kilzer.
+
+        Include headers DispatchSPI.h and MobileGestaltSPI.h instead of including
+        libdispatch and MobileGestalt headers directly.
+
+        * WebView/WebView.mm:
+
 2014-11-17  Beth Dakin  <bdakin@apple.com>
 
         Whitespace action menus should focus the HitTestResult and create an insertion 
index c402696..1377430 100644 (file)
 #import "WebUIKitSupport.h"
 #import "WebVisiblePosition.h"
 #import <CFNetwork/CFURLCachePriv.h>
-#import <MobileGestalt.h>
+#import <WebCore/DispatchSPI.h>
 #import <WebCore/EventNames.h>
 #import <WebCore/FontCache.h>
 #import <WebCore/GraphicsLayer.h>
 #import <WebCore/IconController.h>
 #import <WebCore/LegacyTileCache.h>
+#import <WebCore/MobileGestaltSPI.h>
 #import <WebCore/NetworkStateNotifier.h>
 #import <WebCore/RuntimeApplicationChecksIOS.h>
 #import <WebCore/SQLiteDatabaseTracker.h>
 #import <WebCore/WebCoreThreadRun.h>
 #import <WebCore/WebEvent.h>
 #import <WebCore/WebVideoFullscreenControllerAVKit.h>
-#import <dispatch/private.h>
 #import <wtf/FastMalloc.h>
 #endif // !PLATFORM(IOS)
 
index 6d98417..1a722ca 100644 (file)
@@ -1,5 +1,19 @@
 2014-11-17  Daniel Bates  <dabates@apple.com>
 
+        [iOS] Libdispatch, Dyld, IOKit, Mach, NSPointerFunctions, MobileGestalt
+        SPI are not available in public SDK
+        https://bugs.webkit.org/show_bug.cgi?id=138802
+
+        Reviewed by David Kilzer.
+
+        Include headers DispatchSPI.h and MachVMSPI.h.h instead of including
+        libdispatch and Mach headers directly.
+
+        * Platform/mac/SharedMemoryMac.cpp:
+        * UIProcess/ios/WebMemoryPressureHandlerIOS.mm:
+
+2014-11-17  Daniel Bates  <dabates@apple.com>
+
         [iOS] CoreText and CoreUI SPI are not available in public SDK
         https://bugs.webkit.org/show_bug.cgi?id=138760
 
index ff7ab9f..c4ce321 100644 (file)
@@ -30,9 +30,9 @@
 #include "ArgumentEncoder.h"
 #include "Arguments.h"
 #include "MachPort.h"
+#include <WebCore/MachVMSPI.h>
 #include <mach/mach_error.h>
 #include <mach/mach_port.h>
-#include <mach/mach_vm.h>
 #include <mach/vm_map.h>
 #include <wtf/RefPtr.h>
 
index 523d0c8..bdd2363 100644 (file)
@@ -29,7 +29,7 @@
 #if PLATFORM(IOS)
 
 #import "ViewSnapshotStore.h"
-#import <dispatch/private.h>
+#import <WebCore/DispatchSPI.h>
 
 namespace WebKit {
 
index e2a5962..35c8e84 100644 (file)
@@ -1,3 +1,15 @@
+2014-11-17  Daniel Bates  <dabates@apple.com>
+
+        [iOS] Libdispatch, Dyld, IOKit, Mach, NSPointerFunctions, MobileGestalt
+        SPI are not available in public SDK
+        https://bugs.webkit.org/show_bug.cgi?id=138802
+
+        Reviewed by David Kilzer.
+
+        Include header MachVMSPI.h instead of including the private header mach/mach_vm.h.
+
+        * DumpRenderTree/mac/CheckedMalloc.cpp:
+
 2014-11-17  Jake Nielsen  <jacob_nielsen@apple.com>
 
         Having 30+ flaky failures breaks EWS
index ac8887e..a461d30 100644 (file)
@@ -31,8 +31,8 @@
 #import "config.h" 
 #import "CheckedMalloc.h"
 
+#import <WebCore/MachVMSPI.h>
 #import <mach/mach_init.h>
-#import <mach/mach_vm.h>
 #import <mach/vm_region.h>
 #import <malloc/malloc.h>
 #import <unistd.h>