Skip to content

Commit

Permalink
[multiball] Group up per-window shutdown code
Browse files Browse the repository at this point in the history
Groups all per-window shutdown code together and moves it before the
other shutdown code to match expected behaviour of shutdown in
multiwindow world.

Bug: none
Change-Id: I7abf63beecd3d2d6c0479da9c9a6f31477f3ae53
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2084595
Reviewed-by: Mark Cogan <marq@chromium.org>
Commit-Queue: Stepan Khapugin <stkhapugin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#746364}
  • Loading branch information
Stepan Khapugin authored and Commit Bot committed Mar 3, 2020
1 parent ac77be7 commit 2d1353a
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions ios/chrome/app/main_controller.mm
Original file line number Diff line number Diff line change
Expand Up @@ -776,12 +776,21 @@ - (void)activateFirstUserActionRecorderWithBackgroundTime:
}

- (void)stopChromeMain {
// This code is per-window.

// Teardown UI state that is associated with scenes.
[self.sceneController teardownUI];

[_mainCoordinator stop];
_mainCoordinator = nil;

// Invariant: The UI is stopped before the model is shutdown.
DCHECK(!_mainCoordinator);
[self.browserViewWrangler shutdown];
self.browserViewWrangler = nil;

// End of per-window code.

[_spotlightManager shutdown];
_spotlightManager = nil;

Expand All @@ -796,11 +805,6 @@ - (void)stopChromeMain {
self.mainBrowserState));
}

// Invariant: The UI is stopped before the model is shutdown.
DCHECK(!_mainCoordinator);
[self.browserViewWrangler shutdown];
self.browserViewWrangler = nil;

_extensionSearchEngineDataUpdater = nullptr;

ios::GetChromeBrowserProvider()
Expand Down

0 comments on commit 2d1353a

Please sign in to comment.