[WK2] Page reloading will crash UIProcess after WebProcess was killed
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Feb 2013 02:39:07 +0000 (02:39 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Feb 2013 02:39:07 +0000 (02:39 +0000)
commitd4861d9dbdb20ca28117f54c0191b61ab51b6c77
tree0a407e9d7604cce489f2da3c17608c6023ee2cea
parentc562346e4d4620befd8d8887216890f0f9b3fb91
[WK2] Page reloading will crash UIProcess after WebProcess was killed
https://bugs.webkit.org/show_bug.cgi?id=109305

Patch by Adenilson Cavalcanti <cavalcantii@gmail.com> on 2013-02-12
Reviewed by Benjamin Poulain.

Source/WebKit2:

Re-initialize the pointer to a WebInspectorProxy object before calling
initializeWebPage().

When the WebProcess crashes, WebPageProxy::processDidCrash() will
set WebInspectorProxy pointer to null, which later is accessed by
initializeWebPage(). This patch avoids a crash scenario where
calls into a null pointer would be made.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::reattachToWebProcess):

Tools:

Adding a new test to simulate the case of WebProcess crash followed by a trying
to load a new page.

* TestWebKitAPI/GNUmakefile.am:
* TestWebKitAPI/PlatformEfl.cmake:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/ReloadPageAfterCrash.cpp: Added.
(TestWebKitAPI):
(TestWebKitAPI::didFinishLoad):
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142704 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/WebPageProxy.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/GNUmakefile.am
Tools/TestWebKitAPI/PlatformEfl.cmake
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/WebKit2/ReloadPageAfterCrash.cpp [new file with mode: 0644]