<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[169176] trunk/Source/WebKit2</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/169176">169176</a></dd>
<dt>Author</dt> <dd>oliver@apple.com</dd>
<dt>Date</dt> <dd>2014-05-21 13:52:21 -0700 (Wed, 21 May 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>[iOS] Enable sandboxing for the database process
https://bugs.webkit.org/show_bug.cgi?id=132963
Reviewed by Alexey Proskuryakov.
Simply ensure that the database process is running in a tight
sandbox. As part of this i've separated out ChildProcessIOS
and ensures that the database process loads a custom sandbox.
* Configurations/WebKit.xcconfig:
* DatabaseProcess/ios/DatabaseProcessIOS.mm:
(WebKit::DatabaseProcess::initializeSandbox):
* DatabaseProcess/ios/com.apple.WebKit.DatabasesIOS.sb: Added.
* Shared/ios/ChildProcessIOS.mm: Added.
Essentially cloned from the Mac version, only all the OSX
specific logic has been stripped.
(WebKit::ChildProcess::setApplicationIsDaemon):
(WebKit::ChildProcess::platformInitialize):
(WebKit::ChildProcess::initializeSandbox):
(WebKit::ChildProcess::setQOS):
* Shared/mac/ChildProcessMac.mm:
Remove all the IOS ifdefs.
(WebKit::ChildProcess::setApplicationIsDaemon):
(WebKit::ChildProcess::platformInitialize):
(WebKit::ChildProcess::initializeSandbox):
(WebKit::ChildProcess::setQOS):
* WebKit2.xcodeproj/project.pbxproj:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2ConfigurationsWebKitxcconfig">trunk/Source/WebKit2/Configurations/WebKit.xcconfig</a></li>
<li><a href="#trunkSourceWebKit2DatabaseProcessiosDatabaseProcessIOSmm">trunk/Source/WebKit2/DatabaseProcess/ios/DatabaseProcessIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2SharedmacChildProcessMacmm">trunk/Source/WebKit2/Shared/mac/ChildProcessMac.mm</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2DatabaseProcessioscomappleWebKitDatabasesIOSsb">trunk/Source/WebKit2/DatabaseProcess/ios/com.apple.WebKit.DatabasesIOS.sb</a></li>
<li><a href="#trunkSourceWebKit2SharediosChildProcessIOSmm">trunk/Source/WebKit2/Shared/ios/ChildProcessIOS.mm</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (169175 => 169176)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-05-21 20:39:36 UTC (rev 169175)
+++ trunk/Source/WebKit2/ChangeLog        2014-05-21 20:52:21 UTC (rev 169176)
</span><span class="lines">@@ -1,3 +1,33 @@
</span><ins>+2014-05-21 Oliver Hunt <oliver@apple.com>
+
+ [iOS] Enable sandboxing for the database process
+ https://bugs.webkit.org/show_bug.cgi?id=132963
+
+ Reviewed by Alexey Proskuryakov.
+
+ Simply ensure that the database process is running in a tight
+ sandbox. As part of this i've separated out ChildProcessIOS
+ and ensures that the database process loads a custom sandbox.
+
+ * Configurations/WebKit.xcconfig:
+ * DatabaseProcess/ios/DatabaseProcessIOS.mm:
+ (WebKit::DatabaseProcess::initializeSandbox):
+ * DatabaseProcess/ios/com.apple.WebKit.DatabasesIOS.sb: Added.
+ * Shared/ios/ChildProcessIOS.mm: Added.
+ Essentially cloned from the Mac version, only all the OSX
+ specific logic has been stripped.
+ (WebKit::ChildProcess::setApplicationIsDaemon):
+ (WebKit::ChildProcess::platformInitialize):
+ (WebKit::ChildProcess::initializeSandbox):
+ (WebKit::ChildProcess::setQOS):
+ * Shared/mac/ChildProcessMac.mm:
+ Remove all the IOS ifdefs.
+ (WebKit::ChildProcess::setApplicationIsDaemon):
+ (WebKit::ChildProcess::platformInitialize):
+ (WebKit::ChildProcess::initializeSandbox):
+ (WebKit::ChildProcess::setQOS):
+ * WebKit2.xcodeproj/project.pbxproj:
+
</ins><span class="cx"> 2014-05-21 Andy Estes <aestes@apple.com>
</span><span class="cx">
</span><span class="cx"> [iOS] Create a UIPrintFormatter for WKWebView
</span></span></pre></div>
<a id="trunkSourceWebKit2ConfigurationsWebKitxcconfig"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Configurations/WebKit.xcconfig (169175 => 169176)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Configurations/WebKit.xcconfig        2014-05-21 20:39:36 UTC (rev 169175)
+++ trunk/Source/WebKit2/Configurations/WebKit.xcconfig        2014-05-21 20:52:21 UTC (rev 169176)
</span><span class="lines">@@ -43,7 +43,7 @@
</span><span class="cx"> OTHER_LDFLAGS_macosx = $(ASAN_OTHER_LDFLAGS) $(FRAMEWORK_AND_LIBRARY_LDFLAGS) -framework WebCore -sub_umbrella WebCore -framework WebKitLegacy -sub_umbrella WebKitLegacy;
</span><span class="cx">
</span><span class="cx"> EXCLUDED_SOURCE_FILE_NAMES = $(EXCLUDED_SOURCE_FILE_NAMES_$(PLATFORM_NAME));
</span><del>-EXCLUDED_SOURCE_FILE_NAMES_iphoneos = *.pdf com.apple.WebKit.DatabaseProcess.sb com.apple.WebKit.NetworkProcess.sb com.apple.WebProcess.sb PlugInSandboxProfiles/*.sb;
</del><ins>+EXCLUDED_SOURCE_FILE_NAMES_iphoneos = *.pdf com.apple.WebKit.Databases.sb com.apple.WebKit.NetworkProcess.sb com.apple.WebProcess.sb PlugInSandboxProfiles/*.sb;
</ins><span class="cx"> EXCLUDED_SOURCE_FILE_NAMES_iphonesimulator = $(EXCLUDED_SOURCE_FILE_NAMES_iphoneos);
</span><span class="cx">
</span><span class="cx"> INSTALLHDRS_SCRIPT_PHASE = YES;
</span></span></pre></div>
<a id="trunkSourceWebKit2DatabaseProcessiosDatabaseProcessIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DatabaseProcess/ios/DatabaseProcessIOS.mm (169175 => 169176)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DatabaseProcess/ios/DatabaseProcessIOS.mm        2014-05-21 20:39:36 UTC (rev 169175)
+++ trunk/Source/WebKit2/DatabaseProcess/ios/DatabaseProcessIOS.mm        2014-05-21 20:52:21 UTC (rev 169176)
</span><span class="lines">@@ -30,12 +30,15 @@
</span><span class="cx"> #import "DatabaseProcess.h"
</span><span class="cx">
</span><span class="cx"> #import "SandboxInitializationParameters.h"
</span><ins>+#import <WebCore/FileSystem.h>
</ins><span class="cx"> #import <WebCore/LocalizedStrings.h>
</span><span class="cx"> #import <WebCore/NotImplemented.h>
</span><span class="cx"> #import <WebKitSystemInterface.h>
</span><span class="cx">
</span><span class="cx"> using namespace WebCore;
</span><span class="cx">
</span><ins>+#define ENABLE_MANUAL_DATABASE_SANDBOXING 0
+
</ins><span class="cx"> namespace WebKit {
</span><span class="cx">
</span><span class="cx"> void DatabaseProcess::initializeProcess(const ChildProcessInitializationParameters&)
</span><span class="lines">@@ -48,7 +51,12 @@
</span><span class="cx">
</span><span class="cx"> void DatabaseProcess::initializeSandbox(const ChildProcessInitializationParameters& parameters, SandboxInitializationParameters& sandboxParameters)
</span><span class="cx"> {
</span><del>- notImplemented();
</del><ins>+#if ENABLE_MANUAL_DATABASE_SANDBOXING
+ // Need to overide the default, because service has a different bundle ID.
+ NSBundle *webkit2Bundle = [NSBundle bundleForClass:NSClassFromString(@"WKView")];
+ sandboxParameters.setOverrideSandboxProfilePath([webkit2Bundle pathForResource:@"com.apple.WebKit.DatabasesIOS" ofType:@"sb"]);
+ ChildProcess::initializeSandbox(parameters, sandboxParameters);
+#endif
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2DatabaseProcessioscomappleWebKitDatabasesIOSsb"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/DatabaseProcess/ios/com.apple.WebKit.DatabasesIOS.sb (0 => 169176)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DatabaseProcess/ios/com.apple.WebKit.DatabasesIOS.sb         (rev 0)
+++ trunk/Source/WebKit2/DatabaseProcess/ios/com.apple.WebKit.DatabasesIOS.sb        2014-05-21 20:52:21 UTC (rev 169176)
</span><span class="lines">@@ -0,0 +1,53 @@
</span><ins>+; 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.
+
+(version 1)
+(deny default (with partial-symbolication))
+(allow system-audit file-read-metadata)
+
+(import "common.sb")
+(import "removed-dev-nodes.sb")
+
+;; Sandbox extensions
+(define (apply-read-and-issue-extension op path-filter)
+ (op file-read* path-filter)
+ (op file-issue-extension (require-all (extension-class "com.apple.app-sandbox.read") path-filter)))
+(define (apply-write-and-issue-extension op path-filter)
+ (op file-write* path-filter)
+ (op file-issue-extension (require-all (extension-class "com.apple.app-sandbox.read-write") path-filter)))
+(define (read-only-and-issue-extensions path-filter)
+ (apply-read-and-issue-extension allow path-filter))
+(define (read-write-and-issue-extensions path-filter)
+ (apply-read-and-issue-extension allow path-filter)
+ (apply-write-and-issue-extension allow path-filter))
+(read-only-and-issue-extensions (extension "com.apple.app-sandbox.read"))
+(read-write-and-issue-extensions (extension "com.apple.app-sandbox.read-write"))
+
+;; FIXME: Should be removed once <rdar://problem/16329087> is fixed.
+(deny file-write-xattr (xattr "com.apple.quarantine") (with no-log))
+
+;; Reserve a namespace for additional protected extended attributes.
+(deny file-read-xattr file-write-xattr (xattr-regex #"^com\.apple\.security\.private\."))
+
+(if (defined? 'vnode-type)
+ (deny file-write-create (vnode-type SYMLINK)))
</ins></span></pre></div>
<a id="trunkSourceWebKit2SharediosChildProcessIOSmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/Shared/ios/ChildProcessIOS.mm (0 => 169176)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/ios/ChildProcessIOS.mm         (rev 0)
+++ trunk/Source/WebKit2/Shared/ios/ChildProcessIOS.mm        2014-05-21 20:52:21 UTC (rev 169176)
</span><span class="lines">@@ -0,0 +1,126 @@
</span><ins>+/*
+ * Copyright (C) 2012, 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.
+ */
+
+#import "config.h"
+
+#if PLATFORM(IOS)
+
+#import "ChildProcess.h"
+
+#import "SandboxInitializationParameters.h"
+#import "WebKitSystemInterface.h"
+#import <WebCore/FileSystem.h>
+#import <WebCore/SystemVersionMac.h>
+#import <mach/mach.h>
+#import <mach/task.h>
+#import <pwd.h>
+#import <stdlib.h>
+#import <sysexits.h>
+
+#ifndef ENABLE_MANUAL_SANDBOXING
+#define ENABLE_MANUAL_SANDBOXING 0
+#endif
+
+#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);
+
+#endif
+
+using namespace WebCore;
+
+namespace WebKit {
+
+void ChildProcess::setApplicationIsDaemon()
+{
+}
+
+void ChildProcess::platformInitialize()
+{
+ [[NSFileManager defaultManager] changeCurrentDirectoryPath:[[NSBundle mainBundle] bundlePath]];
+}
+
+void ChildProcess::initializeSandbox(const ChildProcessInitializationParameters& parameters, SandboxInitializationParameters& sandboxParameters)
+{
+#if ENABLE_MANUAL_SANDBOXING
+ NSBundle *webkit2Bundle = [NSBundle bundleForClass:NSClassFromString(@"WKView")];
+ String defaultProfilePath = [webkit2Bundle pathForResource:[[NSBundle mainBundle] bundleIdentifier] ofType:@"sb"];
+ if (sandboxParameters.systemDirectorySuffix().isNull()) {
+ String defaultSystemDirectorySuffix = String([[NSBundle mainBundle] bundleIdentifier]) + "+" + parameters.clientIdentifier;
+ sandboxParameters.setSystemDirectorySuffix(defaultSystemDirectorySuffix);
+ }
+
+ String sandboxImportPath = "/usr/local/share/sandbox/imports";
+ sandboxParameters.addPathParameter("IMPORT_DIR", fileSystemRepresentation(sandboxImportPath).data());
+
+ switch (sandboxParameters.mode()) {
+ case SandboxInitializationParameters::UseDefaultSandboxProfilePath:
+ case SandboxInitializationParameters::UseOverrideSandboxProfilePath: {
+ String sandboxProfilePath = sandboxParameters.mode() == SandboxInitializationParameters::UseDefaultSandboxProfilePath ? defaultProfilePath : sandboxParameters.overrideSandboxProfilePath();
+ if (!sandboxProfilePath.isEmpty()) {
+ CString profilePath = fileSystemRepresentation(sandboxProfilePath);
+ char* errorBuf;
+ if (sandbox_init_with_parameters(profilePath.data(), SANDBOX_NAMED_EXTERNAL, sandboxParameters.namedParameterArray(), &errorBuf)) {
+ WTFLogAlways("%s: Couldn't initialize sandbox profile [%s], error '%s'\n", getprogname(), profilePath.data(), errorBuf);
+ for (size_t i = 0, count = sandboxParameters.count(); i != count; ++i)
+ WTFLogAlways("%s=%s\n", sandboxParameters.name(i), sandboxParameters.value(i));
+ exit(EX_NOPERM);
+ }
+ }
+
+ break;
+ }
+ case SandboxInitializationParameters::UseSandboxProfile: {
+ char* errorBuf;
+ if (sandbox_init_with_parameters(sandboxParameters.sandboxProfile().utf8().data(), 0, sandboxParameters.namedParameterArray(), &errorBuf)) {
+ WTFLogAlways("%s: Couldn't initialize sandbox profile, error '%s'\n", getprogname(), errorBuf);
+ for (size_t i = 0, count = sandboxParameters.count(); i != count; ++i)
+ WTFLogAlways("%s=%s\n", sandboxParameters.name(i), sandboxParameters.value(i));
+ exit(EX_NOPERM);
+ }
+
+ break;
+ }
+ }
+#else
+ UNUSED_PARAM(parameters);
+ UNUSED_PARAM(sandboxParameters);
+ RELEASE_ASSERT_NOT_REACHED();
+#endif
+}
+
+void ChildProcess::setQOS(int, int)
+{
+
+}
+
+} // namespace WebKit
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2SharedmacChildProcessMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/mac/ChildProcessMac.mm (169175 => 169176)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/mac/ChildProcessMac.mm        2014-05-21 20:39:36 UTC (rev 169175)
+++ trunk/Source/WebKit2/Shared/mac/ChildProcessMac.mm        2014-05-21 20:52:21 UTC (rev 169176)
</span><span class="lines">@@ -24,6 +24,8 @@
</span><span class="cx"> */
</span><span class="cx">
</span><span class="cx"> #import "config.h"
</span><ins>+
+#if PLATFORM(MAC)
</ins><span class="cx"> #import "ChildProcess.h"
</span><span class="cx">
</span><span class="cx"> #import "SandboxInitializationParameters.h"
</span><span class="lines">@@ -36,10 +38,6 @@
</span><span class="cx"> #import <stdlib.h>
</span><span class="cx"> #import <sysexits.h>
</span><span class="cx">
</span><del>-#if PLATFORM(IOS)
-#import <WebCore/FloatingPointEnvironment.h>
-#endif
-
</del><span class="cx"> // We have to #undef __APPLE_API_PRIVATE to prevent sandbox.h from looking for a header file that does not exist (<rdar://problem/9679211>).
</span><span class="cx"> #undef __APPLE_API_PRIVATE
</span><span class="cx"> #import <sandbox.h>
</span><span class="lines">@@ -53,7 +51,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-#if !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
</del><ins>+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
</ins><span class="cx"> typedef bool (^LSServerConnectionAllowedBlock) ( CFDictionaryRef optionsRef );
</span><span class="cx"> extern "C" void _LSSetApplicationLaunchServicesServerConnectionStatus(uint64_t flags, LSServerConnectionAllowedBlock block);
</span><span class="cx"> extern "C" CFDictionaryRef _LSApplicationCheckIn(int sessionID, CFDictionaryRef applicationInfo);
</span><span class="lines">@@ -65,7 +63,7 @@
</span><span class="cx">
</span><span class="cx"> namespace WebKit {
</span><span class="cx">
</span><del>-#if !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
</del><ins>+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
</ins><span class="cx"> static void initializeTimerCoalescingPolicy()
</span><span class="cx"> {
</span><span class="cx"> // Set task_latency and task_throughput QOS tiers as appropriate for a visible application.
</span><span class="lines">@@ -77,7 +75,6 @@
</span><span class="cx">
</span><span class="cx"> void ChildProcess::setApplicationIsDaemon()
</span><span class="cx"> {
</span><del>-#if !PLATFORM(IOS)
</del><span class="cx"> OSStatus error = SetApplicationIsDaemon(true);
</span><span class="cx"> ASSERT_UNUSED(error, error == noErr);
</span><span class="cx">
</span><span class="lines">@@ -85,19 +82,13 @@
</span><span class="cx"> _LSSetApplicationLaunchServicesServerConnectionStatus(0, 0);
</span><span class="cx"> RetainPtr<CFDictionaryRef> unused = _LSApplicationCheckIn(-2, CFBundleGetInfoDictionary(CFBundleGetMainBundle()));
</span><span class="cx"> #endif
</span><del>-#endif // !PLATFORM(IOS)
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void ChildProcess::platformInitialize()
</span><span class="cx"> {
</span><del>-#if !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
</del><ins>+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
</ins><span class="cx"> initializeTimerCoalescingPolicy();
</span><span class="cx"> #endif
</span><del>-#if PLATFORM(IOS)
- FloatingPointEnvironment& floatingPointEnvironment = FloatingPointEnvironment::shared();
- floatingPointEnvironment.enableDenormalSupport();
- floatingPointEnvironment.saveMainThreadEnvironment();
-#endif
</del><span class="cx">
</span><span class="cx"> [[NSFileManager defaultManager] changeCurrentDirectoryPath:[[NSBundle mainBundle] bundlePath]];
</span><span class="cx"> }
</span><span class="lines">@@ -122,7 +113,7 @@
</span><span class="cx"> String osVersion = osVersionParts[0] + '.' + osVersionParts[1];
</span><span class="cx"> sandboxParameters.addParameter("_OS_VERSION", osVersion.utf8().data());
</span><span class="cx">
</span><del>-#if !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
</del><ins>+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
</ins><span class="cx"> // Use private temporary and cache directories.
</span><span class="cx"> setenv("DIRHELPER_USER_DIR_SUFFIX", fileSystemRepresentation(sandboxParameters.systemDirectorySuffix()).data(), 0);
</span><span class="cx"> char temporaryDirectory[PATH_MAX];
</span><span class="lines">@@ -187,14 +178,12 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-#if !PLATFORM(IOS)
</del><span class="cx"> // This will override LSFileQuarantineEnabled from Info.plist unless sandbox quarantine is globally disabled.
</span><span class="cx"> OSStatus error = WKEnableSandboxStyleFileQuarantine();
</span><span class="cx"> if (error) {
</span><span class="cx"> WTFLogAlways("%s: Couldn't enable sandbox style file quarantine: %ld\n", getprogname(), (long)error);
</span><span class="cx"> exit(EX_NOPERM);
</span><span class="cx"> }
</span><del>-#endif
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if USE(APPKIT)
</span><span class="lines">@@ -210,7 +199,7 @@
</span><span class="cx">
</span><span class="cx"> void ChildProcess::setQOS(int latencyQOS, int throughputQOS)
</span><span class="cx"> {
</span><del>-#if !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
</del><ins>+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
</ins><span class="cx"> if (!latencyQOS && !throughputQOS)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -227,3 +216,5 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namespace WebKit
</span><ins>+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (169175 => 169176)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-05-21 20:39:36 UTC (rev 169175)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-05-21 20:52:21 UTC (rev 169176)
</span><span class="lines">@@ -1072,6 +1072,7 @@
</span><span class="cx">                 A5EFD38C16B0E88C00B2F0E8 /* WKPageVisibilityTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = A5EFD38B16B0E88C00B2F0E8 /* WKPageVisibilityTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 A7D792D61767CB6E00881CBE /* ActivityAssertion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7D792D51767CB6E00881CBE /* ActivityAssertion.cpp */; };
</span><span class="cx">                 A7D792D81767CCA300881CBE /* ActivityAssertion.h in Headers */ = {isa = PBXBuildFile; fileRef = A7D792D41767CB0900881CBE /* ActivityAssertion.h */; };
</span><ins>+                A7E93CED1925331100A1DC48 /* ChildProcessIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = A7E93CEB192531AA00A1DC48 /* ChildProcessIOS.mm */; };
</ins><span class="cx">                 B62E7310143047A60069EC35 /* WKHitTestResult.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B62E730F143047A60069EC35 /* WKHitTestResult.cpp */; };
</span><span class="cx">                 B62E7312143047B00069EC35 /* WKHitTestResult.h in Headers */ = {isa = PBXBuildFile; fileRef = B62E7311143047B00069EC35 /* WKHitTestResult.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 B63403F914910D57001070B5 /* APIObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B63403F814910D57001070B5 /* APIObject.cpp */; };
</span><span class="lines">@@ -3071,6 +3072,8 @@
</span><span class="cx">                 A72D5D7F1236CBA800A88B15 /* WebSerializedScriptValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSerializedScriptValue.h; sourceTree = "<group>"; };
</span><span class="cx">                 A7D792D41767CB0900881CBE /* ActivityAssertion.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ActivityAssertion.h; sourceTree = "<group>"; };
</span><span class="cx">                 A7D792D51767CB6E00881CBE /* ActivityAssertion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ActivityAssertion.cpp; sourceTree = "<group>"; };
</span><ins>+                A7E93CE9192527B600A1DC48 /* com.apple.WebKit.DatabasesIOS.sb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = com.apple.WebKit.DatabasesIOS.sb; sourceTree = "<group>"; };
+                A7E93CEB192531AA00A1DC48 /* ChildProcessIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ChildProcessIOS.mm; path = ios/ChildProcessIOS.mm; sourceTree = "<group>"; };
</ins><span class="cx">                 B396EA5512E0ED2D00F4FEB7 /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; };
</span><span class="cx">                 B62E730F143047A60069EC35 /* WKHitTestResult.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKHitTestResult.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 B62E7311143047B00069EC35 /* WKHitTestResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKHitTestResult.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -4655,6 +4658,7 @@
</span><span class="cx">                         children = (
</span><span class="cx">                                 2DA9449D1884E4F000ED86DB /* GestureTypes.h */,
</span><span class="cx">                                 2DA944971884E4F000ED86DB /* NativeWebKeyboardEventIOS.mm */,
</span><ins>+                                A7E93CEB192531AA00A1DC48 /* ChildProcessIOS.mm */,
</ins><span class="cx">                                 2DA944981884E4F000ED86DB /* NativeWebTouchEventIOS.mm */,
</span><span class="cx">                                 A118A9EC1907AD6F00F7C92B /* QuickLookDocumentData.cpp */,
</span><span class="cx">                                 A118A9ED1907AD6F00F7C92B /* QuickLookDocumentData.h */,
</span><span class="lines">@@ -6823,6 +6827,7 @@
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="cx">                                 E1FEF39C190F791C00731658 /* DatabaseProcessIOS.mm */,
</span><ins>+                                A7E93CE9192527B600A1DC48 /* com.apple.WebKit.DatabasesIOS.sb */,
</ins><span class="cx">                         );
</span><span class="cx">                         path = ios;
</span><span class="cx">                         sourceTree = "<group>";
</span><span class="lines">@@ -8759,6 +8764,7 @@
</span><span class="cx">                                 1A1B0EB518A424950038481A /* WKNavigationResponse.mm in Sources */,
</span><span class="cx">                                 1A0EC907124C0AB8007EF4A5 /* PluginProcessConnection.cpp in Sources */,
</span><span class="cx">                                 1A0EC910124C0AF5007EF4A5 /* PluginProcessConnectionManager.cpp in Sources */,
</span><ins>+                                A7E93CED1925331100A1DC48 /* ChildProcessIOS.mm in Sources */,
</ins><span class="cx">                                 2DD13BD518F7DADD00E130A1 /* FindControllerIOS.mm in Sources */,
</span><span class="cx">                                 1A7865B916CAC71500ACE83A /* PluginProcessConnectionManagerMessageReceiver.cpp in Sources */,
</span><span class="cx">                                 1A2BB6D014117B4D000F35D4 /* PluginProcessConnectionMessageReceiver.cpp in Sources */,
</span></span></pre>
</div>
</div>
</body>
</html>