Changeset 93679 in webkit


Ignore:
Timestamp:
Aug 23, 2011 6:18:00 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

[chromium] Renderer crashes when about:gpucrash is loaded
https://bugs.webkit.org/show_bug.cgi?id=66814

Source/WebCore:

WebViewImpl::didRecreateGraphicsContext() was calling
setRootLayer() on the CC layer tree, but the root layer
doesn't actually change and the code wasn't defensive
against this. This CL adds some asserts to catch tree
corruption and removes the unnecessary calls.

Patch by Iain Merrick <husky@google.com> on 2011-08-23
Reviewed by James Robinson.

  • platform/graphics/GraphicsLayer.cpp:

(WebCore::GraphicsLayer::setParent):

  • platform/graphics/GraphicsLayer.h:
  • platform/graphics/chromium/LayerChromium.cpp:

(WebCore::LayerChromium::setParent):
(WebCore::LayerChromium::hasAncestor):

  • platform/graphics/chromium/LayerChromium.h:

Source/WebKit/chromium:

WebViewImpl::didRecreateGraphicsContext() was calling
setRootLayer() on the CC layer tree, but the root layer
doesn't actually change and the code wasn't defensive
against this. This CL adds some asserts to catch tree
corruption and removes the unnecessary calls.

Patch by Iain Merrick <husky@google.com> on 2011-08-23
Reviewed by James Robinson.

  • src/WebViewImpl.cpp:

(WebKit::WebViewImpl::didRecreateGraphicsContext):

Location:
trunk/Source
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r93676 r93679  
     12011-08-23  Iain Merrick  <husky@google.com>
     2
     3        [chromium] Renderer crashes when about:gpucrash is loaded
     4        https://bugs.webkit.org/show_bug.cgi?id=66814
     5
     6        WebViewImpl::didRecreateGraphicsContext() was calling
     7        setRootLayer() on the CC layer tree, but the root layer
     8        doesn't actually change and the code wasn't defensive       
     9        against this. This CL adds some asserts to catch tree
     10        corruption and removes the unnecessary calls.
     11
     12        Reviewed by James Robinson.
     13
     14        * platform/graphics/GraphicsLayer.cpp:
     15        (WebCore::GraphicsLayer::setParent):
     16        * platform/graphics/GraphicsLayer.h:
     17        * platform/graphics/chromium/LayerChromium.cpp:
     18        (WebCore::LayerChromium::setParent):
     19        (WebCore::LayerChromium::hasAncestor):
     20        * platform/graphics/chromium/LayerChromium.h:
     21
    1222011-08-23  Sheriff Bot  <webkit.review.bot@gmail.com>
    223
  • trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp

    r93040 r93679  
    9191    removeAllChildren();
    9292    removeFromParent();
     93}
     94
     95void GraphicsLayer::setParent(GraphicsLayer* layer)
     96{
     97    ASSERT(!layer || !layer->hasAncestor(this));
     98    m_parent = layer;
    9399}
    94100
  • trunk/Source/WebCore/platform/graphics/GraphicsLayer.h

    r93040 r93679  
    197197
    198198    GraphicsLayer* parent() const { return m_parent; };
    199     void setParent(GraphicsLayer* layer) { m_parent = layer; } // Internal use only.
     199    void setParent(GraphicsLayer*); // Internal use only.
    200200   
    201201    // Returns true if the layer has the given layer as an ancestor (excluding self).
  • trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp

    r93615 r93679  
    126126}
    127127
     128void LayerChromium::setParent(LayerChromium* layer)
     129{
     130    ASSERT(!layer || !layer->hasAncestor(this));
     131    m_parent = layer;
     132}
     133
     134bool LayerChromium::hasAncestor(LayerChromium* ancestor) const
     135{
     136    for (LayerChromium* layer = parent(); layer; layer = layer->parent()) {
     137        if (layer == ancestor)
     138            return true;
     139    }
     140    return false;
     141}
     142
    128143void LayerChromium::addChild(PassRefPtr<LayerChromium> child)
    129144{
  • trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h

    r93615 r93679  
    249249    void setNeedsCommit();
    250250
    251     void setParent(LayerChromium* parent) { m_parent = parent; }
     251    void setParent(LayerChromium*);
     252    bool hasAncestor(LayerChromium*) const;
    252253
    253254    size_t numChildren() const
  • trunk/Source/WebKit/chromium/ChangeLog

    r93654 r93679  
     12011-08-23  Iain Merrick  <husky@google.com>
     2
     3        [chromium] Renderer crashes when about:gpucrash is loaded
     4        https://bugs.webkit.org/show_bug.cgi?id=66814
     5
     6        WebViewImpl::didRecreateGraphicsContext() was calling
     7        setRootLayer() on the CC layer tree, but the root layer
     8        doesn't actually change and the code wasn't defensive
     9        against this. This CL adds some asserts to catch tree
     10        corruption and removes the unnecessary calls.
     11
     12        Reviewed by James Robinson.
     13
     14        * src/WebViewImpl.cpp:
     15        (WebKit::WebViewImpl::didRecreateGraphicsContext):
     16
    1172011-08-23  Dmitry Lomov  <Dmitry Lomov (dslomov@google.com)>
    218
  • trunk/Source/WebKit/chromium/src/WebViewImpl.cpp

    r93625 r93679  
    26622662void WebViewImpl::didRecreateGraphicsContext(bool success)
    26632663{
    2664     setRootGraphicsLayer(success ? m_layerTreeHost->rootLayer() : 0);
    2665 
    2666     if (success) {
    2667       // Forces ViewHostMsg_DidActivateAcceleratedCompositing to be sent so
    2668       // that the browser process can reacquire surfaces.
    2669       m_client->didActivateAcceleratedCompositing(true);
    2670       if (m_pageOverlay)
    2671           m_pageOverlay->update();
    2672     }
     2664    // Force ViewHostMsg_DidActivateAcceleratedCompositing to be sent so
     2665    // that the browser process can reacquire surfaces.
     2666    m_isAcceleratedCompositingActive = false;
     2667    setIsAcceleratedCompositingActive(success);
     2668    if (success && m_pageOverlay)
     2669        m_pageOverlay->update();
    26732670}
    26742671
Note: See TracChangeset for help on using the changeset viewer.