Title: [136766] trunk/Source/WebKit2
Revision
136766
Author
[email protected]
Date
2012-12-05 15:14:14 -0800 (Wed, 05 Dec 2012)

Log Message

WebKit2 child processes need to initialize timer coalescing policy on Mac.
https://bugs.webkit.org/show_bug.cgi?id=103613

Patch by Kiran Muppala <[email protected]> on 2012-12-05
Reviewed by Mark Rowe.

Set timer coalescing policy of WebKit2 child processes to that of visible applications
until they can manage the policy based on UI process visibility.

* Shared/mac/ChildProcessMac.mm:
(WebKit::initializeTimerCoalescingPolicy): Set task_latency and task_throughput QOS tiers as appropriate
for visible applications.
(WebKit::ChildProcess::platformInitialize): Add call to initializeTimerCoalescingPolicy.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (136765 => 136766)


--- trunk/Source/WebKit2/ChangeLog	2012-12-05 23:07:31 UTC (rev 136765)
+++ trunk/Source/WebKit2/ChangeLog	2012-12-05 23:14:14 UTC (rev 136766)
@@ -1,3 +1,18 @@
+2012-12-05  Kiran Muppala  <[email protected]>
+
+        WebKit2 child processes need to initialize timer coalescing policy on Mac.
+        https://bugs.webkit.org/show_bug.cgi?id=103613
+
+        Reviewed by Mark Rowe.
+
+        Set timer coalescing policy of WebKit2 child processes to that of visible applications
+        until they can manage the policy based on UI process visibility.
+
+        * Shared/mac/ChildProcessMac.mm:
+        (WebKit::initializeTimerCoalescingPolicy): Set task_latency and task_throughput QOS tiers as appropriate
+        for visible applications.
+        (WebKit::ChildProcess::platformInitialize): Add call to initializeTimerCoalescingPolicy.
+
 2012-12-05  Anders Carlsson  <[email protected]>
 
         Connection::waitForMessage shouldn't use the message ID

Modified: trunk/Source/WebKit2/Shared/mac/ChildProcessMac.mm (136765 => 136766)


--- trunk/Source/WebKit2/Shared/mac/ChildProcessMac.mm	2012-12-05 23:07:31 UTC (rev 136765)
+++ trunk/Source/WebKit2/Shared/mac/ChildProcessMac.mm	2012-12-05 23:14:14 UTC (rev 136766)
@@ -26,6 +26,8 @@
 #import "config.h"
 #import "ChildProcess.h"
 
+#import <mach/task.h>
+
 namespace WebKit {
 
 NSString * const ChildProcess::processSuppressionVisibleApplicationReason = @"Application is Visible";
@@ -62,10 +64,21 @@
 #endif
 }
 
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
+static void initializeTimerCoalescingPolicy()
+{
+    // Set task_latency and task_throughput QOS tiers as appropriate for a visible application.
+    struct task_qos_policy qosinfo = { LATENCY_QOS_TIER_0, THROUGHPUT_QOS_TIER_0 };
+    kern_return_t kr = task_policy_set(mach_task_self(), TASK_BASE_QOS_POLICY, (task_policy_t)&qosinfo, TASK_QOS_POLICY_COUNT);
+    ASSERT_UNUSED(kr, kr == KERN_SUCCESS);
+}
+#endif
+
 void ChildProcess::platformInitialize()
 {
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
     setpriority(PRIO_DARWIN_PROCESS, 0, 0);
+    initializeTimerCoalescingPolicy();
 #endif
     disableProcessSuppression(processSuppressionVisibleApplicationReason);
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to