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

Side by Side Diff: ios/shared/chrome/browser/tabs/web_state_list_serialisation.h

Issue 2771863002: [ios] Add free function to (de)serialise WebStateList. (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
OLDNEW
(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_SERIALISATION_H_
6 #define IOS_SHARED_CHROME_BROWSER_TABS_WEB_STATE_LIST_SERIALISATION_H_
7
8 #import <Foundation/Foundation.h>
9
10 #import "ios/web/public/web_state/web_state.h"
marq (ping after 24h) 2017/03/24 10:37:17 I'm sure you've explained this already, but assume
sdefresne 2017/03/27 16:14:44 Two reasons: 1. on desktop, those are not methods
marq (ping after 24h) 2017/03/28 15:47:24 I'm not sure I find the first two reasons compelli
11
12 @class CRWSessionStorage;
13 class WebStateList;
14
15 // Returns an array of serialised sessions.
16 // TODO(sdefresne): add unit tests.
17 NSArray<CRWSessionStorage*>* SerializeWebStateList(
18 WebStateList* web_state_list);
19
20 // Restores serialised sessions into the specified WebStateList. Returns the
21 // number of WebStates restored.
marq (ping after 24h) 2017/03/24 10:37:17 Prefer comments that explicitly name parameters:
sdefresne 2017/03/27 16:14:44 Done.
22 // TODO(sdefresne): add unit tests.
23 int DeserializeWebStateListFrom(WebStateList* web_state_list,
marq (ping after 24h) 2017/03/24 10:37:17 Is the return value just a convenience, or is it a
marq (ping after 24h) 2017/03/24 10:37:17 Naming nit: If you're going to use a preposition a
sdefresne 2017/03/27 16:14:44 Dropped "From".
sdefresne 2017/03/27 16:14:44 For convenience. Removed.
24 web::WebState::CreateParams params,
25 NSArray<CRWSessionStorage*>* sessions);
26
27 #endif // IOS_SHARED_CHROME_BROWSER_TABS_WEB_STATE_LIST_SERIALISATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698