<!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>[167410] 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/167410">167410</a></dd>
<dt>Author</dt> <dd>barraclough@apple.com</dd>
<dt>Date</dt> <dd>2014-04-16 18:40:04 -0700 (Wed, 16 Apr 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>On iOS keep network process running using a process assertion rather than a boost
https://bugs.webkit.org/show_bug.cgi?id=131779

Reviewed by Benjamin Poulain.

* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::connectToService):
    - No need to leak a boost onto the NetworkProcess on iOS.
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::didFinishLaunching):
    - Take a ProcessAssertion on the NetworkProcess.
* UIProcess/Shared/ChildProcessProxy.h:
    - Added m_assertion.
* UIProcess/WebProcessProxy.h:
    - Removed m_assertion.
* UIProcess/ios/ProcessAssertion.h: Added.
    - Added - refactored from WebProcessProxy.h.
* UIProcess/ios/ProcessAssertion.mm: Added.
(WebKit::ProcessAssertion::ProcessAssertion):
(WebKit::ProcessAssertion::setState):
    - Added - refactored from WebProcessProxyIOS.mm.
* UIProcess/ios/WebProcessProxyIOS.mm:
(WebKit::WebProcessProxy::updateProcessState):
    - Code refactored out to ProcessAssertion.mm.
* WebKit2.xcodeproj/project.pbxproj:
    - Added files.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedChildProcessProxyh">trunk/Source/WebKit2/Shared/ChildProcessProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessLaunchermacProcessLauncherMacmm">trunk/Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessNetworkNetworkProcessProxycpp">trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebProcessProxyh">trunk/Source/WebKit2/UIProcess/WebProcessProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWebProcessProxyIOSmm">trunk/Source/WebKit2/UIProcess/ios/WebProcessProxyIOS.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="#trunkSourceWebKit2UIProcessiosProcessAssertionh">trunk/Source/WebKit2/UIProcess/ios/ProcessAssertion.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosProcessAssertionmm">trunk/Source/WebKit2/UIProcess/ios/ProcessAssertion.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (167409 => 167410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-04-17 01:26:07 UTC (rev 167409)
+++ trunk/Source/WebKit2/ChangeLog        2014-04-17 01:40:04 UTC (rev 167410)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2014-04-16  Gavin Barraclough  &lt;baraclough@apple.com&gt;
+
+        On iOS keep network process running using a process assertion rather than a boost
+        https://bugs.webkit.org/show_bug.cgi?id=131779
+
+        Reviewed by Benjamin Poulain.
+
+        * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
+        (WebKit::connectToService):
+            - No need to leak a boost onto the NetworkProcess on iOS.
+        * UIProcess/Network/NetworkProcessProxy.cpp:
+        (WebKit::NetworkProcessProxy::didFinishLaunching):
+            - Take a ProcessAssertion on the NetworkProcess.
+        * UIProcess/Shared/ChildProcessProxy.h:
+            - Added m_assertion.
+        * UIProcess/WebProcessProxy.h:
+            - Removed m_assertion.
+        * UIProcess/ios/ProcessAssertion.h: Added.
+            - Added - refactored from WebProcessProxy.h.
+        * UIProcess/ios/ProcessAssertion.mm: Added.
+        (WebKit::ProcessAssertion::ProcessAssertion):
+        (WebKit::ProcessAssertion::setState):
+            - Added - refactored from WebProcessProxyIOS.mm.
+        * UIProcess/ios/WebProcessProxyIOS.mm:
+        (WebKit::WebProcessProxy::updateProcessState):
+            - Code refactored out to ProcessAssertion.mm.
+        * WebKit2.xcodeproj/project.pbxproj:
+            - Added files.
+
</ins><span class="cx"> 2014-04-16  Benjamin Poulain  &lt;bpoulain@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [iOS][WK2] Improve the approximation of the scroll position of the dynamic viewport size updates
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedChildProcessProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/ChildProcessProxy.h (167409 => 167410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/ChildProcessProxy.h        2014-04-17 01:26:07 UTC (rev 167409)
+++ trunk/Source/WebKit2/Shared/ChildProcessProxy.h        2014-04-17 01:40:04 UTC (rev 167410)
</span><span class="lines">@@ -32,6 +32,10 @@
</span><span class="cx"> 
</span><span class="cx"> #include &lt;wtf/ThreadSafeRefCounted.h&gt;
</span><span class="cx"> 
</span><ins>+#if PLATFORM(IOS) &amp;&amp; USE(XPC_SERVICES)
+#include &quot;ProcessAssertion.h&quot;
+#endif
+
</ins><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><span class="cx"> class ChildProcessProxy : ProcessLauncher::Client, public IPC::Connection::Client, public ThreadSafeRefCounted&lt;ChildProcessProxy&gt; {
</span><span class="lines">@@ -81,7 +85,11 @@
</span><span class="cx"> 
</span><span class="cx">     bool dispatchMessage(IPC::Connection*, IPC::MessageDecoder&amp;);
</span><span class="cx">     bool dispatchSyncMessage(IPC::Connection*, IPC::MessageDecoder&amp;, std::unique_ptr&lt;IPC::MessageEncoder&gt;&amp;);
</span><del>-
</del><ins>+    
+#if PLATFORM(IOS) &amp;&amp; USE(XPC_SERVICES)
+    std::unique_ptr&lt;ProcessAssertion&gt; m_assertion;
+#endif
+    
</ins><span class="cx"> private:
</span><span class="cx">     virtual void getLaunchOptions(ProcessLauncher::LaunchOptions&amp;) = 0;
</span><span class="cx">     virtual void connectionWillOpen(IPC::Connection*);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessLaunchermacProcessLauncherMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm (167409 => 167410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm        2014-04-17 01:26:07 UTC (rev 167409)
+++ trunk/Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm        2014-04-17 01:40:04 UTC (rev 167410)
</span><span class="lines">@@ -180,7 +180,7 @@
</span><span class="cx">     xpc_connection_set_event_handler(connection, ^(xpc_object_t event) { });
</span><span class="cx">     xpc_connection_resume(connection);
</span><span class="cx"> 
</span><del>-#if ENABLE(NETWORK_PROCESS)
</del><ins>+#if ENABLE(NETWORK_PROCESS) &amp;&amp; !PLATFORM(IOS)
</ins><span class="cx">     // Leak a boost onto the NetworkProcess.
</span><span class="cx">     if (launchOptions.processType == ProcessLauncher::NetworkProcess) {
</span><span class="cx">         xpc_object_t preBootstrapMessage = xpc_dictionary_create(0, 0, 0);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessNetworkNetworkProcessProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp (167409 => 167410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp        2014-04-17 01:26:07 UTC (rev 167409)
+++ trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp        2014-04-17 01:40:04 UTC (rev 167410)
</span><span class="lines">@@ -199,6 +199,10 @@
</span><span class="cx">     if (m_webContext.processSuppressionEnabled())
</span><span class="cx">         setProcessSuppressionEnabled(true);
</span><span class="cx"> #endif
</span><ins>+    
+#if PLATFORM(IOS) &amp;&amp; USE(XPC_SERVICES)
+    m_assertion = std::make_unique&lt;ProcessAssertion&gt;(xpc_connection_get_pid(connection()-&gt;xpcConnection()), AssertionState::Foreground);
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebProcessProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebProcessProxy.h (167409 => 167410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebProcessProxy.h        2014-04-17 01:26:07 UTC (rev 167409)
+++ trunk/Source/WebKit2/UIProcess/WebProcessProxy.h        2014-04-17 01:40:04 UTC (rev 167410)
</span><span class="lines">@@ -46,14 +46,6 @@
</span><span class="cx"> #include &quot;CustomProtocolManagerProxy.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if PLATFORM(IOS) &amp;&amp; USE(XPC_SERVICES)
-OBJC_CLASS BKSProcessAssertion;
-enum ProcessAssertionState {
-    AssertionBackground,
-    AssertionForeground
-};
-#endif
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> class URL;
</span><span class="cx"> struct PluginInfo;
</span><span class="lines">@@ -66,7 +58,7 @@
</span><span class="cx"> class WebContext;
</span><span class="cx"> class WebPageGroup;
</span><span class="cx"> struct WebNavigationDataStore;
</span><del>-
</del><ins>+    
</ins><span class="cx"> class WebProcessProxy : public ChildProcessProxy, ResponsivenessTimer::Client {
</span><span class="cx"> public:
</span><span class="cx">     typedef HashMap&lt;uint64_t, RefPtr&lt;WebBackForwardListItem&gt;&gt; WebBackForwardListItemMap;
</span><span class="lines">@@ -224,11 +216,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     int m_numberOfTimesSuddenTerminationWasDisabled;
</span><del>-    
-#if PLATFORM(IOS) &amp;&amp; USE(XPC_SERVICES)
-    RetainPtr&lt;BKSProcessAssertion&gt; m_assertion;
-    ProcessAssertionState m_assertionState;
-#endif
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> #if !PLATFORM(IOS)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosProcessAssertionh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/ios/ProcessAssertion.h (0 => 167410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/ProcessAssertion.h                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/ios/ProcessAssertion.h        2014-04-17 01:40:04 UTC (rev 167410)
</span><span class="lines">@@ -0,0 +1,57 @@
</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.
+ */
+
+#ifndef ProcessAssertion_h
+#define ProcessAssertion_h
+
+#include &lt;wtf/RetainPtr.h&gt;
+
+#if PLATFORM(IOS) &amp;&amp; USE(XPC_SERVICES)
+
+OBJC_CLASS BKSProcessAssertion;
+
+namespace WebKit {
+    
+enum class AssertionState {
+    Background,
+    Foreground
+};
+
+class ProcessAssertion {
+public:
+    ProcessAssertion(pid_t, AssertionState);
+    
+    void setState(AssertionState);
+    
+private:
+    RetainPtr&lt;BKSProcessAssertion&gt; m_assertion;
+    AssertionState m_assertionState;
+};
+    
+}
+
+#endif // PLATFORM(IOS) &amp;&amp; USE(XPC_SERVICES)
+
+#endif // ProcessAssertion_h
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosProcessAssertionmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/ios/ProcessAssertion.mm (0 => 167410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/ProcessAssertion.mm                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/ios/ProcessAssertion.mm        2014-04-17 01:40:04 UTC (rev 167410)
</span><span class="lines">@@ -0,0 +1,64 @@
</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.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;ProcessAssertion.h&quot;
+
+#if PLATFORM(IOS) &amp;&amp; USE(XPC_SERVICES)
+
+#import &lt;AssertionServices/BKSProcessAssertion.h&gt;
+
+namespace WebKit {
+
+const BKSProcessAssertionFlags backgroundTabFlags = (BKSProcessAssertionAllowIdleSleep);
+const BKSProcessAssertionFlags foregroundTabFlags = (BKSProcessAssertionAllowIdleSleep | BKSProcessAssertionPreventTaskSuspend | BKSProcessAssertionAllowSuspendOnSleep | BKSProcessAssertionWantsForegroundResourcePriority | BKSProcessAssertionPreventTaskThrottleDown);
+    
+ProcessAssertion::ProcessAssertion(pid_t pid, AssertionState assertionState)
+{
+    BKSProcessAssertionAcquisitionHandler handler = ^(BOOL acquired) {
+        if (!acquired) {
+            LOG_ERROR(&quot;Unable to acquire assertion for process %d&quot;, pid);
+            ASSERT_NOT_REACHED();
+        }
+    };
+    
+    BKSProcessAssertionFlags flags = (assertionState == AssertionState::Foreground) ? foregroundTabFlags : backgroundTabFlags;
+    m_assertionState = assertionState;
+    m_assertion = adoptNS([[BKSProcessAssertion alloc] initWithPID:pid flags:flags reason:BKSProcessAssertionReasonExtension name:@&quot;Web content visible&quot; withHandler:handler]);
+}
+    
+void ProcessAssertion::setState(AssertionState assertionState)
+{
+    if (m_assertionState == assertionState)
+        return;
+
+    BKSProcessAssertionFlags flags = (assertionState == AssertionState::Foreground) ? foregroundTabFlags : backgroundTabFlags;
+    m_assertionState = assertionState;
+    [m_assertion setFlags:flags];
+}
+
+}
+
+#endif // PLATFORM(IOS) &amp;&amp; USE(XPC_SERVICES)
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWebProcessProxyIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WebProcessProxyIOS.mm (167409 => 167410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WebProcessProxyIOS.mm        2014-04-17 01:26:07 UTC (rev 167409)
+++ trunk/Source/WebKit2/UIProcess/ios/WebProcessProxyIOS.mm        2014-04-17 01:40:04 UTC (rev 167410)
</span><span class="lines">@@ -28,14 +28,8 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> 
</span><del>-#import &lt;AssertionServices/BKSProcessAssertion.h&gt;
</del><span class="cx"> #import &lt;WebCore/NotImplemented.h&gt;
</span><span class="cx"> 
</span><del>-#if USE(XPC_SERVICES)
-const BKSProcessAssertionFlags BackgroundTabFlags = (BKSProcessAssertionAllowIdleSleep);
-const BKSProcessAssertionFlags ForegroundTabFlags = (BKSProcessAssertionAllowIdleSleep | BKSProcessAssertionPreventTaskSuspend | BKSProcessAssertionWantsForegroundResourcePriority | BKSProcessAssertionPreventTaskThrottleDown);
-#endif
-
</del><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><span class="cx"> bool WebProcessProxy::fullKeyboardAccessEnabled()
</span><span class="lines">@@ -75,7 +69,7 @@
</span><span class="cx"> {
</span><span class="cx">     notImplemented();
</span><span class="cx"> }
</span><del>-
</del><ins>+    
</ins><span class="cx"> void WebProcessProxy::updateProcessState()
</span><span class="cx"> {
</span><span class="cx"> #if USE(XPC_SERVICES)
</span><span class="lines">@@ -86,28 +80,18 @@
</span><span class="cx">     if (!xpcConnection)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    ProcessAssertionState assertionState = AssertionBackground;
</del><ins>+    AssertionState assertionState = AssertionState::Background;
</ins><span class="cx">     for (const auto&amp; page : m_pageMap.values()) {
</span><span class="cx">         if (page-&gt;isInWindow()) {
</span><del>-            assertionState = AssertionForeground;
</del><ins>+            assertionState = AssertionState::Foreground;
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><span class="cx">     }
</span><del>-    BKSProcessAssertionFlags flags = (assertionState == AssertionForeground) ? ForegroundTabFlags : BackgroundTabFlags;
</del><span class="cx">     
</span><del>-    if (!m_assertion) {
-        pid_t pid = xpc_connection_get_pid(xpcConnection);
-        BKSProcessAssertionAcquisitionHandler handler = ^(BOOL acquired) {
-            if (!acquired) {
-                LOG_ERROR(&quot;Unable to acquire assertion for WebContent process %d&quot;, pid);
-                ASSERT_NOT_REACHED();
-            }
-        };
-        m_assertion = adoptNS([[BKSProcessAssertion alloc] initWithPID:pid flags:flags reason:BKSProcessAssertionReasonExtension name:@&quot;Web content visible&quot; withHandler:handler]);
-    } else if (m_assertionState != assertionState)
-        [m_assertion setFlags:flags];
-    
-    m_assertionState = assertionState;
</del><ins>+    if (!m_assertion)
+        m_assertion = std::make_unique&lt;ProcessAssertion&gt;(xpc_connection_get_pid(xpcConnection), assertionState);
+    else
+        m_assertion-&gt;setState(assertionState);
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (167409 => 167410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-04-17 01:26:07 UTC (rev 167409)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-04-17 01:40:04 UTC (rev 167410)
</span><span class="lines">@@ -998,6 +998,8 @@
</span><span class="cx">                 7EC4F0FB18E4ACBB008056AF /* NetworkProcessCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7EC4F0F918E4A945008056AF /* NetworkProcessCocoa.mm */; };
</span><span class="cx">                 84477853176FCC0800CDC7BB /* InjectedBundleHitTestResultMediaType.h in Headers */ = {isa = PBXBuildFile; fileRef = 84477851176FCAC100CDC7BB /* InjectedBundleHitTestResultMediaType.h */; };
</span><span class="cx">                 868160D0187645570021E79D /* WindowServerConnection.mm in Sources */ = {isa = PBXBuildFile; fileRef = 868160CF187645370021E79D /* WindowServerConnection.mm */; };
</span><ins>+                86F9536418FF583C001DB2EF /* ProcessAssertion.mm in Sources */ = {isa = PBXBuildFile; fileRef = 86F9536218FF550B001DB2EF /* ProcessAssertion.mm */; };
+                86F9536518FF58F5001DB2EF /* ProcessAssertion.h in Headers */ = {isa = PBXBuildFile; fileRef = 86F9536018FF4FD4001DB2EF /* ProcessAssertion.h */; };
</ins><span class="cx">                 8CFECE941490F140002AAA32 /* EditorState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CFECE931490F140002AAA32 /* EditorState.cpp */; };
</span><span class="cx">                 8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C1666FE841158C02AAC07 /* InfoPlist.strings */; };
</span><span class="cx">                 909854EC12BC4E17000AD080 /* WebMemorySampler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 905620E812BC248B000799B6 /* WebMemorySampler.cpp */; };
</span><span class="lines">@@ -2863,6 +2865,8 @@
</span><span class="cx">                 84477851176FCAC100CDC7BB /* InjectedBundleHitTestResultMediaType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundleHitTestResultMediaType.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 868160CD18763D4B0021E79D /* WindowServerConnection.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WindowServerConnection.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 868160CF187645370021E79D /* WindowServerConnection.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = WindowServerConnection.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                86F9536018FF4FD4001DB2EF /* ProcessAssertion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ProcessAssertion.h; path = ios/ProcessAssertion.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                86F9536218FF550B001DB2EF /* ProcessAssertion.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ProcessAssertion.mm; path = ios/ProcessAssertion.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 8CFECE931490F140002AAA32 /* EditorState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EditorState.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 8DC2EF5A0486A6940098B216 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 8DC2EF5B0486A6940098B216 /* WebKit2.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = WebKit2.framework; sourceTree = BUILT_PRODUCTS_DIR; };
</span><span class="lines">@@ -4501,6 +4505,8 @@
</span><span class="cx">                                 0F0C365D18C110A500F607D7 /* LayerRepresentation.mm */,
</span><span class="cx">                                 0FCB4E3618BBE044000FCFC9 /* PageClientImplIOS.h */,
</span><span class="cx">                                 0FCB4E3718BBE044000FCFC9 /* PageClientImplIOS.mm */,
</span><ins>+                                86F9536018FF4FD4001DB2EF /* ProcessAssertion.h */,
+                                86F9536218FF550B001DB2EF /* ProcessAssertion.mm */,
</ins><span class="cx">                                 0F0C365718C051BA00F607D7 /* RemoteLayerTreeHostIOS.mm */,
</span><span class="cx">                                 0F0C365B18C05CA100F607D7 /* RemoteScrollingCoordinatorProxyIOS.mm */,
</span><span class="cx">                                 2DA1E4FC18C02B6A00DBC929 /* WKPDFView.h */,
</span><span class="lines">@@ -7377,6 +7383,7 @@
</span><span class="cx">                                 C5E1AFEB16B20B7E006CC1F2 /* WKWebArchiveResource.h in Headers */,
</span><span class="cx">                                 BC989D82161A7E5D000D46D3 /* WKWebProcessPlugIn.h in Headers */,
</span><span class="cx">                                 0FCB4E6818BBE3D9000FCFC9 /* WKTextInputWindowController.h in Headers */,
</span><ins>+                                86F9536518FF58F5001DB2EF /* ProcessAssertion.h in Headers */,
</ins><span class="cx">                                 BC8F2F2E16273ACC005FACB5 /* WKWebProcessPlugInBrowserContextControllerInternal.h in Headers */,
</span><span class="cx">                                 29501724162A4504004A9D71 /* WKWebProcessPlugInBrowserContextControllerPrivate.h in Headers */,
</span><span class="cx">                                 1F7506B61859165700EC0FF7 /* WKWebProcessPlugInNodeHandleInternal.h in Headers */,
</span><span class="lines">@@ -8478,6 +8485,7 @@
</span><span class="cx">                                 F6A25FDC12ADC6CC00DC40CC /* WebDatabaseManager.cpp in Sources */,
</span><span class="cx">                                 F62A76B612B1B25F0005F1B6 /* WebDatabaseManagerMessageReceiver.cpp in Sources */,
</span><span class="cx">                                 51E35209180F5D6B00E53BE9 /* DatabaseServiceEntryPoint.mm in Sources */,
</span><ins>+                                86F9536418FF583C001DB2EF /* ProcessAssertion.mm in Sources */,
</ins><span class="cx">                                 29232DF818B2A9AE00D0596F /* WKAccessibilityWebPageObjectIOS.mm in Sources */,
</span><span class="cx">                                 3F418EF91887BD97002795FD /* WebVideoFullscreenManagerMessageReceiver.cpp in Sources */,
</span><span class="cx">                                 F62A765C12B1ABC30005F1B6 /* WebDatabaseManagerProxy.cpp in Sources */,
</span></span></pre>
</div>
</div>

</body>
</html>