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

Unified Diff: ios/chrome/browser/crash_report/crash_restore_helper.mm

Issue 2811593004: [ios] Allow having multiple session windows in a session. (Closed)
Patch Set: Address comments. Created 3 years, 8 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
« no previous file with comments | « no previous file | ios/chrome/browser/sessions/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a2e23b5fbf35f08926f5ced343398cc95400aca1..12b96763967641aa3707160212fef4d2037c7bf3 100644
--- a/ios/chrome/browser/crash_report/crash_restore_helper.mm
+++ b/ios/chrome/browser/crash_report/crash_restore_helper.mm
@@ -20,6 +20,7 @@
#include "ios/chrome/browser/browser_state/chrome_browser_state.h"
#import "ios/chrome/browser/crash_report/breakpad_helper.h"
#include "ios/chrome/browser/sessions/ios_chrome_tab_restore_service_factory.h"
+#import "ios/chrome/browser/sessions/session_ios.h"
#import "ios/chrome/browser/sessions/session_service_ios.h"
#import "ios/chrome/browser/sessions/session_window_ios.h"
#import "ios/chrome/browser/tabs/tab.h"
@@ -259,13 +260,15 @@ int SessionCrashedInfoBarDelegate::GetIconId() const {
DCHECK(!_sessionRestored);
_sessionRestored = YES;
_infoBarBridge.reset();
- SessionWindowIOS* sessionWindow = [[SessionServiceIOS sharedService]
- loadSessionWindowFromPath:[self sessionBackupPath]];
- if (sessionWindow) {
- breakpad_helper::WillStartCrashRestoration();
- return [_tabModel restoreSessionWindow:sessionWindow];
- }
- return NO;
+
+ SessionIOS* session = [[SessionServiceIOS sharedService]
+ loadSessionFromPath:[self sessionBackupPath]];
+ if (!session)
+ return NO;
+
+ DCHECK_EQ(session.sessionWindows.count, 1u);
+ breakpad_helper::WillStartCrashRestoration();
+ return [_tabModel restoreSessionWindow:session.sessionWindows[0]];
}
- (void)infoBarRemoved:(infobars::InfoBar*)infobar {
@@ -281,12 +284,14 @@ int SessionCrashedInfoBarDelegate::GetIconId() const {
// the recently closed tabs.
_sessionRestored = YES;
- SessionWindowIOS* window = [[SessionServiceIOS sharedService]
- loadSessionWindowFromPath:[self sessionBackupPath]];
- DCHECK(window);
- NSArray* sessions = window.sessions;
+ SessionIOS* session = [[SessionServiceIOS sharedService]
+ loadSessionFromPath:[self sessionBackupPath]];
+ DCHECK_EQ(session.sessionWindows.count, 1u);
+
+ NSArray<CRWSessionStorage*>* sessions = session.sessionWindows[0].sessions;
if (!sessions.count)
return;
+
sessions::TabRestoreService* const tabRestoreService =
IOSChromeTabRestoreServiceFactory::GetForBrowserState(_browserState);
tabRestoreService->LoadTabsFromLastSession();
« no previous file with comments | « no previous file | ios/chrome/browser/sessions/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698