Changeset 180051 in webkit


Ignore:
Timestamp:
Feb 13, 2015 9:32:14 AM (9 years ago)
Author:
Antti Koivisto
Message:

Add some RELEASE_ASSERTs to try to catch crashes in StyleResolver::loadPendingImages
https://bugs.webkit.org/show_bug.cgi?id=141561

Reviewed by Simon Fraser.

One possibility is that loads triggered by loadPendingImages end up synchronously destroying or re-entering
style resolver. Try to catch these in release builds.

  • css/StyleResolver.cpp:

(WebCore::StyleResolver::~StyleResolver):
(WebCore::StyleResolver::styleForElement):
(WebCore::StyleResolver::styleForKeyframe):
(WebCore::StyleResolver::styleForPage):
(WebCore::StyleResolver::loadPendingImages):

  • css/StyleResolver.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r180050 r180051  
     12015-02-13  Antti Koivisto  <antti@apple.com>
     2
     3        Add some RELEASE_ASSERTs to try to catch crashes in StyleResolver::loadPendingImages
     4        https://bugs.webkit.org/show_bug.cgi?id=141561
     5
     6        Reviewed by Simon Fraser.
     7
     8        One possibility is that loads triggered by loadPendingImages end up synchronously destroying or re-entering
     9        style resolver. Try to catch these in release builds.
     10
     11        * css/StyleResolver.cpp:
     12        (WebCore::StyleResolver::~StyleResolver):
     13        (WebCore::StyleResolver::styleForElement):
     14        (WebCore::StyleResolver::styleForKeyframe):
     15        (WebCore::StyleResolver::styleForPage):
     16        (WebCore::StyleResolver::loadPendingImages):
     17        * css/StyleResolver.h:
     18
    1192015-02-13  ChangSeok Oh  <changseok.oh@collabora.com>
    220
  • trunk/Source/WebCore/css/StyleResolver.cpp

    r179791 r180051  
    141141#include <bitset>
    142142#include <wtf/StdLibExtras.h>
     143#include <wtf/TemporaryChange.h>
    143144#include <wtf/Vector.h>
    144145
     
    345346StyleResolver::~StyleResolver()
    346347{
     348    RELEASE_ASSERT(!m_inLoadPendingImages);
     349
    347350#if ENABLE(CSS_DEVICE_ADAPTATION)
    348351    m_viewportStyleResolver->clearDocument();
     
    741744    StyleSharingBehavior sharingBehavior, RuleMatchingBehavior matchingBehavior, const RenderRegion* regionForStyling)
    742745{
     746    RELEASE_ASSERT(!m_inLoadPendingImages);
     747
    743748    // Once an element has a renderer, we don't try to destroy it, since otherwise the renderer
    744749    // will vanish if a style recalc happens during loading.
     
    812817Ref<RenderStyle> StyleResolver::styleForKeyframe(const RenderStyle* elementStyle, const StyleKeyframe* keyframe, KeyframeValue& keyframeValue)
    813818{
     819    RELEASE_ASSERT(!m_inLoadPendingImages);
     820
    814821    MatchResult result;
    815822    result.addMatchedProperties(keyframe->properties());
     
    979986Ref<RenderStyle> StyleResolver::styleForPage(int pageIndex)
    980987{
     988    RELEASE_ASSERT(!m_inLoadPendingImages);
     989
    981990    m_state.initForStyleResolve(m_document, m_document.documentElement(), m_document.renderStyle());
    982991
     
    24292438void StyleResolver::loadPendingImages()
    24302439{
     2440    RELEASE_ASSERT(!m_inLoadPendingImages);
     2441    TemporaryChange<bool> { m_inLoadPendingImages, true };
     2442
    24312443    if (m_state.pendingImageProperties().isEmpty())
    24322444        return;
  • trunk/Source/WebCore/css/StyleResolver.h

    r179119 r180051  
    526526    State m_state;
    527527
     528    // Try to catch a crash. https://bugs.webkit.org/show_bug.cgi?id=141561.
     529    bool m_inLoadPendingImages { false };
     530
    528531    friend bool operator==(const MatchedProperties&, const MatchedProperties&);
    529532    friend bool operator!=(const MatchedProperties&, const MatchedProperties&);
Note: See TracChangeset for help on using the changeset viewer.