<!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>[161271] trunk/Source</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/161271">161271</a></dd>
<dt>Author</dt> <dd>barraclough@apple.com</dd>
<dt>Date</dt> <dd>2014-01-03 11:06:16 -0800 (Fri, 03 Jan 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Source/WebCore: Refactor NSActivity handling code from ChildProcess to UserActivity
https://bugs.webkit.org/show_bug.cgi?id=126330

Reviewed by Sam Weinig.

UserActivity is a mechanism to express to the operating system (where appropriate)
that a user initiated activity is taking place, and as such that resources should be
made available to the process accordingly.

Currently we hold a single NSActivity, at the WebKit layer. This refactoring allows us
to hold different activity tokens for different user actions (which simplifies the
handling, and aides debugging since the token can more accurately express the activity
taking place), and also will allow us to avoid the layering difficulty of calling back
up the stack to WebKit to register that an activity is taking place.

* WebCore.xcodeproj/project.pbxproj:
    - added new files.
* platform/UserActivity.cpp: Added.
(WebCore::UserActivity::UserActivity):
    - nop implementation - ignore description.
(WebCore::UserActivity::beginActivity):
(WebCore::UserActivity::endActivity):
    - nop implementation - just inc/dec m_count.
* platform/UserActivity.h: Added.
(WebCore::UserActivity::isActive):
    - returns true if one or more instance of this activity is in progress.
* platform/mac/UserActivityMac.mm: Added.
(WebCore::UserActivity::UserActivity):
    - constructor accepts one argument, a description string.
(WebCore::UserActivity::isValid):
    - used by assertions.
(WebCore::UserActivity::beginActivity):
(WebCore::UserActivity::endActivity):
    - track start/end of an activity - calls to these methods should be balanced.
(WebCore::UserActivity::hysteresisTimerFired):
      - used to implement hysteresis in releasing  NSActivity.

Source/WebKit2: VibrationPattern should allocate an single vector instance for single integer input
https://bugs.webkit.org/show_bug.cgi?id=126417

Patch by Jinwoo Song &lt;jinwoo7.song@samsung.com&gt; on 2014-01-03
Reviewed by Gyuyoung Kim.

Fix a vibration unit test regression after <a href="http://trac.webkit.org/projects/webkit/changeset/161139">r161139</a>. Also remove unnecessary test cases. 

* UIProcess/API/efl/tests/test_ewk2_view.cpp:
(EWK2ViewTest::loadVibrationHTMLString):
(TEST_F):

Source/WTF: Refactor NSActivity handling code from ChildProcess to UserActivity
https://bugs.webkit.org/show_bug.cgi?id=126330

Reviewed by Sam Weinig.

UserActivity is a mechanism to express to the operating system (where appropriate)
that a user initiated activity is taking place, and as such that resources should be
made available to the process accordingly.

Currently we hold a single NSActivity, at the WebKit layer. This refactoring allows us
to hold different activity tokens for different user actions (which simplifies the
handling, and aides debugging since the token can more accurately express the activity
taking place), and also will allow us to avoid the layering difficulty of calling back
up the stack to WebKit to register that an activity is taking place.

* wtf/Platform.h:
    - added HAVE_NS_ACTIVITY.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtfPlatformh">trunk/Source/WTF/wtf/Platform.h</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreGNUmakefilelistam">trunk/Source/WebCore/GNUmakefile.list.am</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedChildProcesscpp">trunk/Source/WebKit2/Shared/ChildProcess.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedChildProcessh">trunk/Source/WebKit2/Shared/ChildProcess.h</a></li>
<li><a href="#trunkSourceWebKit2SharedmacChildProcessMacmm">trunk/Source/WebKit2/Shared/mac/ChildProcessMac.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformUserActivitycpp">trunk/Source/WebCore/platform/UserActivity.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformUserActivityh">trunk/Source/WebCore/platform/UserActivity.h</a></li>
<li><a href="#trunkSourceWebCoreplatformmacUserActivityMacmm">trunk/Source/WebCore/platform/mac/UserActivityMac.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (161270 => 161271)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2014-01-03 19:05:25 UTC (rev 161270)
+++ trunk/Source/WTF/ChangeLog        2014-01-03 19:06:16 UTC (rev 161271)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2014-01-02  Gavin Barraclough  &lt;barraclough@apple.com&gt;
+
+        Refactor NSActivity handling code from ChildProcess to UserActivity
+        https://bugs.webkit.org/show_bug.cgi?id=126330
+
+        Reviewed by Sam Weinig.
+
+        UserActivity is a mechanism to express to the operating system (where appropriate)
+        that a user initiated activity is taking place, and as such that resources should be
+        made available to the process accordingly.
+
+        Currently we hold a single NSActivity, at the WebKit layer. This refactoring allows us
+        to hold different activity tokens for different user actions (which simplifies the
+        handling, and aides debugging since the token can more accurately express the activity
+        taking place), and also will allow us to avoid the layering difficulty of calling back
+        up the stack to WebKit to register that an activity is taking place.
+
+        * wtf/Platform.h:
+            - added HAVE_NS_ACTIVITY.
+
</ins><span class="cx"> 2013-12-30  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r161157, r161158, r161160, r161161,
</span></span></pre></div>
<a id="trunkSourceWTFwtfPlatformh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/Platform.h (161270 => 161271)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/Platform.h        2014-01-03 19:05:25 UTC (rev 161270)
+++ trunk/Source/WTF/wtf/Platform.h        2014-01-03 19:06:16 UTC (rev 161271)
</span><span class="lines">@@ -1078,4 +1078,8 @@
</span><span class="cx"> #define _HAS_EXCEPTIONS 1
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if PLATFORM(MAC) &amp;&amp; !PLATFORM(IOS) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1090
+#define HAVE_NS_ACTIVITY 1
+#endif
+
</ins><span class="cx"> #endif /* WTF_Platform_h */
</span></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (161270 => 161271)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2014-01-03 19:05:25 UTC (rev 161270)
+++ trunk/Source/WebCore/CMakeLists.txt        2014-01-03 19:06:16 UTC (rev 161271)
</span><span class="lines">@@ -1841,6 +1841,7 @@
</span><span class="cx">     platform/ThreadGlobalData.cpp
</span><span class="cx">     platform/ThreadTimers.cpp
</span><span class="cx">     platform/Timer.cpp
</span><ins>+    platform/UserActivity.cpp
</ins><span class="cx">     platform/UUID.cpp
</span><span class="cx">     platform/Widget.cpp
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (161270 => 161271)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-01-03 19:05:25 UTC (rev 161270)
+++ trunk/Source/WebCore/ChangeLog        2014-01-03 19:06:16 UTC (rev 161271)
</span><span class="lines">@@ -1,3 +1,42 @@
</span><ins>+2014-01-02  Gavin Barraclough  &lt;barraclough@apple.com&gt;
+
+        Refactor NSActivity handling code from ChildProcess to UserActivity
+        https://bugs.webkit.org/show_bug.cgi?id=126330
+
+        Reviewed by Sam Weinig.
+
+        UserActivity is a mechanism to express to the operating system (where appropriate)
+        that a user initiated activity is taking place, and as such that resources should be
+        made available to the process accordingly.
+
+        Currently we hold a single NSActivity, at the WebKit layer. This refactoring allows us
+        to hold different activity tokens for different user actions (which simplifies the
+        handling, and aides debugging since the token can more accurately express the activity
+        taking place), and also will allow us to avoid the layering difficulty of calling back
+        up the stack to WebKit to register that an activity is taking place.
+
+        * WebCore.xcodeproj/project.pbxproj:
+            - added new files.
+        * platform/UserActivity.cpp: Added.
+        (WebCore::UserActivity::UserActivity):
+            - nop implementation - ignore description.
+        (WebCore::UserActivity::beginActivity):
+        (WebCore::UserActivity::endActivity):
+            - nop implementation - just inc/dec m_count.
+        * platform/UserActivity.h: Added.
+        (WebCore::UserActivity::isActive):
+            - returns true if one or more instance of this activity is in progress.
+        * platform/mac/UserActivityMac.mm: Added.
+        (WebCore::UserActivity::UserActivity):
+            - constructor accepts one argument, a description string.
+        (WebCore::UserActivity::isValid):
+            - used by assertions.
+        (WebCore::UserActivity::beginActivity):
+        (WebCore::UserActivity::endActivity):
+            - track start/end of an activity - calls to these methods should be balanced.
+        (WebCore::UserActivity::hysteresisTimerFired):
+              - used to implement hysteresis in releasing  NSActivity.
+
</ins><span class="cx"> 2014-01-03  Alexey Proskuryakov  &lt;ap@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Line ending conversion should be able to handle strings with null chars
</span></span></pre></div>
<a id="trunkSourceWebCoreGNUmakefilelistam"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/GNUmakefile.list.am (161270 => 161271)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/GNUmakefile.list.am        2014-01-03 19:05:25 UTC (rev 161270)
+++ trunk/Source/WebCore/GNUmakefile.list.am        2014-01-03 19:06:16 UTC (rev 161271)
</span><span class="lines">@@ -5531,7 +5531,9 @@
</span><span class="cx">         Source/WebCore/platform/ScrollAnimatorNone.cpp \
</span><span class="cx">         Source/WebCore/platform/ScrollAnimatorNone.h \
</span><span class="cx">         Source/WebCore/platform/ThreadGlobalData.cpp \
</span><del>-        Source/WebCore/platform/ThreadGlobalData.h
</del><ins>+        Source/WebCore/platform/ThreadGlobalData.h \
+        Source/WebCore/platform/UserActivity.cpp \
+        Source/WebCore/platform/UserActivity.h
</ins><span class="cx"> 
</span><span class="cx"> platform_sources += \
</span><span class="cx">         Source/WebCore/platform/animation/AnimationUtilities.h \
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (161270 => 161271)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-01-03 19:05:25 UTC (rev 161270)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-01-03 19:06:16 UTC (rev 161271)
</span><span class="lines">@@ -245,6 +245,9 @@
</span><span class="cx"> __ZN7WebCore12TextIterator8subrangeEPNS_5RangeEii
</span><span class="cx"> __ZN7WebCore12TextIteratorC1EPKNS_5RangeENS_20TextIteratorBehaviorE
</span><span class="cx"> __ZN7WebCore12TextIteratorD1Ev
</span><ins>+__ZN7WebCore12UserActivity11endActivityEv
+__ZN7WebCore12UserActivity13beginActivityEv
+__ZN7WebCore12UserActivityC1EPKc
</ins><span class="cx"> __ZN7WebCore12UTF8EncodingEv
</span><span class="cx"> __ZN7WebCore12WorkerThread17workerThreadCountEv
</span><span class="cx"> __ZN7WebCore12cacheStorageEv
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (161270 => 161271)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-01-03 19:05:25 UTC (rev 161270)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-01-03 19:06:16 UTC (rev 161271)
</span><span class="lines">@@ -2860,6 +2860,9 @@
</span><span class="cx">                 861C2EA613FB4FFF00062ABB /* ResourceLoadTiming.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 861C2EA513FB4FFF00062ABB /* ResourceLoadTiming.cpp */; };
</span><span class="cx">                 86512EDE154A2AEF00A90426 /* PerformanceResourceTiming.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86512EDB154A2AEE00A90426 /* PerformanceResourceTiming.cpp */; };
</span><span class="cx">                 86512EDF154A2AEF00A90426 /* PerformanceResourceTiming.h in Headers */ = {isa = PBXBuildFile; fileRef = 86512EDC154A2AEF00A90426 /* PerformanceResourceTiming.h */; };
</span><ins>+                868160D418766A0A0021E79D /* UserActivity.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 868160D1187669C40021E79D /* UserActivity.cpp */; };
+                868160D518766A0E0021E79D /* UserActivityMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 868160D3187669E70021E79D /* UserActivityMac.mm */; };
+                868160D618766A130021E79D /* UserActivity.h in Headers */ = {isa = PBXBuildFile; fileRef = 868160D2187669C40021E79D /* UserActivity.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 86BA766E166427A8005BE5D1 /* FrameLoadRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86BA766D166427A8005BE5D1 /* FrameLoadRequest.cpp */; };
</span><span class="cx">                 86BE340115058CB200CE0FD8 /* PerformanceEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 86BE33FB15058CB200CE0FD8 /* PerformanceEntry.h */; };
</span><span class="cx">                 86BE340315058CB200CE0FD8 /* PerformanceEntryList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86BE33FD15058CB200CE0FD8 /* PerformanceEntryList.cpp */; };
</span><span class="lines">@@ -9648,6 +9651,9 @@
</span><span class="cx">                 86512EDB154A2AEE00A90426 /* PerformanceResourceTiming.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PerformanceResourceTiming.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 86512EDC154A2AEF00A90426 /* PerformanceResourceTiming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PerformanceResourceTiming.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 86512EDD154A2AEF00A90426 /* PerformanceResourceTiming.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PerformanceResourceTiming.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                868160D1187669C40021E79D /* UserActivity.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = UserActivity.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                868160D2187669C40021E79D /* UserActivity.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UserActivity.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                868160D3187669E70021E79D /* UserActivityMac.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = UserActivityMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 86BA766D166427A8005BE5D1 /* FrameLoadRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FrameLoadRequest.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 86BE33FB15058CB200CE0FD8 /* PerformanceEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PerformanceEntry.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 86BE33FC15058CB200CE0FD8 /* PerformanceEntry.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PerformanceEntry.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -15721,6 +15727,7 @@
</span><span class="cx">                                 BCE659E50EA92FB2007E4533 /* ThemeMac.h */,
</span><span class="cx">                                 BCE659E80EA92FFA007E4533 /* ThemeMac.mm */,
</span><span class="cx">                                 51DF6D7F0B92A18E00C2DC85 /* ThreadCheck.mm */,
</span><ins>+                                868160D3187669E70021E79D /* UserActivityMac.mm */,
</ins><span class="cx">                                 CDC69DD816371FD3007C38DF /* WebCoreFullScreenPlaceholderView.h */,
</span><span class="cx">                                 CDC69DD916371FD3007C38DF /* WebCoreFullScreenPlaceholderView.mm */,
</span><span class="cx">                                 CDC69DD41632026C007C38DF /* WebCoreFullScreenWarningView.h */,
</span><span class="lines">@@ -20437,6 +20444,8 @@
</span><span class="cx">                                 6593923509AE4346002C531F /* URL.cpp */,
</span><span class="cx">                                 6593923609AE4346002C531F /* URL.h */,
</span><span class="cx">                                 BCBD21AA0E417AD400A070F2 /* URLHash.h */,
</span><ins>+                                868160D1187669C40021E79D /* UserActivity.cpp */,
+                                868160D2187669C40021E79D /* UserActivity.h */,
</ins><span class="cx">                                 2E3BBF051162DA1100B9409A /* UUID.cpp */,
</span><span class="cx">                                 2E3BBF061162DA1100B9409A /* UUID.h */,
</span><span class="cx">                                 9A1142031832D134000BB8AD /* ValueToString.h */,
</span><span class="lines">@@ -22593,6 +22602,7 @@
</span><span class="cx">                                 E49BD9FA131FD2ED003C56F0 /* CSSValuePool.h in Headers */,
</span><span class="cx">                                 93F1992F08245E59001E9ABC /* Cursor.h in Headers */,
</span><span class="cx">                                 BC2272A20E82E87C00E7F975 /* CursorData.h in Headers */,
</span><ins>+                                868160D618766A130021E79D /* UserActivity.h in Headers */,
</ins><span class="cx">                                 BC2272AD0E82E8F300E7F975 /* CursorList.h in Headers */,
</span><span class="cx">                                 62CD325A1157E57C0063B0A7 /* CustomEvent.h in Headers */,
</span><span class="cx">                                 15B3FC1915FB217800A81BCB /* CustomFilterArrayParameter.h in Headers */,
</span><span class="lines">@@ -26333,6 +26343,7 @@
</span><span class="cx">                                 859A9C500AA5E3BD00B694B2 /* DOMHTMLStyleElement.mm in Sources */,
</span><span class="cx">                                 85DF821E0AA7849E00486AD7 /* DOMHTMLTableCaptionElement.mm in Sources */,
</span><span class="cx">                                 85DF82200AA7849E00486AD7 /* DOMHTMLTableCellElement.mm in Sources */,
</span><ins>+                                868160D418766A0A0021E79D /* UserActivity.cpp in Sources */,
</ins><span class="cx">                                 85DF82220AA7849E00486AD7 /* DOMHTMLTableColElement.mm in Sources */,
</span><span class="cx">                                 85DF82710AA78B8B00486AD7 /* DOMHTMLTableElement.mm in Sources */,
</span><span class="cx">                                 85DF82240AA7849E00486AD7 /* DOMHTMLTableRowElement.mm in Sources */,
</span><span class="lines">@@ -26401,6 +26412,7 @@
</span><span class="cx">                                 498391510F1E76B400C23782 /* DOMWebKitCSSMatrix.mm in Sources */,
</span><span class="cx">                                 8AD0A59714C88358000D83C5 /* DOMWebKitCSSRegionRule.mm in Sources */,
</span><span class="cx">                                 31611E620E1C4E1400F6A579 /* DOMWebKitCSSTransformValue.mm in Sources */,
</span><ins>+                                868160D518766A0E0021E79D /* UserActivityMac.mm in Sources */,
</ins><span class="cx">                                 3F2B33EC165AF15600E3987C /* DOMWebKitCSSViewportRule.mm in Sources */,
</span><span class="cx">                                 8A195933147EA16E00D1EA61 /* DOMWebKitNamedFlow.mm in Sources */,
</span><span class="cx">                                 31C0FF4D0E4CEFDD007D6FE5 /* DOMWebKitTransitionEvent.mm in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformUserActivitycpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/UserActivity.cpp (0 => 161271)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/UserActivity.cpp                                (rev 0)
+++ trunk/Source/WebCore/platform/UserActivity.cpp        2014-01-03 19:06:16 UTC (rev 161271)
</span><span class="lines">@@ -0,0 +1,51 @@
</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.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;UserActivity.h&quot;
+
+namespace WebCore {
+
+#if !HAVE(NS_ACTIVITY)
+
+UserActivity::UserActivity(const char*)
+    : m_count(0)
+{
+}
+
+void UserActivity::beginActivity()
+{
+    ++m_count;
+}
+
+void UserActivity::endActivity()
+{
+    ASSERT(m_count);
+    --m_count;
+}
+
+#endif
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformUserActivityh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/UserActivity.h (0 => 161271)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/UserActivity.h                                (rev 0)
+++ trunk/Source/WebCore/platform/UserActivity.h        2014-01-03 19:06:16 UTC (rev 161271)
</span><span class="lines">@@ -0,0 +1,66 @@
</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 UserActivity_h
+#define UserActivity_h
+
+#if HAVE(NS_ACTIVITY)
+#include &lt;wtf/RetainPtr.h&gt;
+#include &lt;wtf/Runloop.h&gt;
+OBJC_CLASS NSString;
+#endif
+
+namespace WebCore {
+
+// The UserActivity type is used to indicate to the operating system that
+// a user initiated or visible action is taking place, and as such that
+// resources should be allocated to the process accordingly.
+class UserActivity {
+public:
+    UserActivity(const char* description);
+
+    void beginActivity();
+    void endActivity();
+
+    bool isActive() const { return m_count; }
+
+private:
+    size_t m_count;
+
+#if HAVE(NS_ACTIVITY)
+    void hysteresisTimerFired();
+    bool isValid();
+
+    RetainPtr&lt;NSString&gt; m_description;
+    RunLoop::Timer&lt;UserActivity&gt; m_timer;
+    RetainPtr&lt;id&gt; m_activity;
+#endif
+};
+
+} // namespace WebCore
+
+using WebCore::UserActivity;
+
+#endif // UserActivity_h
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformmacUserActivityMacmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/mac/UserActivityMac.mm (0 => 161271)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/UserActivityMac.mm                                (rev 0)
+++ trunk/Source/WebCore/platform/mac/UserActivityMac.mm        2014-01-03 19:06:16 UTC (rev 161271)
</span><span class="lines">@@ -0,0 +1,91 @@
</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;UserActivity.h&quot;
+
+namespace WebCore {
+
+#if HAVE(NS_ACTIVITY)
+
+static const double kHysteresisSeconds = 5.0;
+
+UserActivity::UserActivity(const char* description)
+    : m_count(0)
+    , m_description([NSString stringWithUTF8String:description])
+    , m_timer(RunLoop::main(), this, &amp;UserActivity::hysteresisTimerFired)
+{
+    ASSERT(isValid());
+}
+
+bool UserActivity::isValid()
+{
+    // If count is non-zero then we should be holding an activity, and the hysteresis timer should not be running.
+    // Else if count is zero then:
+    //  (a) if we're holding an activity there should be an active timer to clear this,
+    //  (b) if we're not holding an activity there should be no active timer.
+    return m_count ? m_activity &amp;&amp; !m_timer.isActive() : !!m_activity == m_timer.isActive();
+}
+
+void UserActivity::beginActivity()
+{
+    ASSERT(isValid());
+
+    ++m_count;
+    if (m_timer.isActive())
+        m_timer.stop();
+    if (!m_activity) {
+        NSActivityOptions options = (NSActivityUserInitiatedAllowingIdleSystemSleep | NSActivityLatencyCritical) &amp; ~(NSActivitySuddenTerminationDisabled | NSActivityAutomaticTerminationDisabled);
+        m_activity = [[NSProcessInfo processInfo] beginActivityWithOptions:options reason:m_description.get()];
+    }
+
+    ASSERT(isValid());
+}
+
+void UserActivity::endActivity()
+{
+    ASSERT(m_count);
+    ASSERT(isValid());
+
+    if (!--m_count)
+        m_timer.startOneShot(kHysteresisSeconds);
+
+    ASSERT(isValid());
+}
+
+void UserActivity::hysteresisTimerFired()
+{
+    ASSERT(isValid());
+
+    [[NSProcessInfo processInfo] endActivity:m_activity.get()];
+    m_activity.clear();
+    m_timer.stop();
+
+    ASSERT(isValid());
+}
+
+#endif
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (161270 => 161271)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-01-03 19:05:25 UTC (rev 161270)
+++ trunk/Source/WebKit2/ChangeLog        2014-01-03 19:06:16 UTC (rev 161271)
</span><span class="lines">@@ -81,6 +81,39 @@
</span><span class="cx"> 
</span><span class="cx"> 2014-01-02  Gavin Barraclough  &lt;barraclough@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Refactor NSActivity handling code from ChildProcess to UserActivity
+        https://bugs.webkit.org/show_bug.cgi?id=126330
+
+        Reviewed by Sam Weinig.
+
+        UserActivity is a mechanism to express to the operating system (where appropriate)
+        that a user initiated activity is taking place, and as such that resources should be
+        made available to the process accordingly.
+
+        Currently we hold a single NSActivity, at the WebKit layer. This refactoring allows us
+        to hold different activity tokens for different user actions (which simplifies the
+        handling, and aides debugging since the token can more accurately express the activity
+        taking place), and also will allow us to avoid the layering difficulty of calling back
+        up the stack to WebKit to register that an activity is taking place.
+
+        * Shared/ChildProcess.cpp:
+        (WebKit::ChildProcess::ChildProcess):
+            - removed fields to directly manage NSActivity, use UserActivity objects instead.
+        * Shared/ChildProcess.h:
+        (WebKit::ChildProcess::processSuppressionEnabled):
+            - changed to initialize new fields.
+        * Shared/mac/ChildProcessMac.mm:
+        (WebKit::ChildProcess::setProcessSuppressionEnabled):
+            - implemented in terms of UserActivity m_processSuppressionDisabled.
+        (WebKit::ChildProcess::incrementActiveTaskCount):
+            - implemented in terms of UserActivity m_activeTasks.
+        (WebKit::ChildProcess::decrementActiveTaskCount):
+            - implemented in terms of UserActivity m_activeTasks.
+        (WebKit::ChildProcess::platformInitialize):
+            - implemented in terms of UserActivity m_processSuppressionDisabled.
+
+2014-01-02  Gavin Barraclough  &lt;barraclough@apple.com&gt;
+
</ins><span class="cx">         Propagate WindowServer modifications state to WebProcess
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=126356
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedChildProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/ChildProcess.cpp (161270 => 161271)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/ChildProcess.cpp        2014-01-03 19:05:25 UTC (rev 161270)
+++ trunk/Source/WebKit2/Shared/ChildProcess.cpp        2014-01-03 19:06:16 UTC (rev 161271)
</span><span class="lines">@@ -35,11 +35,8 @@
</span><span class="cx">     : m_terminationTimeout(0)
</span><span class="cx">     , m_terminationCounter(0)
</span><span class="cx">     , m_terminationTimer(RunLoop::main(), this, &amp;ChildProcess::terminationTimerFired)
</span><del>-#if PLATFORM(MAC)
-    , m_activeTaskCount(0)
-    , m_shouldSuspend(false)
-    , m_suspensionHysteresisTimer(RunLoop::main(), this, &amp;ChildProcess::suspensionHysteresisTimerFired)
-#endif
</del><ins>+    , m_processSuppressionDisabled(&quot;Process Suppression Disabled by UIProcess&quot;)
+    , m_activeTasks(&quot;Process Suppression Disabled by WebProcess&quot;)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -80,6 +77,27 @@
</span><span class="cx">     m_connection-&gt;open();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void ChildProcess::setProcessSuppressionEnabled(bool enabled)
+{
+    if (processSuppressionEnabled() == enabled)
+        return;
+
+    if (enabled)
+        m_processSuppressionDisabled.endActivity();
+    else
+        m_processSuppressionDisabled.beginActivity();
+}
+
+void ChildProcess::incrementActiveTaskCount()
+{
+    m_activeTasks.beginActivity();
+}
+
+void ChildProcess::decrementActiveTaskCount()
+{
+    m_activeTasks.endActivity();
+}
+
</ins><span class="cx"> void ChildProcess::initializeProcess(const ChildProcessInitializationParameters&amp;)
</span><span class="cx"> {
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedChildProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/ChildProcess.h (161270 => 161271)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/ChildProcess.h        2014-01-03 19:05:25 UTC (rev 161270)
+++ trunk/Source/WebKit2/Shared/ChildProcess.h        2014-01-03 19:06:16 UTC (rev 161271)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #include &quot;Connection.h&quot;
</span><span class="cx"> #include &quot;MessageReceiverMap.h&quot;
</span><span class="cx"> #include &quot;MessageSender.h&quot;
</span><ins>+#include &lt;WebCore/UserActivity.h&gt;
</ins><span class="cx"> #include &lt;wtf/HashMap.h&gt;
</span><span class="cx"> #include &lt;wtf/RetainPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/RunLoop.h&gt;
</span><span class="lines">@@ -61,16 +62,13 @@
</span><span class="cx">     void addMessageReceiver(IPC::StringReference messageReceiverName, uint64_t destinationID, IPC::MessageReceiver&amp;);
</span><span class="cx">     void removeMessageReceiver(IPC::StringReference messageReceiverName, uint64_t destinationID);
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC)
</del><span class="cx">     void setProcessSuppressionEnabled(bool);
</span><del>-    bool processSuppressionEnabled() const { return !m_processSuppressionAssertion; }
</del><ins>+    bool processSuppressionEnabled() const { return !m_processSuppressionDisabled.isActive(); }
</ins><span class="cx">     void incrementActiveTaskCount();
</span><span class="cx">     void decrementActiveTaskCount();
</span><span class="cx"> 
</span><ins>+#if PLATFORM(MAC)
</ins><span class="cx">     void setApplicationIsDaemon();
</span><del>-#else
-    void incrementActiveTaskCount() { }
-    void decrementActiveTaskCount() { }
</del><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     IPC::Connection* parentProcessConnection() const { return m_connection.get(); }
</span><span class="lines">@@ -119,14 +117,8 @@
</span><span class="cx">     RefPtr&lt;IPC::Connection&gt; m_connection;
</span><span class="cx">     IPC::MessageReceiverMap m_messageReceiverMap;
</span><span class="cx"> 
</span><del>-#if PLATFORM(MAC)
-    void suspensionHysteresisTimerFired();
-    void setProcessSuppressionEnabledInternal(bool);
-    size_t m_activeTaskCount;
-    bool m_shouldSuspend;
-    RunLoop::Timer&lt;ChildProcess&gt; m_suspensionHysteresisTimer;
-    RetainPtr&lt;id&gt; m_processSuppressionAssertion;
-#endif
</del><ins>+    UserActivity m_processSuppressionDisabled;
+    UserActivity m_activeTasks;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedmacChildProcessMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/mac/ChildProcessMac.mm (161270 => 161271)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/mac/ChildProcessMac.mm        2014-01-03 19:05:25 UTC (rev 161270)
+++ trunk/Source/WebKit2/Shared/mac/ChildProcessMac.mm        2014-01-03 19:06:16 UTC (rev 161271)
</span><span class="lines">@@ -60,69 +60,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><del>-static const double kSuspensionHysteresisSeconds = 5.0;
-
-void ChildProcess::setProcessSuppressionEnabledInternal(bool processSuppressionEnabled)
-{
</del><span class="cx"> #if !PLATFORM(IOS) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1090
</span><del>-    if (this-&gt;processSuppressionEnabled() == processSuppressionEnabled)
-        return;
-
-    if (processSuppressionEnabled) {
-        ASSERT(!m_activeTaskCount);
-        [[NSProcessInfo processInfo] endActivity:m_processSuppressionAssertion.get()];
-        m_processSuppressionAssertion.clear();
-    } else {
-        NSActivityOptions options = (NSActivityUserInitiatedAllowingIdleSystemSleep | NSActivityLatencyCritical) &amp; ~(NSActivitySuddenTerminationDisabled | NSActivityAutomaticTerminationDisabled);
-        m_processSuppressionAssertion = [[NSProcessInfo processInfo] beginActivityWithOptions:options reason:@&quot;Process Suppression Disabled&quot;];
-    }
-#else
-    UNUSED_PARAM(processSuppressionEnabled);
-#endif
-}
-
-void ChildProcess::setProcessSuppressionEnabled(bool processSuppressionEnabled)
-{
-    if (this-&gt;processSuppressionEnabled() == processSuppressionEnabled)
-        return;
-    if (m_shouldSuspend == processSuppressionEnabled)
-        return;
-    m_shouldSuspend = processSuppressionEnabled;
-    if (m_shouldSuspend) {
-        if (!m_activeTaskCount)
-            m_suspensionHysteresisTimer.startOneShot(kSuspensionHysteresisSeconds);
-        return;
-    }
-    setProcessSuppressionEnabledInternal(false);
-}
-
-void ChildProcess::incrementActiveTaskCount()
-{
-    m_activeTaskCount++;
-    if (m_suspensionHysteresisTimer.isActive())
-        m_suspensionHysteresisTimer.stop();
-    if (m_activeTaskCount)
-        setProcessSuppressionEnabledInternal(false);
-}
-
-void ChildProcess::decrementActiveTaskCount()
-{
-    ASSERT(m_activeTaskCount);
-    m_activeTaskCount--;
-    if (m_activeTaskCount)
-        return;
-    if (m_shouldSuspend)
-        m_suspensionHysteresisTimer.startOneShot(kSuspensionHysteresisSeconds);
-}
-
-void ChildProcess::suspensionHysteresisTimerFired()
-{
-    ASSERT(!m_activeTaskCount);
-    ASSERT(m_shouldSuspend);
-    setProcessSuppressionEnabledInternal(true);
-}
-
-#if !PLATFORM(IOS) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1090
</del><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">@@ -150,11 +88,8 @@
</span><span class="cx"> #if !PLATFORM(IOS) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1090
</span><span class="cx">     initializeTimerCoalescingPolicy();
</span><span class="cx"> #endif
</span><del>-    // Starting with process suppression disabled.  The proxy for this process will
-    // enable if appropriate from didFinishLaunching().
-    // We use setProcessSuppressionEnabledInternal to avoid any short circuit logic
-    // that would prevent us from taking the suppression assertion.
-    setProcessSuppressionEnabledInternal(false);
</del><ins>+    // Start with process suppression disabled.
+    m_processSuppressionDisabled.beginActivity();
</ins><span class="cx"> 
</span><span class="cx">     [[NSFileManager defaultManager] changeCurrentDirectoryPath:[[NSBundle mainBundle] bundlePath]];
</span><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>