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

Unified Diff: ios/chrome/browser/ui/browser_view_controller.mm

Issue 2930363003: Revert "[ios] Ensure proper shutdown of Chrome on iOS." (Closed)
Patch Set: Created 3 years, 6 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
Index: ios/chrome/browser/ui/browser_view_controller.mm
diff --git a/ios/chrome/browser/ui/browser_view_controller.mm b/ios/chrome/browser/ui/browser_view_controller.mm
index cb1e56afcabd1d4421180ff0af3e45acb873b8d0..643c889196e65680dfed87fa42d2444b42968837 100644
--- a/ios/chrome/browser/ui/browser_view_controller.mm
+++ b/ios/chrome/browser/ui/browser_view_controller.mm
@@ -471,9 +471,6 @@ NSString* const kNativeControllerTemporaryKey = @"NativeControllerTemporaryKey";
// YES if waiting for a foreground tab due to expectNewForegroundTab.
BOOL _expectingForegroundTab;
- // Whether or not -shutdown has been called.
- BOOL _isShutdown;
-
// The ChromeBrowserState associated with this BVC.
ios::ChromeBrowserState* _browserState; // weak
@@ -992,7 +989,19 @@ class BrowserBookmarkModelBridge : public bookmarks::BookmarkModelObserver {
}
- (void)dealloc {
- DCHECK(_isShutdown) << "-shutdown must be called before dealloc.";
+ _tabStripController = nil;
+ _infoBarContainer = nil;
+ _readingListMenuNotifier = nil;
+ if (_bookmarkModel)
+ _bookmarkModel->RemoveObserver(_bookmarkModelBridge.get());
+ [_model removeObserver:self];
+ [[UpgradeCenter sharedInstance] unregisterClient:self];
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+ [_toolbarController setDelegate:nil];
+ if (_voiceSearchController)
+ _voiceSearchController->SetDelegate(nil);
+ [_rateThisAppDialog setDelegate:nil];
+ [_model closeAllTabs];
}
#pragma mark - Accessibility
@@ -2258,25 +2267,6 @@ class BrowserBookmarkModelBridge : public bookmarks::BookmarkModelObserver {
}));
}
-- (void)shutdown {
- DCHECK(!_isShutdown);
- _isShutdown = YES;
-
- _tabStripController = nil;
- _infoBarContainer = nil;
- _readingListMenuNotifier = nil;
- if (_bookmarkModel)
- _bookmarkModel->RemoveObserver(_bookmarkModelBridge.get());
- [_model removeObserver:self];
- [[UpgradeCenter sharedInstance] unregisterClient:self];
- [[NSNotificationCenter defaultCenter] removeObserver:self];
- [_toolbarController setDelegate:nil];
- if (_voiceSearchController)
- _voiceSearchController->SetDelegate(nil);
- [_rateThisAppDialog setDelegate:nil];
- [_model closeAllTabs];
-}
-
#pragma mark - SnapshotOverlayProvider methods
- (NSArray*)snapshotOverlaysForTab:(Tab*)tab {
« no previous file with comments | « ios/chrome/browser/ui/browser_view_controller.h ('k') | ios/chrome/browser/ui/browser_view_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698