| Index: ios/chrome/browser/crash_report/crash_restore_helper.mm
|
| diff --git a/ios/chrome/browser/crash_report/crash_restore_helper.mm b/ios/chrome/browser/crash_report/crash_restore_helper.mm
|
| index ad2b05f963ad6bad12ca8240ae26bedf3f1a5739..6a66ab781b8249714659792f9c02f3b4311bfa65 100644
|
| --- a/ios/chrome/browser/crash_report/crash_restore_helper.mm
|
| +++ b/ios/chrome/browser/crash_report/crash_restore_helper.mm
|
| @@ -288,16 +288,19 @@ - (void)infoBarRemoved:(infobars::InfoBar*)infobar {
|
| loadWindowFromPath:[self sessionBackupPath]
|
| forBrowserState:[_tabModel browserState]];
|
| DCHECK(window);
|
| - if (!window.unclaimedSessions)
|
| + NSArray* sessions = window.sessions;
|
| + if (!sessions.count)
|
| return;
|
| sessions::TabRestoreService* const tabRestoreService =
|
| IOSChromeTabRestoreServiceFactory::GetForBrowserState(_browserState);
|
| tabRestoreService->LoadTabsFromLastSession();
|
|
|
| - while (window.unclaimedSessions) {
|
| + web::WebState::CreateParams params(_browserState);
|
| + for (CRWNavigationManagerStorage* session in sessions) {
|
| + std::unique_ptr<web::WebState> webState =
|
| + web::WebState::Create(params, session);
|
| // Add all tabs at the 0 position as the position is relative to an old
|
| // tabModel.
|
| - std::unique_ptr<web::WebStateImpl> webState = [window nextSession];
|
| tabRestoreService->CreateHistoricalTab(
|
| sessions::IOSLiveTab::GetForWebState(webState.get()), 0);
|
| }
|
|
|