https://bugs.webkit.org/show_bug.cgi?id=145030
Reviewed by Darin Adler.
These methods were easy to confuse with "Connection::Client::didClose()", yet they
were about something much more explicit: A child process being shut down by the UI Process.
Let's call them as such.
* Shared/ChildProcessProxy.cpp:
(WebKit::ChildProcessProxy::shutDownProcess):
(WebKit::ChildProcessProxy::clearConnection): Deleted.
(WebKit::ChildProcessProxy::connectionDidClose): Deleted.
* Shared/ChildProcessProxy.h:
* UIProcess/Databases/DatabaseProcessProxy.cpp:
(WebKit::DatabaseProcessProxy::processWillShutDown):
* UIProcess/Databases/DatabaseProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::processWillShutDown):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Plugins/PluginProcessProxy.cpp:
(WebKit::PluginProcessProxy::processWillShutDown):
* UIProcess/Plugins/PluginProcessProxy.h:
* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::webProcessWillShutDown):
(WebKit::WebFrameProxy::disconnect): Deleted.
* UIProcess/WebFrameProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::webProcessWillShutDown):
(WebKit::WebPageProxy::connectionDidClose): Deleted.
* UIProcess/WebPageProxy.h:
* UIProcess/WebProcessLifetimeTracker.cpp:
(WebKit::WebProcessLifetimeTracker::webProcessWillShutDown):
(WebKit::WebProcessLifetimeTracker::connectionDidClose): Deleted.
* UIProcess/WebProcessLifetimeTracker.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::processWillShutDown):
(WebKit::WebProcessProxy::shutDown):
(WebKit::WebProcessProxy::removeWebPage):
(WebKit::WebProcessProxy::didClose):
(WebKit::WebProcessProxy::disconnectFramesFromPage):
(WebKit::WebProcessProxy::shouldTerminate):
(WebKit::WebProcessProxy::requestTermination):
(WebKit::WebProcessProxy::connectionDidClose): Deleted.
(WebKit::WebProcessProxy::disconnect): Deleted.
* UIProcess/WebProcessProxy.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@184370
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2015-05-14 Brady Eidson <beidson@apple.com>
+
+ Rename connectionDidClose and related methods to be more clear.
+ https://bugs.webkit.org/show_bug.cgi?id=145030
+
+ Reviewed by Darin Adler.
+
+ These methods were easy to confuse with "Connection::Client::didClose()", yet they
+ were about something much more explicit: A child process being shut down by the UI Process.
+
+ Let's call them as such.
+
+ * Shared/ChildProcessProxy.cpp:
+ (WebKit::ChildProcessProxy::shutDownProcess):
+ (WebKit::ChildProcessProxy::clearConnection): Deleted.
+ (WebKit::ChildProcessProxy::connectionDidClose): Deleted.
+ * Shared/ChildProcessProxy.h:
+
+ * UIProcess/Databases/DatabaseProcessProxy.cpp:
+ (WebKit::DatabaseProcessProxy::processWillShutDown):
+ * UIProcess/Databases/DatabaseProcessProxy.h:
+
+ * UIProcess/Network/NetworkProcessProxy.cpp:
+ (WebKit::NetworkProcessProxy::processWillShutDown):
+ * UIProcess/Network/NetworkProcessProxy.h:
+
+ * UIProcess/Plugins/PluginProcessProxy.cpp:
+ (WebKit::PluginProcessProxy::processWillShutDown):
+ * UIProcess/Plugins/PluginProcessProxy.h:
+
+ * UIProcess/WebFrameProxy.cpp:
+ (WebKit::WebFrameProxy::webProcessWillShutDown):
+ (WebKit::WebFrameProxy::disconnect): Deleted.
+ * UIProcess/WebFrameProxy.h:
+
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::webProcessWillShutDown):
+ (WebKit::WebPageProxy::connectionDidClose): Deleted.
+ * UIProcess/WebPageProxy.h:
+
+ * UIProcess/WebProcessLifetimeTracker.cpp:
+ (WebKit::WebProcessLifetimeTracker::webProcessWillShutDown):
+ (WebKit::WebProcessLifetimeTracker::connectionDidClose): Deleted.
+ * UIProcess/WebProcessLifetimeTracker.h:
+
+ * UIProcess/WebProcessProxy.cpp:
+ (WebKit::WebProcessProxy::processWillShutDown):
+ (WebKit::WebProcessProxy::shutDown):
+ (WebKit::WebProcessProxy::removeWebPage):
+ (WebKit::WebProcessProxy::didClose):
+ (WebKit::WebProcessProxy::disconnectFramesFromPage):
+ (WebKit::WebProcessProxy::shouldTerminate):
+ (WebKit::WebProcessProxy::requestTermination):
+ (WebKit::WebProcessProxy::connectionDidClose): Deleted.
+ (WebKit::WebProcessProxy::disconnect): Deleted.
+ * UIProcess/WebProcessProxy.h:
+
2015-05-14 Zhuo Li <zachli@apple.com>
Some CFNetwork SPI to reset HSTS hosts added since a date should not be used on Yosemite.
m_processLauncher = nullptr;
}
-void ChildProcessProxy::clearConnection()
+void ChildProcessProxy::shutDownProcess()
{
if (!m_connection)
return;
- // FIXME: Call this after the connection has been invalidated.
- connectionDidClose(*m_connection);
+ processWillShutDown(*m_connection);
m_connection->invalidate();
m_connection = nullptr;
{
}
-void ChildProcessProxy::connectionDidClose(IPC::Connection&)
-{
-}
-
} // namespace WebKit
bool sendMessage(std::unique_ptr<IPC::MessageEncoder>, unsigned messageSendFlags);
protected:
- void clearConnection();
+ void shutDownProcess();
void abortProcessLaunchIfNeeded();
// ProcessLauncher::Client
private:
virtual void getLaunchOptions(ProcessLauncher::LaunchOptions&) = 0;
virtual void connectionWillOpen(IPC::Connection&);
- virtual void connectionDidClose(IPC::Connection&);
+ virtual void processWillShutDown(IPC::Connection&) = 0;
Vector<std::pair<std::unique_ptr<IPC::MessageEncoder>, unsigned>> m_pendingMessages;
RefPtr<ProcessLauncher> m_processLauncher;
platformGetLaunchOptions(launchOptions);
}
+void DatabaseProcessProxy::processWillShutDown(IPC::Connection& connection)
+{
+ ASSERT_UNUSED(connection, this->connection() == &connection);
+}
+
void DatabaseProcessProxy::didReceiveMessage(IPC::Connection& connection, IPC::MessageDecoder& decoder)
{
if (decoder.messageReceiverName() == Messages::DatabaseProcessProxy::messageReceiverName()) {
// ChildProcessProxy
virtual void getLaunchOptions(ProcessLauncher::LaunchOptions&) override;
+ virtual void processWillShutDown(IPC::Connection&) override;
// IPC::Connection::Client
virtual void didReceiveMessage(IPC::Connection&, IPC::MessageDecoder&) override;
#endif
}
+void NetworkProcessProxy::processWillShutDown(IPC::Connection& connection)
+{
+ ASSERT_UNUSED(connection, this->connection() == &connection);
+}
+
void NetworkProcessProxy::getNetworkProcessConnection(PassRefPtr<Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply> reply)
{
m_pendingConnectionReplies.append(reply);
// ChildProcessProxy
virtual void getLaunchOptions(ProcessLauncher::LaunchOptions&) override;
virtual void connectionWillOpen(IPC::Connection&) override;
+ virtual void processWillShutDown(IPC::Connection&) override;
void platformGetLaunchOptions(ProcessLauncher::LaunchOptions&);
void networkProcessCrashedOrFailedToLaunch();
platformGetLaunchOptions(launchOptions, m_pluginProcessAttributes);
}
+void PluginProcessProxy::processWillShutDown(IPC::Connection& connection)
+{
+ ASSERT_UNUSED(connection, this->connection() == &connection);
+}
+
// Asks the plug-in process to create a new connection to a web process. The connection identifier will be
// encoded in the given argument encoder and sent back to the connection of the given web process.
void PluginProcessProxy::getPluginProcessConnection(PassRefPtr<Messages::WebProcessProxy::GetPluginProcessConnection::DelayedReply> reply)
virtual void getLaunchOptions(ProcessLauncher::LaunchOptions&) override;
void platformGetLaunchOptions(ProcessLauncher::LaunchOptions&, const PluginProcessAttributes&);
+ virtual void processWillShutDown(IPC::Connection&) override;
void pluginProcessCrashedOrFailedToLaunch();
WebProcessPool::statistics().wkFrameCount--;
}
-void WebFrameProxy::disconnect()
+void WebFrameProxy::webProcessWillShutDown()
{
m_page = 0;
uint64_t frameID() const { return m_frameID; }
WebPageProxy* page() const { return m_page; }
- void disconnect();
+ void webProcessWillShutDown();
bool isMainFrame() const;
m_webProcessLifetimeTracker.connectionWillOpen(connection);
}
-void WebPageProxy::connectionDidClose(IPC::Connection& connection)
+void WebPageProxy::webProcessWillShutDown()
{
- ASSERT_UNUSED(connection, &connection == m_process->connection());
-
- m_webProcessLifetimeTracker.connectionDidClose(connection);
+ m_webProcessLifetimeTracker.webProcessWillShutDown();
}
void WebPageProxy::processDidFinishLaunching()
void didCancelCheckingText(uint64_t requestID);
void connectionWillOpen(IPC::Connection&);
- void connectionDidClose(IPC::Connection&);
+ void webProcessWillShutDown();
void processDidFinishLaunching();
observer->addWebPage(m_webPageProxy);
}
-void WebProcessLifetimeTracker::connectionDidClose(IPC::Connection&)
+void WebProcessLifetimeTracker::webProcessWillShutDown()
{
ASSERT(processIsRunning());
void addObserver(WebProcessLifetimeObserver&);
void connectionWillOpen(IPC::Connection&);
- void connectionDidClose(IPC::Connection&);
+ void webProcessWillShutDown();
void pageWasInvalidated();
page->connectionWillOpen(connection);
}
-void WebProcessProxy::connectionDidClose(IPC::Connection& connection)
+void WebProcessProxy::processWillShutDown(IPC::Connection& connection)
{
- ASSERT(this->connection() == &connection);
+ ASSERT_UNUSED(connection, this->connection() == &connection);
for (const auto& callback : m_pendingFetchWebsiteDataCallbacks.values())
callback(WebsiteData());
m_pendingDeleteWebsiteDataForOriginsCallbacks.clear();
for (auto& page : m_pageMap.values())
- page->connectionDidClose(connection);
+ page->webProcessWillShutDown();
releaseRemainingIconsForPageURLs();
}
-void WebProcessProxy::disconnect()
+void WebProcessProxy::shutDown()
{
- clearConnection();
+ shutDownProcess();
if (m_webConnection) {
m_webConnection->invalidate();
copyValuesToVector(m_frameMap, frames);
for (size_t i = 0, size = frames.size(); i < size; ++i)
- frames[i]->disconnect();
+ frames[i]->webProcessWillShutDown();
m_frameMap.clear();
if (m_downloadProxyMap)
#if PLATFORM(IOS)
if (state() == State::Running) {
- // On iOS deploy a watchdog in the UI process, since the content may be suspended.
- // 30s should be sufficient for any outstanding activity to complete cleanly.
+ // On iOS deploy a watchdog in the UI process, since the child process may be suspended.
+ // If 30s is insufficient for any outstanding activity to complete cleanly, then it will be killed.
connection()->terminateSoon(30);
}
#endif
- disconnect();
+ shutDown();
}
void WebProcessProxy::addVisitedLinkProvider(VisitedLinkProvider& provider)
Vector<RefPtr<WebPageProxy>> pages;
copyValuesToVector(m_pageMap, pages);
- disconnect();
+ shutDown();
for (size_t i = 0, size = pages.size(); i < size; ++i)
pages[i]->processDidCrash();
copyValuesToVector(m_frameMap, frames);
for (size_t i = 0, size = frames.size(); i < size; ++i) {
if (frames[i]->page() == page)
- frames[i]->disconnect();
+ frames[i]->webProcessWillShutDown();
}
}
{
shouldTerminate = canTerminateChildProcess();
if (shouldTerminate) {
- // We know that the web process is going to terminate so disconnect it from the process pool.
- disconnect();
+ // We know that the web process is going to terminate so start shutting it down in the UI process.
+ shutDown();
}
}
if (webConnection())
webConnection()->didClose();
- disconnect();
+ shutDown();
}
void WebProcessProxy::enableSuddenTermination()
virtual void getLaunchOptions(ProcessLauncher::LaunchOptions&) override;
void platformGetLaunchOptions(ProcessLauncher::LaunchOptions&);
virtual void connectionWillOpen(IPC::Connection&) override;
- virtual void connectionDidClose(IPC::Connection&) override;
+ virtual void processWillShutDown(IPC::Connection&) override;
// Called when the web process has crashed or we know that it will terminate soon.
// Will potentially cause the WebProcessProxy object to be freed.
- void disconnect();
+ void shutDown();
// IPC message handlers.
void addBackForwardItem(uint64_t itemID, uint64_t pageID, const PageState&);