| OLD | NEW |
| (Empty) |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef IOS_SHARED_CHROME_BROWSER_TABS_WEB_STATE_LIST_SERIALIZATION_H_ | |
| 6 #define IOS_SHARED_CHROME_BROWSER_TABS_WEB_STATE_LIST_SERIALIZATION_H_ | |
| 7 | |
| 8 #import <Foundation/Foundation.h> | |
| 9 | |
| 10 #include <memory> | |
| 11 | |
| 12 #include "base/callback_forward.h" | |
| 13 | |
| 14 @class CRWSessionStorage; | |
| 15 class WebStateList; | |
| 16 | |
| 17 namespace web { | |
| 18 class WebState; | |
| 19 } | |
| 20 | |
| 21 // Factory for creating WebStates. | |
| 22 using WebStateFactory = | |
| 23 base::RepeatingCallback<std::unique_ptr<web::WebState>(CRWSessionStorage*)>; | |
| 24 | |
| 25 // Returns an array of serialised sessions. | |
| 26 NSArray<CRWSessionStorage*>* SerializeWebStateList( | |
| 27 WebStateList* web_state_list); | |
| 28 | |
| 29 // Restores |sessions| into |web_state_list| using |web_state_factory| for | |
| 30 // creating the restored WebStates. | |
| 31 void DeserializeWebStateList(WebStateList* web_state_list, | |
| 32 NSArray<CRWSessionStorage*>* sessions, | |
| 33 const WebStateFactory& web_state_factory); | |
| 34 | |
| 35 #endif // IOS_SHARED_CHROME_BROWSER_TABS_WEB_STATE_LIST_SERIALIZATION_H_ | |
| OLD | NEW |