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 |
new file mode 100644 |
index 0000000000000000000000000000000000000000..18a3f5cf95fcb38aaa7f49880c092f40ea5e8ac5 |
--- /dev/null |
+++ b/ios/chrome/browser/sessions/session_util.mm |
@@ -0,0 +1,22 @@ |
+// Copyright 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "ios/chrome/browser/sessions/session_util.h" |
+ |
+#include "base/files/file_path.h" |
+#include "base/strings/sys_string_conversions.h" |
+#import "ios/chrome/browser/sessions/session_service.h" |
+#include "ios/web/public/browser_state.h" |
+ |
+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]; |
+} |
+ |
+} // namespace session_util |