Changeset 116657 in webkit


Ignore:
Timestamp:
May 10, 2012 10:15:55 AM (12 years ago)
Author:
tonikitoo@webkit.org
Message:

[BlackBerry] Assertions and assumptions in BackingStoreClient around m_frame and m_frame->view() are invalid
https://bugs.webkit.org/show_bug.cgi?id=86096

Reviewed by Rob Buis.
Patch by Antonio Gomes <agomes@rim.com>

A Frame's FrameView has always to be checked since it is
a volatile object, and gets created and destroyed all the time.

We have been facing a particular issue, where during our automated
interaction tests, the main frame object was being pinch zoomed in
the middle of it creation, and WebKit thread was blocked by a mutex.
In practice, it is a case that would not be possible in a real
world scenario, but shows that the ASSERTs are bogus regardless.

  • WebKitSupport/BackingStoreClient.cpp:

(BlackBerry::WebKit::BackingStoreClient::scrollPosition):
(BlackBerry::WebKit::BackingStoreClient::setScrollPosition):
(BlackBerry::WebKit::BackingStoreClient::maximumScrollPosition):
(BlackBerry::WebKit::BackingStoreClient::viewportSize):
(BlackBerry::WebKit::BackingStoreClient::transformedViewportSize):
(BlackBerry::WebKit::BackingStoreClient::visibleContentsRect):
(BlackBerry::WebKit::BackingStoreClient::contentsSize):

Location:
trunk/Source/WebKit/blackberry
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/blackberry/ChangeLog

    r116603 r116657  
     12012-05-10  Antonio Gomes  <agomes@rim.com>
     2
     3        [BlackBerry] Assertions and assumptions in BackingStoreClient around m_frame and m_frame->view() are invalid
     4        https://bugs.webkit.org/show_bug.cgi?id=86096
     5
     6        Reviewed by Rob Buis.
     7
     8        A Frame's FrameView has always to be checked since it is
     9        a volatile object, and gets created and destroyed all the time.
     10
     11        We have been facing a particular issue, where during our automated
     12        interaction tests, the main frame object was being pinch zoomed in
     13        the middle of it creation, and WebKit thread was blocked by a mutex.
     14        In practice, it is a case that would not be possible in a real
     15        world scenario, but shows that the ASSERTs are bogus regardless.
     16
     17        * WebKitSupport/BackingStoreClient.cpp:
     18        (BlackBerry::WebKit::BackingStoreClient::scrollPosition):
     19        (BlackBerry::WebKit::BackingStoreClient::setScrollPosition):
     20        (BlackBerry::WebKit::BackingStoreClient::maximumScrollPosition):
     21        (BlackBerry::WebKit::BackingStoreClient::viewportSize):
     22        (BlackBerry::WebKit::BackingStoreClient::transformedViewportSize):
     23        (BlackBerry::WebKit::BackingStoreClient::visibleContentsRect):
     24        (BlackBerry::WebKit::BackingStoreClient::contentsSize):
     25
    1262012-05-09  Jonathan Dong  <jonathan.dong@torchmobile.com.cn>
    227
  • trunk/Source/WebKit/blackberry/WebKitSupport/BackingStoreClient.cpp

    r107716 r116657  
    169169{
    170170    ASSERT(m_frame);
     171    if (!m_frame->view())
     172        return IntPoint();
     173
    171174    return m_frame->view()->scrollPosition() - pointToSize(m_frame->view()->minimumScrollPosition());
    172175}
     
    179182void BackingStoreClient::setScrollPosition(const IntPoint& pos)
    180183{
    181     ASSERT(m_frame->view());
     184    ASSERT(m_frame);
     185    if (!m_frame->view())
     186        return;
     187
    182188    if (pos == scrollPosition())
    183189        return;
     
    197203IntPoint BackingStoreClient::maximumScrollPosition() const
    198204{
    199     ASSERT(m_frame->view());
     205    ASSERT(m_frame);
     206    if (!m_frame->view())
     207        return IntPoint();
     208
    200209    return m_frame->view()->maximumScrollPosition() - pointToSize(m_frame->view()->minimumScrollPosition());
    201210}
     
    221230IntSize BackingStoreClient::viewportSize() const
    222231{
    223     ASSERT(m_frame->view());
     232    ASSERT(m_frame);
     233    if (!m_frame->view())
     234        return IntSize();
     235
    224236    if (isMainFrame())
    225237        return m_webPage->d->viewportSize();
     
    230242IntSize BackingStoreClient::transformedViewportSize() const
    231243{
     244    ASSERT(m_frame);
     245    if (!m_frame->view())
     246        return IntSize();
     247
    232248    if (isMainFrame())
    233249        return m_webPage->d->transformedViewportSize();
    234250
    235     ASSERT(m_frame->view());
    236251    const IntSize untransformedViewportSize = m_frame->view()->visibleContentRect().size();
    237252    const FloatPoint transformedBottomRight = m_webPage->d->m_transformationMatrix->mapPoint(
     
    242257IntRect BackingStoreClient::visibleContentsRect() const
    243258{
    244     ASSERT(m_frame->view());
     259    ASSERT(m_frame);
     260    if (!m_frame->view())
     261        return IntRect();
     262
    245263    IntRect visibleContentRect = m_frame->view()->visibleContentRect();
    246264    if (isMainFrame())
     
    274292IntSize BackingStoreClient::contentsSize() const
    275293{
    276     ASSERT(m_frame->view());
     294    ASSERT(m_frame);
     295    if (!m_frame->view())
     296        return IntSize();
     297
    277298    return m_frame->view()->contentsSize();
    278299}
Note: See TracChangeset for help on using the changeset viewer.