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

Unified Diff: ios/web/public/crw_session_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_session_storage.h ('k') | ios/web/public/serializable_user_data_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_navigation_manager_storage.mm b/ios/web/public/crw_session_storage.mm
similarity index 84%
rename from ios/web/public/crw_navigation_manager_storage.mm
rename to ios/web/public/crw_session_storage.mm
index 8f77b0955b3fc0a0082207f6777f18fd2b35e1f7..c10d885cabc8a8a8c5234a4f5960c44bdea8e02b 100644
--- a/ios/web/public/crw_navigation_manager_storage.mm
+++ b/ios/web/public/crw_session_storage.mm
@@ -2,9 +2,10 @@
// 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/public/crw_session_storage.h"
#import "ios/web/navigation/crw_session_certificate_policy_manager.h"
+#import "ios/web/public/serializable_user_data_manager.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
@@ -24,7 +25,14 @@
NSString* const kWindowNameKey = @"windowName";
}
-@implementation CRWNavigationManagerStorage
+@interface CRWSessionStorage () {
+ // Backing object for property of same name.
+ std::unique_ptr<web::SerializableUserData> _userData;
+}
+
+@end
+
+@implementation CRWSessionStorage
@synthesize tabID = _tabID;
@synthesize openerID = _openerID;
@@ -37,6 +45,19 @@ @implementation CRWNavigationManagerStorage
@synthesize itemStorages = _itemStorages;
@synthesize sessionCertificatePolicyManager = _sessionCertificatePolicyManager;
+#pragma mark - Accessors
+
+- (web::SerializableUserData*)userData {
+ return _userData.get();
+}
+
+- (void)setSerializableUserData:
+ (std::unique_ptr<web::SerializableUserData>)userData {
+ _userData = std::move(userData);
+}
+
+#pragma mark - NSCoding
+
- (instancetype)initWithCoder:(nonnull NSCoder*)decoder {
self = [super init];
if (self) {
@@ -63,6 +84,8 @@ - (instancetype)initWithCoder:(nonnull NSCoder*)decoder {
_sessionCertificatePolicyManager =
[[CRWSessionCertificatePolicyManager alloc] init];
}
+ _userData = web::SerializableUserData::Create();
+ _userData->Decode(decoder);
}
return self;
}
@@ -82,6 +105,8 @@ - (void)encodeWithCoder:(NSCoder*)coder {
[coder encodeObject:self.itemStorages forKey:kItemStoragesKey];
[coder encodeObject:self.sessionCertificatePolicyManager
forKey:kCertificatePolicyManagerKey];
+ if (_userData)
+ _userData->Encode(coder);
// rendererInitiated is deliberately not preserved, as upstream.
}
« no previous file with comments | « ios/web/public/crw_session_storage.h ('k') | ios/web/public/serializable_user_data_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698