Fix a race condition when an IconAnimation is still running at browser shutdown.
Because Extensions are refcounted, they can be destroyed from ~ProfileIOData on the IO thread instead of the UI thread. If an animation is running at that time, and the ExtensionAction owns its animations, then the animation's destructor will CHECK-fail while destroying its Timer, because the Timer has bound itself to the UI thread. After this patch, IconAnimationWrappers own themselves, and use WeakPtrs to indirectly remove themselves from the ExtensionAction. To limit the size of the ExtensionAction's map, we remove all NULLs each time we observe a single animation as having finished. BUG=133141 Review URL: https://chromiumcodereview.appspot.com/10823142 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149636 0039d316-1c4b-4281-b951-d872f2087c98
Showing
Please register or sign in to comment