Changeset 142704 in webkit


Ignore:
Timestamp:
Feb 12, 2013 6:39:07 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[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):

Location:
trunk
Files:
1 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r142701 r142704  
     12013-02-12  Adenilson Cavalcanti  <cavalcantii@gmail.com>
     2
     3        [WK2] Page reloading will crash UIProcess after WebProcess was killed
     4        https://bugs.webkit.org/show_bug.cgi?id=109305
     5
     6        Reviewed by Benjamin Poulain.
     7
     8        Re-initialize the pointer to a WebInspectorProxy object before calling
     9        initializeWebPage().
     10
     11        When the WebProcess crashes, WebPageProxy::processDidCrash() will
     12        set WebInspectorProxy pointer to null, which later is accessed by
     13        initializeWebPage(). This patch avoids a crash scenario where
     14        calls into a null pointer would be made.
     15
     16        * UIProcess/WebPageProxy.cpp:
     17        (WebKit::WebPageProxy::reattachToWebProcess):
     18
    1192013-02-12  Joseph Pecoraro  <pecoraro@apple.com>
    220
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp

    r142542 r142704  
    397397    m_process->addMessageReceiver(Messages::WebPageProxy::messageReceiverName(), m_pageID, this);
    398398
     399#if ENABLE(INSPECTOR)
     400    m_inspector = WebInspectorProxy::create(this);
     401#endif
     402#if ENABLE(FULLSCREEN_API)
     403    m_fullScreenManager = WebFullScreenManagerProxy::create(this);
     404#endif
     405
    399406    initializeWebPage();
    400407
    401408    m_pageClient->didRelaunchProcess();
    402409    m_drawingArea->waitForBackingStoreUpdateOnNextPaint();
    403 
    404 #if ENABLE(INSPECTOR)
    405     m_inspector = WebInspectorProxy::create(this);
    406 #endif
    407 #if ENABLE(FULLSCREEN_API)
    408     m_fullScreenManager = WebFullScreenManagerProxy::create(this);
    409 #endif
    410410}
    411411
  • trunk/Tools/ChangeLog

    r142692 r142704  
     12013-02-12  Adenilson Cavalcanti  <cavalcantii@gmail.com>
     2
     3        [WK2] Page reloading will crash UIProcess after WebProcess was killed
     4        https://bugs.webkit.org/show_bug.cgi?id=109305
     5
     6        Reviewed by Benjamin Poulain.
     7
     8        Adding a new test to simulate the case of WebProcess crash followed by a trying
     9        to load a new page.
     10
     11        * TestWebKitAPI/GNUmakefile.am:
     12        * TestWebKitAPI/PlatformEfl.cmake:
     13        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
     14        * TestWebKitAPI/Tests/WebKit2/ReloadPageAfterCrash.cpp: Added.
     15        (TestWebKitAPI):
     16        (TestWebKitAPI::didFinishLoad):
     17        (TestWebKitAPI::TEST):
     18
    1192013-02-11  Brent Fulgham  <bfulgham@webkit.org>
    220
  • trunk/Tools/TestWebKitAPI/GNUmakefile.am

    r141126 r142704  
    153153        Tools/TestWebKitAPI/Tests/WebKit2/LoadCanceledNoServerRedirectCallback.cpp \
    154154        Tools/TestWebKitAPI/Tests/WebKit2/MouseMoveAfterCrash.cpp \
     155        Tools/TestWebKitAPI/Tests/WebKit2/ReloadPageAfterCrash.cpp \
    155156        Tools/TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayout.cpp \
    156157        Tools/TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFails.cpp \
  • trunk/Tools/TestWebKitAPI/PlatformEfl.cmake

    r140146 r142704  
    7070    LoadCanceledNoServerRedirectCallback
    7171    MouseMoveAfterCrash
     72    ReloadPageAfterCrash
    7273    NewFirstVisuallyNonEmptyLayout
    7374    NewFirstVisuallyNonEmptyLayoutFails
  • trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj

    r142637 r142704  
    8989                76E182DF154767E600F1FADD /* auto-submitting-form.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 76E182DE15475A8300F1FADD /* auto-submitting-form.html */; };
    9090                81B50193140F232300D9EB58 /* StringBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 81B50192140F232300D9EB58 /* StringBuilder.cpp */; };
     91                8A3AF93B16C9ED2700D248C1 /* ReloadPageAfterCrash.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8A3AF93A16C9ED2700D248C1 /* ReloadPageAfterCrash.cpp */; };
    9192                930AD402150698D00067970F /* lots-of-text.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 930AD401150698B30067970F /* lots-of-text.html */; };
    9293                9318778915EEC57700A9CCE3 /* NewFirstVisuallyNonEmptyLayoutForImages.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93AF4ECA1506F035007FD57E /* NewFirstVisuallyNonEmptyLayoutForImages.cpp */; };
     
    348349                76E182DE15475A8300F1FADD /* auto-submitting-form.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "auto-submitting-form.html"; sourceTree = "<group>"; };
    349350                81B50192140F232300D9EB58 /* StringBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StringBuilder.cpp; path = WTF/StringBuilder.cpp; sourceTree = "<group>"; };
     351                8A3AF93A16C9ED2700D248C1 /* ReloadPageAfterCrash.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReloadPageAfterCrash.cpp; sourceTree = "<group>"; };
    350352                8DD76FA10486AA7600D96B5E /* TestWebKitAPI */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = TestWebKitAPI; sourceTree = BUILT_PRODUCTS_DIR; };
    351353                930AD401150698B30067970F /* lots-of-text.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "lots-of-text.html"; sourceTree = "<group>"; };
     
    666668                                333B9CE11277F23100FEFCE3 /* PreventEmptyUserAgent.cpp */,
    667669                                F6FDDDD214241AD4004F1729 /* PrivateBrowsingPushStateNoHistoryCallback.cpp */,
     670                                8A3AF93A16C9ED2700D248C1 /* ReloadPageAfterCrash.cpp */,
    668671                                C0BD669C131D3CF700E18F2A /* ResponsivenessTimerDoesntFireEarly.cpp */,
    669672                                C0BD669E131D3CFF00E18F2A /* ResponsivenessTimerDoesntFireEarly_Bundle.cpp */,
     
    10411044                                F6FDDDD314241AD4004F1729 /* PrivateBrowsingPushStateNoHistoryCallback.cpp in Sources */,
    10421045                                0FC6C4CC141027E0005B7F0C /* RedBlackTree.cpp in Sources */,
     1046                                8A3AF93B16C9ED2700D248C1 /* ReloadPageAfterCrash.cpp in Sources */,
    10431047                                3722C8691461E03E00C45D00 /* RenderedImageFromDOMRange.mm in Sources */,
    10441048                                C0BD669D131D3CF700E18F2A /* ResponsivenessTimerDoesntFireEarly.cpp in Sources */,
Note: See TracChangeset for help on using the changeset viewer.