- Revision
- 184326
- Author
- [email protected]
- Date
- 2015-05-13 20:07:25 -0700 (Wed, 13 May 2015)
Log Message
Rename ProcessThrottlerClient::{send, cancel}ProcessWillSuspend() to {send, cancel}PrepareToSuspend()
https://bugs.webkit.org/show_bug.cgi?id=144619
<rdar://problem/20812779>
Reviewed by Andy Estes.
The names of the functions ProcessThrottlerClient::{send, cancel}ProcessWillSuspend() are misnomers. These
functions are called when the ProcessThrottler wants to prepare the process that it manages for suspension
and changes its mind, respectively. That is, these functions do not actually correspond to the OS decision
to suspend a process or cancel the suspension of a process, respectively. So, rename these functions and
associated {Network, Web}ProcessProxy message names to better describe their purpose.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::prepareToSuspend):
(WebKit::NetworkProcess::cancelPrepareToSuspend):
(WebKit::NetworkProcess::processWillSuspend): Deleted.
(WebKit::NetworkProcess::cancelProcessWillSuspend): Deleted.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::sendPrepareToSuspend):
(WebKit::NetworkProcessProxy::sendCancelPrepareToSuspend):
(WebKit::NetworkProcessProxy::sendProcessWillSuspend): Deleted.
(WebKit::NetworkProcessProxy::sendCancelProcessWillSuspend): Deleted.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/ProcessThrottler.cpp:
(WebKit::ProcessThrottler::updateAssertion):
* UIProcess/ProcessThrottlerClient.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcess::actualPrepareToSuspend): Formerly named prepareToSuspend.
(WebKit::WebProcessProxy::sendPrepareToSuspend):
(WebKit::WebProcessProxy::sendCancelPrepareToSuspend):
(WebKit::WebProcessProxy::sendProcessWillSuspend): Deleted.
(WebKit::WebProcessProxy::sendCancelProcessWillSuspend): Deleted.
* UIProcess/WebProcessProxy.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::prepareToSuspend):
(WebKit::WebProcess::cancelPrepareToSuspend):
(WebKit::WebProcess::processWillSuspend): Deleted.
(WebKit::WebProcess::cancelProcessWillSuspend): Deleted.
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (184325 => 184326)
--- trunk/Source/WebKit2/ChangeLog 2015-05-14 01:34:08 UTC (rev 184325)
+++ trunk/Source/WebKit2/ChangeLog 2015-05-14 03:07:25 UTC (rev 184326)
@@ -1,3 +1,48 @@
+2015-05-13 Daniel Bates <[email protected]>
+
+ Rename ProcessThrottlerClient::{send, cancel}ProcessWillSuspend() to {send, cancel}PrepareToSuspend()
+ https://bugs.webkit.org/show_bug.cgi?id=144619
+ <rdar://problem/20812779>
+
+ Reviewed by Andy Estes.
+
+ The names of the functions ProcessThrottlerClient::{send, cancel}ProcessWillSuspend() are misnomers. These
+ functions are called when the ProcessThrottler wants to prepare the process that it manages for suspension
+ and changes its mind, respectively. That is, these functions do not actually correspond to the OS decision
+ to suspend a process or cancel the suspension of a process, respectively. So, rename these functions and
+ associated {Network, Web}ProcessProxy message names to better describe their purpose.
+
+ * NetworkProcess/NetworkProcess.cpp:
+ (WebKit::NetworkProcess::prepareToSuspend):
+ (WebKit::NetworkProcess::cancelPrepareToSuspend):
+ (WebKit::NetworkProcess::processWillSuspend): Deleted.
+ (WebKit::NetworkProcess::cancelProcessWillSuspend): Deleted.
+ * NetworkProcess/NetworkProcess.h:
+ * NetworkProcess/NetworkProcess.messages.in:
+ * UIProcess/Network/NetworkProcessProxy.cpp:
+ (WebKit::NetworkProcessProxy::sendPrepareToSuspend):
+ (WebKit::NetworkProcessProxy::sendCancelPrepareToSuspend):
+ (WebKit::NetworkProcessProxy::sendProcessWillSuspend): Deleted.
+ (WebKit::NetworkProcessProxy::sendCancelProcessWillSuspend): Deleted.
+ * UIProcess/Network/NetworkProcessProxy.h:
+ * UIProcess/ProcessThrottler.cpp:
+ (WebKit::ProcessThrottler::updateAssertion):
+ * UIProcess/ProcessThrottlerClient.h:
+ * UIProcess/WebProcessProxy.cpp:
+ (WebKit::WebProcess::actualPrepareToSuspend): Formerly named prepareToSuspend.
+ (WebKit::WebProcessProxy::sendPrepareToSuspend):
+ (WebKit::WebProcessProxy::sendCancelPrepareToSuspend):
+ (WebKit::WebProcessProxy::sendProcessWillSuspend): Deleted.
+ (WebKit::WebProcessProxy::sendCancelProcessWillSuspend): Deleted.
+ * UIProcess/WebProcessProxy.h:
+ * WebProcess/WebProcess.cpp:
+ (WebKit::WebProcess::prepareToSuspend):
+ (WebKit::WebProcess::cancelPrepareToSuspend):
+ (WebKit::WebProcess::processWillSuspend): Deleted.
+ (WebKit::WebProcess::cancelProcessWillSuspend): Deleted.
+ * WebProcess/WebProcess.h:
+ * WebProcess/WebProcess.messages.in:
+
2015-05-13 Anders Carlsson <[email protected]>
Don't create a per-pool data store when using the modern API
Modified: trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp (184325 => 184326)
--- trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp 2015-05-14 01:34:08 UTC (rev 184325)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp 2015-05-14 03:07:25 UTC (rev 184326)
@@ -514,13 +514,13 @@
handled = true;
}
-void NetworkProcess::processWillSuspend()
+void NetworkProcess::prepareToSuspend()
{
lowMemoryHandler(true);
parentProcessConnection()->send(Messages::NetworkProcessProxy::ProcessReadyToSuspend(), 0);
}
-void NetworkProcess::cancelProcessWillSuspend()
+void NetworkProcess::cancelPrepareToSuspend()
{
parentProcessConnection()->send(Messages::NetworkProcessProxy::DidCancelProcessSuspension(), 0);
}
Modified: trunk/Source/WebKit2/NetworkProcess/NetworkProcess.h (184325 => 184326)
--- trunk/Source/WebKit2/NetworkProcess/NetworkProcess.h 2015-05-14 01:34:08 UTC (rev 184325)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkProcess.h 2015-05-14 03:07:25 UTC (rev 184326)
@@ -79,8 +79,8 @@
bool canHandleHTTPSServerTrustEvaluation() const { return m_canHandleHTTPSServerTrustEvaluation; }
void processWillSuspendImminently(bool& handled);
- void processWillSuspend();
- void cancelProcessWillSuspend();
+ void prepareToSuspend();
+ void cancelPrepareToSuspend();
void processDidResume();
// Diagnostic messages logging.
Modified: trunk/Source/WebKit2/NetworkProcess/NetworkProcess.messages.in (184325 => 184326)
--- trunk/Source/WebKit2/NetworkProcess/NetworkProcess.messages.in 2015-05-14 01:34:08 UTC (rev 184325)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkProcess.messages.in 2015-05-14 03:07:25 UTC (rev 184326)
@@ -59,8 +59,8 @@
SetCacheModel(uint32_t cacheModel);
ProcessWillSuspendImminently() -> (bool handled)
- ProcessWillSuspend()
- CancelProcessWillSuspend()
+ PrepareToSuspend()
+ CancelPrepareToSuspend()
ProcessDidResume()
}
Modified: trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp (184325 => 184326)
--- trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp 2015-05-14 01:34:08 UTC (rev 184325)
+++ trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp 2015-05-14 03:07:25 UTC (rev 184326)
@@ -323,16 +323,16 @@
0, std::chrono::seconds(1), IPC::InterruptWaitingIfSyncMessageArrives);
}
-void NetworkProcessProxy::sendProcessWillSuspend()
+void NetworkProcessProxy::sendPrepareToSuspend()
{
if (canSendMessage())
- send(Messages::NetworkProcess::ProcessWillSuspend(), 0);
+ send(Messages::NetworkProcess::PrepareToSuspend(), 0);
}
-void NetworkProcessProxy::sendCancelProcessWillSuspend()
+void NetworkProcessProxy::sendCancelPrepareToSuspend()
{
if (canSendMessage())
- send(Messages::NetworkProcess::CancelProcessWillSuspend(), 0);
+ send(Messages::NetworkProcess::CancelPrepareToSuspend(), 0);
}
void NetworkProcessProxy::didCancelProcessSuspension()
Modified: trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h (184325 => 184326)
--- trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h 2015-05-14 01:34:08 UTC (rev 184325)
+++ trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h 2015-05-14 03:07:25 UTC (rev 184326)
@@ -88,8 +88,8 @@
// ProcessThrottlerClient
void sendProcessWillSuspendImminently() override;
- void sendProcessWillSuspend() override;
- void sendCancelProcessWillSuspend() override;
+ void sendPrepareToSuspend() override;
+ void sendCancelPrepareToSuspend() override;
void sendProcessDidResume() override;
// IPC::Connection::Client
Modified: trunk/Source/WebKit2/UIProcess/ProcessThrottler.cpp (184325 => 184326)
--- trunk/Source/WebKit2/UIProcess/ProcessThrottler.cpp 2015-05-14 01:34:08 UTC (rev 184325)
+++ trunk/Source/WebKit2/UIProcess/ProcessThrottler.cpp 2015-05-14 03:07:25 UTC (rev 184326)
@@ -66,7 +66,7 @@
// in the background for too long.
if (m_assertion && m_assertion->state() != AssertionState::Suspended && !m_foregroundCounter.value() && !m_backgroundCounter.value()) {
++m_suspendMessageCount;
- m_process.sendProcessWillSuspend();
+ m_process.sendPrepareToSuspend();
m_suspendTimer.startOneShot(processSuspensionTimeout);
m_assertion->setState(AssertionState::Background);
return;
@@ -76,7 +76,7 @@
// If we're currently waiting for the Web process to do suspension cleanup, but no longer need to be suspended, tell the Web process to cancel the cleanup.
if (m_suspendTimer.isActive() && shouldBeRunnable)
- m_process.sendCancelProcessWillSuspend();
+ m_process.sendCancelPrepareToSuspend();
if (m_assertion && m_assertion->state() == AssertionState::Suspended && shouldBeRunnable)
m_process.sendProcessDidResume();
Modified: trunk/Source/WebKit2/UIProcess/ProcessThrottlerClient.h (184325 => 184326)
--- trunk/Source/WebKit2/UIProcess/ProcessThrottlerClient.h 2015-05-14 01:34:08 UTC (rev 184325)
+++ trunk/Source/WebKit2/UIProcess/ProcessThrottlerClient.h 2015-05-14 03:07:25 UTC (rev 184326)
@@ -33,8 +33,8 @@
virtual ~ProcessThrottlerClient() { }
virtual void sendProcessWillSuspendImminently() = 0;
- virtual void sendProcessWillSuspend() = 0;
- virtual void sendCancelProcessWillSuspend() = 0;
+ virtual void sendPrepareToSuspend() = 0;
+ virtual void sendCancelPrepareToSuspend() = 0;
virtual void sendProcessDidResume() = 0;
};
Modified: trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp (184325 => 184326)
--- trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp 2015-05-14 01:34:08 UTC (rev 184325)
+++ trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp 2015-05-14 03:07:25 UTC (rev 184326)
@@ -899,16 +899,16 @@
0, std::chrono::seconds(1), IPC::InterruptWaitingIfSyncMessageArrives);
}
-void WebProcessProxy::sendProcessWillSuspend()
+void WebProcessProxy::sendPrepareToSuspend()
{
if (canSendMessage())
- send(Messages::WebProcess::ProcessWillSuspend(), 0);
+ send(Messages::WebProcess::PrepareToSuspend(), 0);
}
-void WebProcessProxy::sendCancelProcessWillSuspend()
+void WebProcessProxy::sendCancelPrepareToSuspend()
{
if (canSendMessage())
- send(Messages::WebProcess::CancelProcessWillSuspend(), 0);
+ send(Messages::WebProcess::CancelPrepareToSuspend(), 0);
}
void WebProcessProxy::initializeNetworkProcessActivityToken()
Modified: trunk/Source/WebKit2/UIProcess/WebProcessProxy.h (184325 => 184326)
--- trunk/Source/WebKit2/UIProcess/WebProcessProxy.h 2015-05-14 01:34:08 UTC (rev 184325)
+++ trunk/Source/WebKit2/UIProcess/WebProcessProxy.h 2015-05-14 03:07:25 UTC (rev 184326)
@@ -207,8 +207,8 @@
// ProcessThrottlerClient
void sendProcessWillSuspendImminently() override;
- void sendProcessWillSuspend() override;
- void sendCancelProcessWillSuspend() override;
+ void sendPrepareToSuspend() override;
+ void sendCancelPrepareToSuspend() override;
void sendProcessDidResume() override;
// ProcessLauncher::Client
Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (184325 => 184326)
--- trunk/Source/WebKit2/WebProcess/WebProcess.cpp 2015-05-14 01:34:08 UTC (rev 184325)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.cpp 2015-05-14 03:07:25 UTC (rev 184326)
@@ -1218,7 +1218,7 @@
}
#endif
-void WebProcess::prepareToSuspend(ShouldAcknowledgeWhenReadyToSuspend shouldAcknowledgeWhenReadyToSuspend)
+void WebProcess::actualPrepareToSuspend(ShouldAcknowledgeWhenReadyToSuspend shouldAcknowledgeWhenReadyToSuspend)
{
MemoryPressureHandler::singleton().releaseMemory(true);
setAllLayerTreeStatesFrozen(true);
@@ -1235,16 +1235,16 @@
void WebProcess::processWillSuspendImminently(bool& handled)
{
supplement<WebDatabaseManager>()->closeAllDatabases();
- prepareToSuspend(ShouldAcknowledgeWhenReadyToSuspend::No);
+ actualPrepareToSuspend(ShouldAcknowledgeWhenReadyToSuspend::No);
handled = true;
}
-void WebProcess::processWillSuspend()
+void WebProcess::prepareToSuspend()
{
- prepareToSuspend(ShouldAcknowledgeWhenReadyToSuspend::Yes);
+ actualPrepareToSuspend(ShouldAcknowledgeWhenReadyToSuspend::Yes);
}
-void WebProcess::cancelProcessWillSuspend()
+void WebProcess::cancelPrepareToSuspend()
{
setAllLayerTreeStatesFrozen(false);
Modified: trunk/Source/WebKit2/WebProcess/WebProcess.h (184325 => 184326)
--- trunk/Source/WebKit2/WebProcess/WebProcess.h 2015-05-14 01:34:08 UTC (rev 184325)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.h 2015-05-14 03:07:25 UTC (rev 184326)
@@ -185,8 +185,8 @@
#endif
void processWillSuspendImminently(bool& handled);
- void processWillSuspend();
- void cancelProcessWillSuspend();
+ void prepareToSuspend();
+ void cancelPrepareToSuspend();
bool markAllLayersVolatileIfPossible();
void setAllLayerTreeStatesFrozen(bool);
void processSuspensionCleanupTimerFired();
@@ -284,7 +284,7 @@
void setInjectedBundleParameter(const String& key, const IPC::DataReference&);
enum class ShouldAcknowledgeWhenReadyToSuspend { No, Yes };
- void prepareToSuspend(ShouldAcknowledgeWhenReadyToSuspend);
+ void actualPrepareToSuspend(ShouldAcknowledgeWhenReadyToSuspend);
// ChildProcess
virtual void initializeProcess(const ChildProcessInitializationParameters&) override;
Modified: trunk/Source/WebKit2/WebProcess/WebProcess.messages.in (184325 => 184326)
--- trunk/Source/WebKit2/WebProcess/WebProcess.messages.in 2015-05-14 01:34:08 UTC (rev 184325)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.messages.in 2015-05-14 03:07:25 UTC (rev 184326)
@@ -101,7 +101,7 @@
#endif
ProcessWillSuspendImminently() -> (bool handled)
- ProcessWillSuspend()
- CancelProcessWillSuspend()
+ PrepareToSuspend()
+ CancelPrepareToSuspend()
ProcessDidResume()
}