[iOS] Report domains crashing under memory pressure via enhanced privacy logging.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Mar 2017 10:02:09 +0000 (10:02 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Mar 2017 10:02:09 +0000 (10:02 +0000)
commit4fd84bd26bc1f51e3161dd05ddf87c0b48c2e31f
treedab7873b5041d1fd4a57837723f9d32780abd4b5
parentae1a4a4065af036173254cefe6dee8d2640d78b4
[iOS] Report domains crashing under memory pressure via enhanced privacy logging.
<https://webkit.org/b/169133>
<rdar://problem/29964017>

Reviewed by Antti Koivisto.

Source/WebCore:

* page/DiagnosticLoggingKeys.h:

Source/WebKit2:

Notify the UI process when the memory pressure status changes.
If a web process crashes while under memory pressure, log the domain of the last open page
using enhanced privacy logging.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::processDidCrash):
* UIProcess/WebProcessProxy.h:
(WebKit::WebProcessProxy::memoryPressureStatusChanged):
(WebKit::WebProcessProxy::isUnderMemoryPressure):
* UIProcess/WebProcessProxy.messages.in:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):

Source/WTF:

Add a mechanism for getting a callback when the memory pressure status changes.

* wtf/MemoryPressureHandler.cpp:
(WTF::MemoryPressureHandler::measurementTimerFired):
(WTF::MemoryPressureHandler::beginSimulatedMemoryPressure):
(WTF::MemoryPressureHandler::endSimulatedMemoryPressure):
(WTF::MemoryPressureHandler::setUnderMemoryPressure):
(WTF::MemoryPressureHandler::memoryPressureStatusChanged):
* wtf/MemoryPressureHandler.h:
(WTF::MemoryPressureHandler::setMemoryPressureStatusChangedCallback):
(WTF::MemoryPressureHandler::setUnderMemoryPressure): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213444 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WTF/ChangeLog
Source/WTF/wtf/MemoryPressureHandler.cpp
Source/WTF/wtf/MemoryPressureHandler.h
Source/WebCore/ChangeLog
Source/WebCore/page/DiagnosticLoggingKeys.h
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebProcessProxy.h
Source/WebKit2/UIProcess/WebProcessProxy.messages.in
Source/WebKit2/WebProcess/WebProcess.cpp