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

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

Issue 2687353003: Created SerializableUserDataManager. (Closed)
Patch Set: Eugene's comments 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
« no previous file with comments | « ios/web/public/crw_navigation_manager_storage.h ('k') | ios/web/public/crw_session_storage.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/public/crw_navigation_manager_storage.mm
diff --git a/ios/web/public/crw_navigation_manager_storage.mm b/ios/web/public/crw_navigation_manager_storage.mm
deleted file mode 100644
index 8f77b0955b3fc0a0082207f6777f18fd2b35e1f7..0000000000000000000000000000000000000000
--- a/ios/web/public/crw_navigation_manager_storage.mm
+++ /dev/null
@@ -1,88 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#import "ios/web/public/crw_navigation_manager_storage.h"
-
-#import "ios/web/navigation/crw_session_certificate_policy_manager.h"
-
-#if !defined(__has_feature) || !__has_feature(objc_arc)
-#error "This file requires ARC support."
-#endif
-
-namespace {
-// Serialization keys used in NSCoding functions.
-NSString* const kCertificatePolicyManagerKey = @"certificatePolicyManager";
-NSString* const kCurrentNavigationIndexKey = @"currentNavigationIndex";
-NSString* const kItemStoragesKey = @"entries";
-NSString* const kLastVisitedTimestampKey = @"lastVisitedTimestamp";
-NSString* const kOpenerIDKey = @"openerId";
-NSString* const kOpenedByDOMKey = @"openedByDOM";
-NSString* const kOpenerNavigationIndexKey = @"openerNavigationIndex";
-NSString* const kPreviousNavigationIndexKey = @"previousNavigationIndex";
-NSString* const kTabIDKey = @"tabId";
-NSString* const kWindowNameKey = @"windowName";
-}
-
-@implementation CRWNavigationManagerStorage
-
-@synthesize tabID = _tabID;
-@synthesize openerID = _openerID;
-@synthesize openedByDOM = _openedByDOM;
-@synthesize openerNavigationIndex = _openerNavigationIndex;
-@synthesize windowName = _windowName;
-@synthesize currentNavigationIndex = _currentNavigationIndex;
-@synthesize previousNavigationIndex = _previousNavigationIndex;
-@synthesize lastVisitedTimestamp = _lastVisitedTimestamp;
-@synthesize itemStorages = _itemStorages;
-@synthesize sessionCertificatePolicyManager = _sessionCertificatePolicyManager;
-
-- (instancetype)initWithCoder:(nonnull NSCoder*)decoder {
- self = [super init];
- if (self) {
- _tabID = [[decoder decodeObjectForKey:kTabIDKey] copy];
- _windowName = [[decoder decodeObjectForKey:kWindowNameKey] copy];
- _openerID = [[decoder decodeObjectForKey:kOpenerIDKey] copy];
- _openedByDOM = [decoder decodeBoolForKey:kOpenedByDOMKey];
- _openerNavigationIndex =
- [decoder decodeIntForKey:kOpenerNavigationIndexKey];
- _currentNavigationIndex =
- [decoder decodeIntForKey:kCurrentNavigationIndexKey];
- _previousNavigationIndex =
- [decoder decodeIntForKey:kPreviousNavigationIndexKey];
- _lastVisitedTimestamp =
- [decoder decodeDoubleForKey:kLastVisitedTimestampKey];
- _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;
- _sessionCertificatePolicyManager =
- [decoder decodeObjectForKey:kCertificatePolicyManagerKey];
- if (!_sessionCertificatePolicyManager) {
- _sessionCertificatePolicyManager =
- [[CRWSessionCertificatePolicyManager alloc] init];
- }
- }
- return self;
-}
-
-- (void)encodeWithCoder:(NSCoder*)coder {
- [coder encodeObject:self.tabID forKey:kTabIDKey];
- [coder encodeObject:self.openerID forKey:kOpenerIDKey];
- [coder encodeBool:self.openedByDOM forKey:kOpenedByDOMKey];
- [coder encodeInt:self.openerNavigationIndex forKey:kOpenerNavigationIndexKey];
- [coder encodeObject:self.windowName forKey:kWindowNameKey];
- [coder encodeInt:self.currentNavigationIndex
- forKey:kCurrentNavigationIndexKey];
- [coder encodeInt:self.previousNavigationIndex
- forKey:kPreviousNavigationIndexKey];
- [coder encodeDouble:self.lastVisitedTimestamp
- forKey:kLastVisitedTimestampKey];
- [coder encodeObject:self.itemStorages forKey:kItemStoragesKey];
- [coder encodeObject:self.sessionCertificatePolicyManager
- forKey:kCertificatePolicyManagerKey];
- // rendererInitiated is deliberately not preserved, as upstream.
-}
-
-@end
« no previous file with comments | « ios/web/public/crw_navigation_manager_storage.h ('k') | ios/web/public/crw_session_storage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698