The WebContent process does not suspend when MiniBrowser is minimized.
authorpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Jul 2018 21:50:00 +0000 (21:50 +0000)
committerpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Jul 2018 21:50:00 +0000 (21:50 +0000)
commitefdd1c624121ef4a1ffe36bb3dfe220976732c0f
treed48a9e5d6627c35f8335378829e03bef8a60c2b5
parent276512bbbec2154b5416fab48b0130f94ea2af7b
The WebContent process does not suspend when MiniBrowser is minimized.
https://bugs.webkit.org/show_bug.cgi?id=187708

Reviewed by Chris Dumez.

Source/WebCore/PAL:

Add function for enabling App nap.

* pal/spi/cf/CFUtilitiesSPI.h:

Source/WebKit:

Using the NSRunLoop runloop type prevents the WebContent process from suspending. Instead, use the new
_WebKit runloop type. Also do not leak a boost to the WebContent process, since this also prevents the
WebContent process from going to sleep. Calling SetApplicationIsDaemon prevents the WebContent process
from being assigned the application process priority level. To block WindowServer connections, call
CGSSetDenyWindowServerConnections(true) instead. Finally, App nap must be manually enabled, since the
WebContent process is no longer a NSApplication.

* Configurations/WebContentService.xcconfig:
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::shouldLeakBoost):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updateThrottleState):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeProcess):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233932 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/pal/spi/cf/CFUtilitiesSPI.h
Source/WebKit/ChangeLog
Source/WebKit/Configurations/WebContentService.xcconfig
Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm
Source/WebKit/WebProcess/WebPage/WebPage.cpp
Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm