Changeset 82633 in webkit


Ignore:
Timestamp:
Mar 31, 2011 4:15:52 PM (13 years ago)
Author:
Adam Roben
Message:

Don't ref CACFLayerTreeHosts when telling them to flush layer changes

LayerChangesFlusher was reffing CACFLayerTreeHosts before calling out to them. This would
have protected us if calling out to one CACFLayerTreeHost could cause a different
CACFLayerTreeHost to be destroyed. But that isn't possible; each CACFLayerTreeHost is
associated with its own page, and flushing layer changes doesn't touch any other page. So it
isn't possible for a CACFLayerTreeHost to be deleted while another one is flushing layer
changes.

One benefit of this change is that it will make it easier to make LayerChangesFlusher
interact with a forthcoming abstract base class, rather than with CACFLayerTreeHost itself.

This should cause no change in behavior.

Fixes <http://webkit.org/b/57590> LayerChangesFlusher unnecessarily refs CACFLayerTreeHost
before calling out to it

Reviewed by Darin Adler.

  • platform/graphics/ca/win/LayerChangesFlusher.cpp:

(WebCore::LayerChangesFlusher::hookFired): Just store bare pointers to the
CACFLayerTreeHosts.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r82631 r82633  
     12011-03-31  Adam Roben  <aroben@apple.com>
     2
     3        Don't ref CACFLayerTreeHosts when telling them to flush layer changes
     4
     5        LayerChangesFlusher was reffing CACFLayerTreeHosts before calling out to them. This would
     6        have protected us if calling out to one CACFLayerTreeHost could cause a different
     7        CACFLayerTreeHost to be destroyed. But that isn't possible; each CACFLayerTreeHost is
     8        associated with its own page, and flushing layer changes doesn't touch any other page. So it
     9        isn't possible for a CACFLayerTreeHost to be deleted while another one is flushing layer
     10        changes.
     11
     12        One benefit of this change is that it will make it easier to make LayerChangesFlusher
     13        interact with a forthcoming abstract base class, rather than with CACFLayerTreeHost itself.
     14
     15        This should cause no change in behavior.
     16
     17        Fixes <http://webkit.org/b/57590> LayerChangesFlusher unnecessarily refs CACFLayerTreeHost
     18        before calling out to it
     19
     20        Reviewed by Darin Adler.
     21
     22        * platform/graphics/ca/win/LayerChangesFlusher.cpp:
     23        (WebCore::LayerChangesFlusher::hookFired): Just store bare pointers to the
     24        CACFLayerTreeHosts.
     25
    1262011-03-31  Antti Koivisto  <antti@apple.com>
    227
  • trunk/Source/WebCore/platform/graphics/ca/win/LayerChangesFlusher.cpp

    r76372 r82633  
    8181
    8282    // Calling out to the hosts can cause m_hostsWithChangesToFlush to be modified, so we copy it
    83     // into a Vector first. We have to hold a reference to them because otherwise they could be
    84     // destroyed while we're calling out to them.
    85     Vector<RefPtr<CACFLayerTreeHost> > hosts;
     83    // into a Vector first.
     84    Vector<CACFLayerTreeHost*> hosts;
    8685    copyToVector(m_hostsWithChangesToFlush, hosts);
    8786    m_hostsWithChangesToFlush.clear();
Note: See TracChangeset for help on using the changeset viewer.