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

Unified Diff: ash/shell.cc

Issue 101013002: Make sure WindowObservers are removed from window before destruction (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
Index: ash/shell.cc
diff --git a/ash/shell.cc b/ash/shell.cc
index 6fb3df982a13fc09b5c9993ca90e1e4d711d87cc..9572d07b1676d6542547ab40baf1279421d53094 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -630,42 +630,49 @@ Shell::~Shell() {
// Drag-and-drop must be canceled prior to close all windows.
drag_drop_controller_.reset();
+ // Controllers who has WindowObserver added must be deleted
+ // before |display_controller_| being deleted.
sky 2013/12/04 22:52:59 being -> is
oshima 2013/12/05 01:26:44 Done.
+#if defined(OS_CHROMEOS)
+ // Destroy VideoActivityNotifier before destroying VideoDetector.
sky 2013/12/04 22:52:59 This comment documents the code, and therefor isn'
oshima 2013/12/05 01:26:44 I need these comments not to break the order when
sky 2013/12/05 01:36:35 I'm fine with comments, but they should describe w
+ video_activity_notifier_.reset();
+#endif // defined(OS_CHROMEOS)
+ video_detector_.reset();
+
+ shadow_controller_.reset();
+ resize_shadow_controller_.reset();
+
+ window_cycle_controller_.reset();
+ mru_window_tracker_.reset();
+
// Destroy all child windows including widgets.
display_controller_->CloseChildWindows();
display_controller_->CloseNonDesktopDisplay();
+ // Launcher delete must be deleted before |focus_client_|.
sky 2013/12/04 22:52:59 Same thing here.
+ launcher_delegate_.reset();
+ focus_client_.reset();
+
// Destroy SystemTrayNotifier after destroying SystemTray as TrayItems
// needs to remove observers from it.
system_tray_notifier_.reset();
-#if defined(OS_CHROMEOS)
- // Destroy VideoActivityNotifier before destroying VideoDetector.
- video_activity_notifier_.reset();
-#endif // defined(OS_CHROMEOS)
-
// These need a valid Shell instance to clean up properly, so explicitly
// delete them before invalidating the instance.
// Alphabetical. TODO(oshima): sort.
magnification_controller_.reset();
partial_magnification_controller_.reset();
- resize_shadow_controller_.reset();
- shadow_controller_.reset();
tooltip_controller_.reset();
event_client_.reset();
- window_cycle_controller_.reset();
nested_dispatcher_controller_.reset();
user_action_client_.reset();
visibility_controller_.reset();
- launcher_delegate_.reset();
// |launcher_item_delegate_manager_| observes |shelf_model_|. It must be
// destroyed before |shelf_model_| is destroyed.
launcher_item_delegate_manager_.reset();
shelf_model_.reset();
- video_detector_.reset();
power_button_controller_.reset();
lock_state_controller_.reset();
- mru_window_tracker_.reset();
resolution_notification_controller_.reset();
desktop_background_controller_.reset();

Powered by Google App Engine
This is Rietveld 408576698