Changeset 137140 in webkit


Ignore:
Timestamp:
Dec 10, 2012, 5:34:44 AM (13 years ago)
Author:
charles.wei@torchmobile.com.cn
Message:

[BlackBerry] Webkit crashes sometimes (even though very rarely) when deleting a webview
https://bugs.webkit.org/show_bug.cgi?id=104504

Reviewed by George Staikos.

When deleting a webview, the webkit thread will send a sync message to userInterfaceThread
to delete handlers, including the viewport accessor. But the UserInterfaceThread could be
doing a blit after it has deleted the viewport accessor and before the webkit thread gets
the time slot to resume it's operation to clean up the webview, which leaves a very short
time that viewport accessor of a webpage has been deleted while the webpage is still in
the process of deleting, and the viewport accessor is referenced in the UserInterfaceThread.

So we need to check if the viewport accessor is NULL before using it in the backingstore code.

  • Api/BackingStore.cpp:

(BlackBerry::WebKit::BackingStorePrivate::blitVisibleContents):
(BlackBerry::WebKit::BackingStorePrivate::invalidateWindow):

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

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/blackberry/Api/BackingStore.cpp

    r136965 r137140  
    12861286
    12871287    Platform::ViewportAccessor* viewportAccessor = m_webPage->client()->userInterfaceViewportAccessor();
     1288    if (!viewportAccessor)
     1289        return;
    12881290    const Platform::IntRect dstRect = viewportAccessor->destinationSurfaceRect();
    12891291
     
    22852287{
    22862288    // Grab a rect appropriate for the current thread.
    2287     if (BlackBerry::Platform::userInterfaceThreadMessageClient()->isCurrentThread())
    2288         invalidateWindow(m_webPage->client()->userInterfaceViewportAccessor()->destinationSurfaceRect());
    2289     else
     2289    if (BlackBerry::Platform::userInterfaceThreadMessageClient()->isCurrentThread()) {
     2290        if (m_webPage->client()->userInterfaceViewportAccessor())
     2291            invalidateWindow(m_webPage->client()->userInterfaceViewportAccessor()->destinationSurfaceRect());
     2292    } else
    22902293        invalidateWindow(Platform::IntRect(Platform::IntPoint(0, 0), m_client->transformedViewportSize()));
    22912294}
  • trunk/Source/WebKit/blackberry/ChangeLog

    r137124 r137140  
     12012-12-10  Charles Wei  <charles.wei@torchmobile.com.cn>
     2
     3        [BlackBerry] Webkit crashes sometimes (even though very rarely) when deleting a webview
     4        https://bugs.webkit.org/show_bug.cgi?id=104504
     5
     6        Reviewed by George Staikos.
     7
     8        When deleting a webview, the webkit thread will send a sync message to userInterfaceThread
     9        to delete handlers, including the viewport accessor. But the UserInterfaceThread could be
     10        doing a blit after it has deleted the viewport accessor and before the webkit thread gets
     11        the time slot to resume it's operation to clean up the webview, which leaves a very short
     12        time that viewport accessor of a webpage has been deleted while the webpage is still in
     13        the process of deleting, and the viewport accessor is referenced in the UserInterfaceThread.
     14
     15        So we need to check if the viewport accessor is NULL before using it in the backingstore code.
     16
     17        * Api/BackingStore.cpp:
     18        (BlackBerry::WebKit::BackingStorePrivate::blitVisibleContents):
     19        (BlackBerry::WebKit::BackingStorePrivate::invalidateWindow):
     20
    1212012-12-10  Kent Tamura  <tkent@chromium.org>
    222
Note: See TracChangeset for help on using the changeset viewer.