Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Issue 10823142: Fix a race condition when an IconAnimation is still running at browser shutdown. (Closed)

Created:
8 years, 4 months ago by Jeffrey Yasskin
Modified:
8 years, 4 months ago
CC:
chromium-reviews, Aaron Boodman, mihaip-chromium-reviews_chromium.org
Visibility:
Public.

Description

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 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=149636

Patch Set 1 #

Patch Set 2 : Comment tweak. #

Total comments: 4

Patch Set 3 : Fix nits. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+110 lines, -31 lines) Patch
M chrome/browser/extensions/api/extension_action/script_badge_apitest.cc View 2 chunks +34 lines, -2 lines 0 comments Download
M chrome/browser/extensions/script_badge_controller.cc View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/extensions/extension.cc View 2 chunks +2 lines, -4 lines 0 comments Download
M chrome/common/extensions/extension_action.h View 2 chunks +14 lines, -2 lines 0 comments Download
M chrome/common/extensions/extension_action.cc View 1 2 3 chunks +40 lines, -22 lines 0 comments Download
M chrome/test/data/extensions/api_test/script_badge/basics/background.js View 1 2 1 chunk +18 lines, -0 lines 0 comments Download
M chrome/test/data/extensions/api_test/script_badge/basics/manifest.json View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 5 (0 generated)
Jeffrey Yasskin
8 years, 4 months ago (2012-08-02 14:28:35 UTC) #1
not at google - send to devlin
lgtm https://chromiumcodereview.appspot.com/10823142/diff/1008/chrome/common/extensions/extension_action.cc File chrome/common/extensions/extension_action.cc (right): https://chromiumcodereview.appspot.com/10823142/diff/1008/chrome/common/extensions/extension_action.cc#newcode357 chrome/common/extensions/extension_action.cc:357: icon_animation_.begin(); it != icon_animation_.end();) { nits: you could ...
8 years, 4 months ago (2012-08-02 14:44:25 UTC) #2
Jeffrey Yasskin
Thanks! https://chromiumcodereview.appspot.com/10823142/diff/1008/chrome/common/extensions/extension_action.cc File chrome/common/extensions/extension_action.cc (right): https://chromiumcodereview.appspot.com/10823142/diff/1008/chrome/common/extensions/extension_action.cc#newcode357 chrome/common/extensions/extension_action.cc:357: icon_animation_.begin(); it != icon_animation_.end();) { On 2012/08/02 14:44:25, ...
8 years, 4 months ago (2012-08-02 15:11:49 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jyasskin@chromium.org/10823142/5001
8 years, 4 months ago (2012-08-02 15:12:05 UTC) #4
commit-bot: I haz the power
8 years, 4 months ago (2012-08-02 16:28:38 UTC) #5
Change committed as 149636

Powered by Google App Engine
This is Rietveld 408576698