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

Unified Diff: ios/web/public/crw_session_storage.mm

Issue 2766063002: Remove the concept of currentItemIndex (Closed)
Patch Set: fix unit tests 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/web/public/crw_session_storage.h ('k') | ios/web/public/navigation_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/public/crw_session_storage.mm
diff --git a/ios/web/public/crw_session_storage.mm b/ios/web/public/crw_session_storage.mm
index bd92956c640dbe0b53f216fb8d8546361f1ab215..3a0c9744ecff6a9aa605e2aaef3fa325d8b4b1d6 100644
--- a/ios/web/public/crw_session_storage.mm
+++ b/ios/web/public/crw_session_storage.mm
@@ -14,10 +14,10 @@
namespace {
// Serialization keys used in NSCoding functions.
NSString* const kCertificatePolicyManagerKey = @"certificatePolicyManager";
-NSString* const kCurrentNavigationIndexKey = @"currentNavigationIndex";
+NSString* const klastCommittedItemIndexKey = @"lastCommittedItemIndex";
NSString* const kItemStoragesKey = @"entries";
NSString* const kHasOpenerKey = @"openedByDOM";
-NSString* const kPreviousNavigationIndexKey = @"previousNavigationIndex";
+NSString* const kPreviousItemIndexKey = @"previousItemIndex";
}
@interface CRWSessionStorage () {
@@ -30,8 +30,8 @@ @interface CRWSessionStorage () {
@implementation CRWSessionStorage
@synthesize hasOpener = _hasOpener;
-@synthesize currentNavigationIndex = _currentNavigationIndex;
-@synthesize previousNavigationIndex = _previousNavigationIndex;
+@synthesize lastCommittedItemIndex = _lastCommittedItemIndex;
+@synthesize previousItemIndex = _previousItemIndex;
@synthesize itemStorages = _itemStorages;
@synthesize sessionCertificatePolicyManager = _sessionCertificatePolicyManager;
@@ -52,15 +52,14 @@ - (instancetype)initWithCoder:(nonnull NSCoder*)decoder {
self = [super init];
if (self) {
_hasOpener = [decoder decodeBoolForKey:kHasOpenerKey];
- _currentNavigationIndex =
- [decoder decodeIntForKey:kCurrentNavigationIndexKey];
- _previousNavigationIndex =
- [decoder decodeIntForKey:kPreviousNavigationIndexKey];
+ _lastCommittedItemIndex =
+ [decoder decodeIntForKey:klastCommittedItemIndexKey];
+ _previousItemIndex = [decoder decodeIntForKey:kPreviousItemIndexKey];
_itemStorages = [[NSMutableArray alloc]
initWithArray:[decoder decodeObjectForKey:kItemStoragesKey]];
// Prior to M34, 0 was used as "no index" instead of -1; adjust for that.
if (!_itemStorages.count)
- _currentNavigationIndex = -1;
+ _lastCommittedItemIndex = -1;
_sessionCertificatePolicyManager =
[decoder decodeObjectForKey:kCertificatePolicyManagerKey];
if (!_sessionCertificatePolicyManager) {
@@ -75,10 +74,9 @@ - (instancetype)initWithCoder:(nonnull NSCoder*)decoder {
- (void)encodeWithCoder:(NSCoder*)coder {
[coder encodeBool:self.hasOpener forKey:kHasOpenerKey];
- [coder encodeInt:self.currentNavigationIndex
- forKey:kCurrentNavigationIndexKey];
- [coder encodeInt:self.previousNavigationIndex
- forKey:kPreviousNavigationIndexKey];
+ [coder encodeInt:self.lastCommittedItemIndex
+ forKey:klastCommittedItemIndexKey];
+ [coder encodeInt:self.previousItemIndex forKey:kPreviousItemIndexKey];
[coder encodeObject:self.itemStorages forKey:kItemStoragesKey];
[coder encodeObject:self.sessionCertificatePolicyManager
forKey:kCertificatePolicyManagerKey];
« no previous file with comments | « ios/web/public/crw_session_storage.h ('k') | ios/web/public/navigation_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698