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

Unified Diff: ios/web/navigation/crw_session_controller.mm

Issue 2720613005: Refactor serialisation of openerId & openerNavigationIndex. (Closed)
Patch Set: Fix CRWSessionController's initializer comment. Created 3 years, 10 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/web/navigation/crw_session_controller.mm
diff --git a/ios/web/navigation/crw_session_controller.mm b/ios/web/navigation/crw_session_controller.mm
index 7f7eec763044f42cc71f4adbadc558bfcb7f17de..562db5d4f74a5a5145c2344d4b88d7dba8690041 100644
--- a/ios/web/navigation/crw_session_controller.mm
+++ b/ios/web/navigation/crw_session_controller.mm
@@ -37,11 +37,6 @@
// the incremental merging of the two classes.
web::NavigationManagerImpl* _navigationManager;
- NSString* _openerId; // Id of tab who opened this tab, empty/nil if none.
- // Navigation index of the tab which opened this tab. Do not rely on the
- // value of this member variable to indicate whether or not this tab has
- // an opener, as both 0 and -1 are used as navigationIndex values.
- NSInteger _openerNavigationIndex;
// Identifies the index of the current navigation in the CRWSessionEntry
// array.
NSInteger _currentNavigationIndex;
@@ -94,9 +89,7 @@
// Expose setters for serialization properties. These are exposed in a category
// in SessionStorageBuilder, and will be removed as ownership of
// their backing ivars moves to NavigationManagerImpl.
-@property(nonatomic, readwrite, copy) NSString* openerId;
@property(nonatomic, readwrite, getter=isOpenedByDOM) BOOL openedByDOM;
-@property(nonatomic, readwrite, assign) NSInteger openerNavigationIndex;
@property(nonatomic, readwrite, assign) NSInteger previousNavigationIndex;
// Removes all entries after currentNavigationIndex_.
@@ -124,22 +117,16 @@
@synthesize entries = _entries;
@synthesize windowName = _windowName;
@synthesize lastVisitedTimestamp = _lastVisitedTimestamp;
-@synthesize openerId = _openerId;
@synthesize openedByDOM = _openedByDOM;
-@synthesize openerNavigationIndex = _openerNavigationIndex;
@synthesize sessionCertificatePolicyManager = _sessionCertificatePolicyManager;
-- (id)initWithWindowName:(NSString*)windowName
- openerId:(NSString*)openerId
- openedByDOM:(BOOL)openedByDOM
- openerNavigationIndex:(NSInteger)openerIndex
- browserState:(web::BrowserState*)browserState {
+- (instancetype)initWithWindowName:(NSString*)windowName
+ openedByDOM:(BOOL)openedByDOM
+ browserState:(web::BrowserState*)browserState {
self = [super init];
if (self) {
self.windowName = windowName;
- _openerId = [openerId copy];
_openedByDOM = openedByDOM;
- _openerNavigationIndex = openerIndex;
_browserState = browserState;
_entries = [NSMutableArray array];
_lastVisitedTimestamp = [[NSDate date] timeIntervalSince1970];
@@ -152,13 +139,12 @@
return self;
}
-- (id)initWithNavigationItems:
- (std::vector<std::unique_ptr<web::NavigationItem>>)items
- currentIndex:(NSUInteger)currentIndex
- browserState:(web::BrowserState*)browserState {
+- (instancetype)initWithNavigationItems:
+ (std::vector<std::unique_ptr<web::NavigationItem>>)items
+ currentIndex:(NSUInteger)currentIndex
+ browserState:(web::BrowserState*)browserState {
self = [super init];
if (self) {
- _openerId = nil;
_browserState = browserState;
// Create entries array from list of navigations.
@@ -187,9 +173,7 @@
- (id)copyWithZone:(NSZone*)zone {
CRWSessionController* copy = [[[self class] alloc] init];
- copy->_openerId = [_openerId copy];
copy->_openedByDOM = _openedByDOM;
- copy->_openerNavigationIndex = _openerNavigationIndex;
copy.windowName = self.windowName;
copy->_currentNavigationIndex = _currentNavigationIndex;
copy->_previousNavigationIndex = _previousNavigationIndex;
« no previous file with comments | « ios/web/navigation/crw_session_controller.h ('k') | ios/web/navigation/crw_session_controller+private_constructors.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698