diff options
author | rohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-13 20:00:19 +0000 |
---|---|---|
committer | rohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-13 20:00:19 +0000 |
commit | 59f199deadb588edf37afe02d964abe0ded0c2df (patch) | |
tree | edefb6a72490c0d730d2a12d417ba2acbad342b0 /chrome/browser/cocoa | |
parent | 8d69af8f41601bf9b4e4e440982477d01a46396c (diff) | |
download | chromium_src-59f199deadb588edf37afe02d964abe0ded0c2df.zip chromium_src-59f199deadb588edf37afe02d964abe0ded0c2df.tar.gz chromium_src-59f199deadb588edf37afe02d964abe0ded0c2df.tar.bz2 |
[Mac] Remove all pending timers and callbacks before destroying the fullscreen controller.
BUG=41263
TEST=See test case in bug.
Review URL: http://codereview.chromium.org/1654002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44386 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa')
-rw-r--r-- | chrome/browser/cocoa/browser_window_controller.mm | 4 | ||||
-rw-r--r-- | chrome/browser/cocoa/fullscreen_controller.h | 4 | ||||
-rw-r--r-- | chrome/browser/cocoa/fullscreen_controller.mm | 8 |
3 files changed, 11 insertions, 5 deletions
diff --git a/chrome/browser/cocoa/browser_window_controller.mm b/chrome/browser/cocoa/browser_window_controller.mm index 65f7b61..ceee615 100644 --- a/chrome/browser/cocoa/browser_window_controller.mm +++ b/chrome/browser/cocoa/browser_window_controller.mm @@ -318,7 +318,9 @@ [downloadShelfController_ exiting]; // Explicitly release |fullscreenController_| here, as it may call back to - // this BWC in |-dealloc|. + // this BWC in |-dealloc|. We are required to call |-exitFullscreen| before + // releasing the controller. + [fullscreenController_ exitFullscreen]; fullscreenController_.reset(); // Under certain testing configurations we may not actually own the browser. diff --git a/chrome/browser/cocoa/fullscreen_controller.h b/chrome/browser/cocoa/fullscreen_controller.h index 9161905..9d824b3 100644 --- a/chrome/browser/cocoa/fullscreen_controller.h +++ b/chrome/browser/cocoa/fullscreen_controller.h @@ -79,7 +79,9 @@ // mode. |-enterFullscreenForContentView:showDropdown:| should be called after // the fullscreen window is setup, just before it is shown. |-exitFullscreen| // should be called before any views are moved back to the non-fullscreen -// window. +// window. If |-enterFullscreenForContentView:showDropdown:| is called, it must +// be followed with a call to |-exitFullscreen| before the controller is +// released. - (void)enterFullscreenForContentView:(NSView*)contentView showDropdown:(BOOL)showDropdown; - (void)exitFullscreen; diff --git a/chrome/browser/cocoa/fullscreen_controller.mm b/chrome/browser/cocoa/fullscreen_controller.mm index 90186bd..74de909 100644 --- a/chrome/browser/cocoa/fullscreen_controller.mm +++ b/chrome/browser/cocoa/fullscreen_controller.mm @@ -142,8 +142,7 @@ const CGFloat kFloatingBarVerticalOffset = 22; - (void)showTimerFire:(NSTimer*)timer; - (void)hideTimerFire:(NSTimer*)timer; -// Stops any running animations, removes tracking areas, etc. Common cleanup -// code shared by |-exitFullscreen| and |-dealloc|. +// Stops any running animations, removes tracking areas, etc. - (void)cleanup; // Shows and hides the UI associated with this window being active (having main @@ -169,7 +168,7 @@ const CGFloat kFloatingBarVerticalOffset = 22; } - (void)dealloc { - [self cleanup]; + DCHECK(!isFullscreen_); [super dealloc]; } @@ -580,6 +579,9 @@ const CGFloat kFloatingBarVerticalOffset = 22; // since we will no longer be receiving actual status resignation // notifications. [self hideActiveWindowUI]; + + // No more calls back up to the BWC. + browserController_ = nil; } - (void)showActiveWindowUI { |