Crash when terminating a process that has not been fully launched
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 11 May 2013 18:00:40 +0000 (18:00 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 11 May 2013 18:00:40 +0000 (18:00 +0000)
commitd8a9a51a4ae57e3d6e19449f94504a22706d1938
tree43480da7231a8b2e70b009980f6ff51cce1c6fd9
parent319cb4799d631b3b19f1c9b4410e9da0792168b9
Crash when terminating a process that has not been fully launched
https://bugs.webkit.org/show_bug.cgi?id=115962
<rdar://problem/13660916>

Reviewed by Andreas Kling.

Source/WebKit2:

Handle terminating a process that has not been fully launched.

* UIProcess/Launcher/ProcessLauncher.cpp:
(WebKit::ProcessLauncher::didFinishLaunchingProcess):
If we have been invalidated, dispose the connection identifier.

* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::ProcessLauncher::terminateProcess):
If we're still launching the process, invalidate so the client won't get an unexpected
didFinishLaunching callback.

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::requestTermination):
Check if webConnection() is null before calling it. (It will be null if the process isn't fully launched).

Tools:

Add TerminateTwice, a test that terminates a page, then reloads it and terminates it again
before the process has had a chance to be fully launched.

* TestWebKitAPI/GNUmakefile.am:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/TerminateTwice.cpp: Added.
(TestWebKitAPI):
(TestWebKitAPI::didFinishLoadForFrame):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit2/WebKit2.pro:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149933 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/Launcher/ProcessLauncher.cpp
Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm
Source/WebKit2/UIProcess/WebProcessProxy.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/GNUmakefile.am
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/WebKit2/TerminateTwice.cpp [new file with mode: 0644]
Tools/TestWebKitAPI/Tests/WebKit2/WebKit2.pro