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

Unified Diff: ios/chrome/browser/sessions/session_window.h

Issue 2655253002: Revert of Moved NavigationManagerImpl serialization out of CRWSessionController. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 3 years, 11 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_window.h
diff --git a/ios/chrome/browser/sessions/session_window.h b/ios/chrome/browser/sessions/session_window.h
index e2b838d2157250ce9abd9d6df8b9d23f1068fdc7..ebcc2e3b47bf94b248d5e394e05fbfc44143cd0f 100644
--- a/ios/chrome/browser/sessions/session_window.h
+++ b/ios/chrome/browser/sessions/session_window.h
@@ -11,30 +11,30 @@
#import "ios/web/web_state/web_state_impl.h"
-@class CRWNavigationManagerStorage;
-
// Encapsulates everything required to save a session "window". For iOS, there
// will only be one window at a time.
@interface SessionWindowIOS : NSObject<NSCoding>
-// Adds a serialized session to be written to disk. SessionWindows are
-// initialized "empty" (without any sessions) and sessions are added one at a
-// time. For example:
+// So that ownership transfer of WebStateImpls is explicit, SessionWindows
+// are initialized "empty" (without any sessions) and sessions are added
+// one at a time. For example:
// SessionWindowIOS* window = [[SessionWindow alloc] init];
-// [window addSession:session_storage];
+// [window addSession:some_scoped_webstate_ptr.Pass()];
// ...
// [window setSelectedInex:mySelectedIndex];
-- (void)addSerializedSession:(CRWNavigationManagerStorage*)session;
+- (void)addSession:(std::unique_ptr<web::WebStateImpl>)session;
-// Clears all added sessions.
- (void)clearSessions;
-// The serialized session objects.
-@property(nonatomic, readonly) NSArray* sessions;
+// Takes the first session stored in the reciever, removes it and passes
+// ownership of it to the caller.
+- (std::unique_ptr<web::WebStateImpl>)nextSession;
// The currently selected session. NSNotFound if the sessionWindow contains
// no sessions; otherwise 0 <= |selectedIndex| < |unclaimedSessions|.
@property(nonatomic) NSUInteger selectedIndex;
+// A count of the remaining sessions that haven't been claimed.
+@property(nonatomic, readonly) NSUInteger unclaimedSessions;
@end
« no previous file with comments | « ios/chrome/browser/sessions/session_service_unittest.mm ('k') | ios/chrome/browser/sessions/session_window.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698