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

Unified Diff: ash/wm/window_animations.cc

Issue 10882043: Revert 153291 - Fixes crash introduced @ 153047 (you can hit crash by maximizing a (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/window_animations.h ('k') | ash/wm/window_animations_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/window_animations.cc
===================================================================
--- ash/wm/window_animations.cc (revision 153309)
+++ ash/wm/window_animations.cc (working copy)
@@ -50,6 +50,7 @@
namespace {
const float kWindowAnimation_Vertical_TranslateY = 15.f;
+bool delayed_old_layer_deletion_in_cross_fade_for_test_ = false;
}
DEFINE_WINDOW_PROPERTY_KEY(WindowVisibilityAnimationType,
@@ -663,7 +664,13 @@
// ui::ImplicitAnimationObserver overrides:
virtual void OnImplicitAnimationsCompleted() OVERRIDE {
- delete this;
+ // ImplicitAnimationObserver's base class uses the object after
+ // calling this function, so we cannot delete |this|. The |layer_|
+ // may be gone by the next message loop run when shutting down, so
+ // clean them up now.
+ if (!delayed_old_layer_deletion_in_cross_fade_for_test_)
+ Cleanup();
+ MessageLoop::current()->DeleteSoon(FROM_HERE, this);
}
private:
@@ -975,5 +982,9 @@
}
}
+void SetDelayedOldLayerDeletionInCrossFadeForTest(bool value) {
+ delayed_old_layer_deletion_in_cross_fade_for_test_ = value;
+}
+
} // namespace internal
} // namespace ash
« no previous file with comments | « ash/wm/window_animations.h ('k') | ash/wm/window_animations_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698