Use new assertion API for process suppression on Mac
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Mar 2013 23:46:11 +0000 (23:46 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Mar 2013 23:46:11 +0000 (23:46 +0000)
https://bugs.webkit.org/show_bug.cgi?id=111387

Patch by Kiran Muppala <cmuppala@apple.com> on 2013-03-05
Reviewed by Alexey Proskuryakov.

Source/WebKit2:

* Shared/ChildProcess.h:
(WebKit::ChildProcess::processSuppressionEnabled): Rename
m_processVisibleAssertion to m_processSuppressionAssertion.
* Shared/mac/ChildProcessMac.mm:
(WebKit::ChildProcess::setProcessSuppressionEnabled): Ditto. And,
replace calls to WKNSProcessInfoProcessAssertionWithTypes() with call to
-[NSProcessInfo beginSuspensionOfSystemBehaviors:].

WebKitLibraries:

Add WKProcessSuppressionSystemBehaviors constant for use in WebKit2 to
take a process suppression assertion.

* WebKitSystemInterface.h:

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

Source/WebKit2/ChangeLog
Source/WebKit2/Shared/ChildProcess.h
Source/WebKit2/Shared/mac/ChildProcessMac.mm
WebKitLibraries/ChangeLog
WebKitLibraries/WebKitSystemInterface.h

index f22f4ad..e47d335 100644 (file)
@@ -1,3 +1,18 @@
+2013-03-05  Kiran Muppala  <cmuppala@apple.com>
+
+        Use new assertion API for process suppression on Mac
+        https://bugs.webkit.org/show_bug.cgi?id=111387
+
+        Reviewed by Alexey Proskuryakov.
+
+        * Shared/ChildProcess.h:
+        (WebKit::ChildProcess::processSuppressionEnabled): Rename
+        m_processVisibleAssertion to m_processSuppressionAssertion.
+        * Shared/mac/ChildProcessMac.mm:
+        (WebKit::ChildProcess::setProcessSuppressionEnabled): Ditto. And,
+        replace calls to WKNSProcessInfoProcessAssertionWithTypes() with call to
+        -[NSProcessInfo beginSuspensionOfSystemBehaviors:].
+
 2013-03-05  Anders Carlsson  <andersca@apple.com>
 
         Move storageType() to StorageAreaProxy
index c0ef028..c9c74f9 100644 (file)
@@ -62,7 +62,7 @@ public:
     void removeMessageReceiver(CoreIPC::StringReference messageReceiverName, uint64_t destinationID);
 
 #if PLATFORM(MAC)
-    bool processSuppressionEnabled() const { return !m_processVisibleAssertion; }
+    bool processSuppressionEnabled() const { return !m_processSuppressionAssertion; }
     void setProcessSuppressionEnabled(bool);
 
     void shutdownWindowServerConnection();
@@ -109,7 +109,7 @@ private:
     CoreIPC::MessageReceiverMap m_messageReceiverMap;
 
 #if PLATFORM(MAC)
-    RetainPtr<id> m_processVisibleAssertion;
+    RetainPtr<id> m_processSuppressionAssertion;
 #endif
 };
 
index 00b7d09..7ded54b 100644 (file)
@@ -65,9 +65,9 @@ void ChildProcess::setProcessSuppressionEnabled(bool processSuppressionEnabled)
         return;
 
     if (processSuppressionEnabled)
-        m_processVisibleAssertion.clear();
+        m_processSuppressionAssertion.clear();
     else
-        m_processVisibleAssertion = WKNSProcessInfoProcessAssertionWithTypes(WKProcessAssertionTypeVisible);
+        m_processSuppressionAssertion = [[NSProcessInfo processInfo] beginSuspensionOfSystemBehaviors:WKProcessSuppressionSystemBehaviors reason:@"Process Suppression Disabled"];
 #else
     UNUSED_PARAM(processSuppressionEnabled);
 #endif
index a7cbac5..bf41752 100644 (file)
@@ -1,3 +1,15 @@
+2013-03-05  Kiran Muppala  <cmuppala@apple.com>
+
+        Use new assertion API for process suppression on Mac
+        https://bugs.webkit.org/show_bug.cgi?id=111387
+
+        Reviewed by Alexey Proskuryakov.
+
+        Add WKProcessSuppressionSystemBehaviors constant for use in WebKit2 to
+        take a process suppression assertion.
+
+        * WebKitSystemInterface.h:
+
 2013-03-05  Jeffrey Pfau  <jpfau@apple.com>
 
         Clear associated cache partitions when deleting origins' cache
index 6c39578..d4fdeac 100644 (file)
@@ -497,6 +497,8 @@ enum {
 
 typedef NSUInteger WKProcessAssertionTypes;
 id WKNSProcessInfoProcessAssertionWithTypes(WKProcessAssertionTypes);
+
+extern const NSSystemBehaviors WKProcessSuppressionSystemBehaviors;
 #endif
 
 bool WKIsJavaPlugInActive(void);