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

Unified Diff: ios/chrome/browser/sessions/session_util.mm

Issue 2810743002: [ios] Refactor SessionServiceIOS to remove dependency on BrowserState. (Closed)
Patch Set: Rebase. 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
Index: ios/chrome/browser/sessions/session_util.mm
diff --git a/ios/chrome/browser/sessions/session_util.mm b/ios/chrome/browser/sessions/session_util.mm
index e7d5f2642395c6a6b2d61bd73c7efc271d704dc7..9797d95a8ab79c61b78a201c4814b60f64ff09b1 100644
--- a/ios/chrome/browser/sessions/session_util.mm
+++ b/ios/chrome/browser/sessions/session_util.mm
@@ -14,9 +14,10 @@ namespace session_util {
// Deletes the file containing the commands for the last session.
void DeleteLastSession(web::BrowserState* browser_state) {
SessionServiceIOS* session_service = [SessionServiceIOS sharedService];
- NSString* path =
- base::SysUTF8ToNSString(browser_state->GetStatePath().value());
- [session_service deleteLastSession:path];
+ NSString* state_path =
+ base::SysUTF8ToNSString(browser_state->GetStatePath().AsUTF8Unsafe());
+ NSString* session_path = [session_service sessionPathForDirectory:state_path];
+ [session_service deleteLastSessionAtPath:session_path];
}
} // namespace session_util

Powered by Google App Engine
This is Rietveld 408576698