OSDN Git Service

Fix Browser ANR
authorNicolas Roard <nicolasroard@google.com>
Thu, 17 Mar 2011 17:31:57 +0000 (10:31 -0700)
committerNicolas Roard <nicolasroard@google.com>
Thu, 17 Mar 2011 17:38:52 +0000 (10:38 -0700)
commit439cfed476441572caa4206a622e3ef3c188798b
tree631463d8527b7db32c6e90a331f6e226920fa9d4
parent9f5143f9ae49a8e5fdb7ea626c4efad66096b020
Fix Browser ANR

The problem was that when attempting to forcefully destroy a texture
in TilesManager::cleanupLayersTextures(), the call to
LayerAndroid::removeTexture() may fail if the texture was busy being
painted -- the call to BackedDoubleBufferedTexture::release() would
return false, and the layer may thus still keep a pointer to the texture.
But the release() call, while indicating it failed, was only delaying
the release -- as soon as the texture was marked as not busy, it
could set its owner to nil.

We could thus have a situation where the layer did not reset its
texture pointers because the owner of the texture was not yet
changed, but the texture would then reset its owner to nil as soon
as it was not busy painting.

In TilesManager::cleanupLayersTexture() the next step before deleting
a texture is to check that the texture does not have an owner -- but
by then the texture could have been marked as not busy, and removed
its owner, letting TilesManager destroying it.

bug:3472320
Change-Id: I3bcf169b30dfacba1773d3b79a3c0d205bf3cbdb
WebCore/platform/graphics/android/BackedDoubleBufferedTexture.cpp
WebCore/platform/graphics/android/BackedDoubleBufferedTexture.h
WebCore/platform/graphics/android/LayerAndroid.cpp