Properly kill web processes in the launching state
https://bugs.webkit.org/show_bug.cgi?id=162938

Reviewed by Tim Horton.

Source/WebKit2:

* UIProcess/Launcher/ProcessLauncher.h:
Add m_xpcConnection member.

* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::ProcessLauncher::launchProcess):
Store the XPC connection in the m_xpcConnection member variable.
In the reply handler, handle m_xpcConnection being null.

(WebKit::ProcessLauncher::platformInvalidate):
Cancel and kill the connection.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::terminateProcess):
Get rid of an assertion.

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::requestTermination):
Handle the launching state.

Tools:

* TestWebKitAPI/Tests/WebKit2/TerminateTwice.cpp:
Enable this test again.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@206789 268f45cc-cd09-0410-ab3c-d52691b4dbfc
7 files changed