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

Unified Diff: ios/chrome/browser/ui/main/browser_view_wrangler.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/main/browser_view_wrangler.mm
diff --git a/ios/chrome/browser/ui/main/browser_view_wrangler.mm b/ios/chrome/browser/ui/main/browser_view_wrangler.mm
index d31d546cd74eaa125df7ca7f5f044b9aef29fa3c..ef7f08f6cb859cc94b6d03c6cb2c943e61f2529f 100644
--- a/ios/chrome/browser/ui/main/browser_view_wrangler.mm
+++ b/ios/chrome/browser/ui/main/browser_view_wrangler.mm
@@ -27,7 +27,6 @@
@interface BrowserViewWrangler ()<TabModelObserver> {
ios::ChromeBrowserState* _browserState;
__unsafe_unretained id<TabModelObserver> _tabModelObserver;
- BOOL _isShutdown;
base::mac::ObjCPropertyReleaser _propertyReleaser_BrowserViewWrangler;
}
@@ -83,7 +82,25 @@
}
- (void)dealloc {
- DCHECK(_isShutdown) << "-shutdown must be called before -dealloc";
+ if (_tabModelObserver) {
+ [_mainTabModel removeObserver:_tabModelObserver];
+ [_otrTabModel removeObserver:_tabModelObserver];
+ }
+ [_mainTabModel removeObserver:self];
+ [_otrTabModel removeObserver:self];
+
+ // Stop URL monitoring of the main tab model.
+ ios_internal::breakpad::StopMonitoringURLsForTabModel(_mainTabModel);
+
+ // Stop Breakpad state monitoring of both tab models (if necessary).
+ ios_internal::breakpad::StopMonitoringTabStateForTabModel(_mainTabModel);
+ ios_internal::breakpad::StopMonitoringTabStateForTabModel(_otrTabModel);
+
+ // Normally other objects will take care of unhooking the tab models from
+ // the browser state, but this code should ensure that it happens regardless.
+ [_mainTabModel browserStateDestroyed];
+ [_otrTabModel browserStateDestroyed];
+
[super dealloc];
}
@@ -266,39 +283,6 @@
}
}
-- (void)shutdown {
- DCHECK(!_isShutdown);
- _isShutdown = YES;
-
- if (_tabModelObserver) {
- [_mainTabModel removeObserver:_tabModelObserver];
- [_otrTabModel removeObserver:_tabModelObserver];
- _tabModelObserver = nil;
- }
-
- [_mainTabModel removeObserver:self];
- [_otrTabModel removeObserver:self];
-
- // Stop URL monitoring of the main tab model.
- ios_internal::breakpad::StopMonitoringURLsForTabModel(_mainTabModel);
-
- // Stop Breakpad state monitoring of both tab models (if necessary).
- ios_internal::breakpad::StopMonitoringTabStateForTabModel(_mainTabModel);
- ios_internal::breakpad::StopMonitoringTabStateForTabModel(_otrTabModel);
-
- // Normally other objects will take care of unhooking the tab models from
- // the browser state, but this code should ensure that it happens regardless.
- [_mainTabModel browserStateDestroyed];
- [_otrTabModel browserStateDestroyed];
-
- [_mainBVC shutdown];
- [_otrBVC shutdown];
- self.mainBVC = nil;
- self.otrBVC = nil;
-
- _browserState = nullptr;
-}
-
#pragma mark - Internal methods
- (TabModel*)buildOtrTabModel:(BOOL)empty {
« no previous file with comments | « ios/chrome/browser/ui/main/browser_view_wrangler.h ('k') | ios/chrome/browser/ui/main/browser_view_wrangler_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698