Changeset 194925 in webkit


Ignore:
Timestamp:
Jan 12, 2016 2:06:46 PM (8 years ago)
Author:
ggaren@apple.com
Message:

WebPageProxy should reattach to the web process before navigating
https://bugs.webkit.org/show_bug.cgi?id=153026

Reviewed by Anders Carlsson.

This fixes a crash (and lots of other corruption) when force-quitting
the web process during navigation.

Some objects (like ViewGestureController) use one-time initialization
to point to a ChildProcessProxy -- and, by design, we destroy them when
the ChildProcessProxy becomes invalid (i.e., crashes or quits).

If we navigate *before* creating a new, valid ChildProcessProxy, then
we accidentally re-create these objects pointing to the old, invalid
ChildProcessProxy.

We need to wait until we have a valid ChildProcessProxy before we
initialize these objects.

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::reattachToWebProcessWithItem): Navigate after
reattaching to the web process so that lazily allocated helper objects
point to the right ChildProcessProxy.

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r194921 r194925  
     12016-01-12  Geoffrey Garen  <ggaren@apple.com>
     2
     3        WebPageProxy should reattach to the web process before navigating
     4        https://bugs.webkit.org/show_bug.cgi?id=153026
     5
     6        Reviewed by Anders Carlsson.
     7
     8        This fixes a crash (and lots of other corruption) when force-quitting
     9        the web process during navigation.
     10
     11        Some objects (like ViewGestureController) use one-time initialization
     12        to point to a ChildProcessProxy -- and, by design, we destroy them when
     13        the ChildProcessProxy becomes invalid (i.e., crashes or quits).
     14
     15        If we navigate *before* creating a new, valid ChildProcessProxy, then
     16        we accidentally re-create these objects pointing to the old, invalid
     17        ChildProcessProxy.
     18
     19        We need to wait until we have a valid ChildProcessProxy before we
     20        initialize these objects.
     21
     22        * UIProcess/WebPageProxy.cpp:
     23        (WebKit::WebPageProxy::reattachToWebProcessWithItem): Navigate after
     24        reattaching to the web process so that lazily allocated helper objects
     25        point to the right ChildProcessProxy.
     26
    1272016-01-12  Ryosuke Niwa  <rniwa@webkit.org>
    228
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp

    r194496 r194925  
    739739        return nullptr;
    740740
    741     if (item && item != m_backForwardList->currentItem())
    742         m_backForwardList->goToItem(item);
    743 
    744741    ASSERT(!isValid());
    745742    reattachToWebProcess();
     
    747744    if (!item)
    748745        return nullptr;
     746
     747    if (item != m_backForwardList->currentItem())
     748        m_backForwardList->goToItem(item);
    749749
    750750    auto navigation = m_navigationState->createBackForwardNavigation();
Note: See TracChangeset for help on using the changeset viewer.