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

Unified Diff: ios/shared/chrome/browser/tabs/web_state_list_serialization.h

Issue 2812623002: Revert of [ios] Move WebStateList to ios/chrome/browser/web_state_list. (Closed)
Patch Set: 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/shared/chrome/browser/tabs/web_state_list_serialization.h
diff --git a/ios/shared/chrome/browser/tabs/web_state_list_serialization.h b/ios/shared/chrome/browser/tabs/web_state_list_serialization.h
new file mode 100644
index 0000000000000000000000000000000000000000..63df918c881a499dc1670b2801b48dbcce6ab08d
--- /dev/null
+++ b/ios/shared/chrome/browser/tabs/web_state_list_serialization.h
@@ -0,0 +1,35 @@
+// Copyright 2017 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.
+
+#ifndef IOS_SHARED_CHROME_BROWSER_TABS_WEB_STATE_LIST_SERIALIZATION_H_
+#define IOS_SHARED_CHROME_BROWSER_TABS_WEB_STATE_LIST_SERIALIZATION_H_
+
+#import <Foundation/Foundation.h>
+
+#include <memory>
+
+#include "base/callback_forward.h"
+
+@class CRWSessionStorage;
+class WebStateList;
+
+namespace web {
+class WebState;
+}
+
+// Factory for creating WebStates.
+using WebStateFactory =
+ base::RepeatingCallback<std::unique_ptr<web::WebState>(CRWSessionStorage*)>;
+
+// Returns an array of serialised sessions.
+NSArray<CRWSessionStorage*>* SerializeWebStateList(
+ WebStateList* web_state_list);
+
+// Restores |sessions| into |web_state_list| using |web_state_factory| for
+// creating the restored WebStates.
+void DeserializeWebStateList(WebStateList* web_state_list,
+ NSArray<CRWSessionStorage*>* sessions,
+ const WebStateFactory& web_state_factory);
+
+#endif // IOS_SHARED_CHROME_BROWSER_TABS_WEB_STATE_LIST_SERIALIZATION_H_

Powered by Google App Engine
This is Rietveld 408576698