Changeset 118702 in webkit


Ignore:
Timestamp:
May 28, 2012 12:21:23 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[BlackBerry] Dangling pointer in WebPagePrivate::setCompositor() message
https://bugs.webkit.org/show_bug.cgi?id=87590

Patch by Arvid Nilsson <anilsson@rim.com> on 2012-05-28
Reviewed by Rob Buis.

A crash would be seen in GuardedPointerBase::getWithGuardLocked when
attempting to unpickle and execute serialized call to setCompositor.

The problem was that the message had been created with a dangling
pointer as the target. The web page failed to inform its compositor
that it was being destroyed due to an early return in
WebPagePrivate::destroyCompositor.

The root cause was that a method called "destroyCompositor" was being
called in two situations, when navigating to a new page as well as when
actually deleting the web page. And in one case, we really only wanted
to free up some memory by clearing textures, while in the other case we
really did want to destroy the compositor.

Fixed by calling a method to release textures when that's what we want
to do, and calling a method to destroy the compositor when that's what
we want to do, and making that latter method unconditional.

Reviewed internally by Jeff Rogers.

PR #156765

  • Api/WebPage.cpp:

(BlackBerry::WebKit::WebPagePrivate::setLoadState):
(BlackBerry::WebKit::WebPagePrivate::destroyCompositor):

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

Legend:

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

    r118701 r118702  
    885885
    886886#if USE(ACCELERATED_COMPOSITING)
    887             if (isAcceleratedCompositingActive() && !compositorDrawsRootLayer())
    888                 syncDestroyCompositorOnCompositingThread();
     887            if (isAcceleratedCompositingActive()) {
     888                Platform::userInterfaceThreadMessageClient()->dispatchSyncMessage(
     889                    Platform::createMethodCallMessage(&WebPagePrivate::destroyLayerResources, this));
     890            }
    889891#endif
    890892            m_previousContentsSize = IntSize();
     
    58965898void WebPagePrivate::destroyCompositor()
    58975899{
    5898     // We shouldn't release the compositor unless we created and own the
    5899     // context. If the compositor was created from the WebPageCompositor API,
    5900     // keep it around and reuse it later.
    5901     if (!m_ownedContext)
    5902         return;
    5903 
    59045900    // m_compositor is a RefPtr, so it may live on beyond this point.
    59055901    // Disconnect the compositor from us
  • trunk/Source/WebKit/blackberry/ChangeLog

    r118701 r118702  
     12012-05-28  Arvid Nilsson  <anilsson@rim.com>
     2
     3        [BlackBerry] Dangling pointer in WebPagePrivate::setCompositor() message
     4        https://bugs.webkit.org/show_bug.cgi?id=87590
     5
     6        Reviewed by Rob Buis.
     7
     8        A crash would be seen in GuardedPointerBase::getWithGuardLocked when
     9        attempting to unpickle and execute serialized call to setCompositor.
     10
     11        The problem was that the message had been created with a dangling
     12        pointer as the target. The web page failed to inform its compositor
     13        that it was being destroyed due to an early return in
     14        WebPagePrivate::destroyCompositor.
     15
     16        The root cause was that a method called "destroyCompositor" was being
     17        called in two situations, when navigating to a new page as well as when
     18        actually deleting the web page. And in one case, we really only wanted
     19        to free up some memory by clearing textures, while in the other case we
     20        really did want to destroy the compositor.
     21
     22        Fixed by calling a method to release textures when that's what we want
     23        to do, and calling a method to destroy the compositor when that's what
     24        we want to do, and making that latter method unconditional.
     25
     26        Reviewed internally by Jeff Rogers.
     27
     28        PR #156765
     29
     30        * Api/WebPage.cpp:
     31        (BlackBerry::WebKit::WebPagePrivate::setLoadState):
     32        (BlackBerry::WebKit::WebPagePrivate::destroyCompositor):
     33
    1342012-05-28  Arvid Nilsson  <anilsson@rim.com>
    235
Note: See TracChangeset for help on using the changeset viewer.