OSDN Git Service

Fix a browser ANR
authorNicolas Roard <nicolasroard@google.com>
Tue, 22 Mar 2011 18:30:52 +0000 (11:30 -0700)
committerNicolas Roard <nicolasroard@google.com>
Tue, 22 Mar 2011 19:12:56 +0000 (12:12 -0700)
commit50e0a1d1948f6b53b9b6ea82f865812a7b42221b
tree58a560188e0e097d0f73dc6adf113ac523d99a51
parent983c9f05fadaaceaa011dec0e5bcff2bd2b4199f
Fix a browser ANR

Layer release textures (setting their owner to zero). Texture with no
owners are routinely destroyed by the TilesManager.
When a texture is busy, the release is delayed until the end of the
painting; if the owner of the texture is still the same, we then
remove it.

The problem was that a layer could release a busy texture, thereby
delaying the release; and in a next cycle re-acquire that same texture.
The delayed release would then kicks in, and proceed, as the owner
was still the same one as the one that originally asked for the release.

We would then have a situation where the layer thought it acquired a
texture, while that texture's owner was ultimately set to zero.
The TilesManager would then proceed to destroy that texture.
The next time the layer tried to use the texture, it would either crash
or more often block on acquiring a lock on it, causing an ANR.

bug:3472320
Change-Id: I84a064b1aa6636a18e0518e34c8572cbea3eb558
WebCore/platform/graphics/android/BackedDoubleBufferedTexture.cpp