importance_assertion -> denap_assertion
authorbarraclough@apple.com <barraclough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 May 2014 17:36:21 +0000 (17:36 +0000)
committerbarraclough@apple.com <barraclough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 May 2014 17:36:21 +0000 (17:36 +0000)
https://bugs.webkit.org/show_bug.cgi?id=133294

Patch by Gavin Barraclough <barraclough@apple.com> on 2014-05-26
Reviewed by Sam Weinig.

Update in accordance with API change. The importance assertion is used on
Mavericks & newer to ensure the WebContent process wakes from AppNap.

* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::open):
    - MACH_PORT_IMPORTANCE_RECEIVER -> MACH_PORT_DENAP_RECEIVER
* Platform/IPC/mac/ImportanceAssertion.h:
(IPC::ImportanceAssertion::ImportanceAssertion):
(IPC::ImportanceAssertion::~ImportanceAssertion):
    - proc_importance_assertion -> proc_denap_assertion

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

Source/WebKit2/ChangeLog
Source/WebKit2/Platform/IPC/mac/ConnectionMac.mm
Source/WebKit2/Platform/IPC/mac/ImportanceAssertion.h

index c0984e4..691db3c 100644 (file)
@@ -1,3 +1,21 @@
+2014-05-26  Gavin Barraclough  <barraclough@apple.com>
+
+        importance_assertion -> denap_assertion
+        https://bugs.webkit.org/show_bug.cgi?id=133294
+
+        Reviewed by Sam Weinig.
+
+        Update in accordance with API change. The importance assertion is used on
+        Mavericks & newer to ensure the WebContent process wakes from AppNap.
+
+        * Platform/IPC/mac/ConnectionMac.mm:
+        (IPC::Connection::open):
+            - MACH_PORT_IMPORTANCE_RECEIVER -> MACH_PORT_DENAP_RECEIVER
+        * Platform/IPC/mac/ImportanceAssertion.h:
+        (IPC::ImportanceAssertion::ImportanceAssertion):
+        (IPC::ImportanceAssertion::~ImportanceAssertion):
+            - proc_importance_assertion -> proc_denap_assertion
+
 2014-05-27  Jessie Berlin  <jberlin@apple.com>
 
         Revert r169362 since it broke the ML build.
index b543b1e..fd9ca75 100644 (file)
@@ -145,7 +145,9 @@ bool Connection::open()
         // Create the receive port.
         mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &m_receivePort);
 
-#if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
+        mach_port_set_attributes(mach_task_self(), m_receivePort, MACH_PORT_DENAP_RECEIVER, (mach_port_info_t)0, 0);
+#elif __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
         mach_port_set_attributes(mach_task_self(), m_receivePort, MACH_PORT_IMPORTANCE_RECEIVER, (mach_port_info_t)0, 0);
 #endif
 
index 5a0a2ba..9e481c9 100644 (file)
@@ -44,12 +44,20 @@ public:
     explicit ImportanceAssertion(mach_msg_header_t* header)
         : m_assertion(0)
     {
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
+        proc_denap_assertion_begin_with_msg(header, &m_assertion);
+#else
         proc_importance_assertion_begin_with_msg(header, 0, &m_assertion);
+#endif
     }
 
     ~ImportanceAssertion()
     {
+#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
+        proc_denap_assertion_complete(m_assertion);
+#else
         proc_importance_assertion_complete(m_assertion);
+#endif
     }
 
 private: