| Index: ios/web/navigation/serializable_user_data_manager_impl.mm
|
| diff --git a/ios/web/navigation/serializable_user_data_manager_impl.mm b/ios/web/navigation/serializable_user_data_manager_impl.mm
|
| index 09657b847abe2a73addc91e46bd3f4772103f11c..9a0dde5b2166611364a5fb362919c541fed657cc 100644
|
| --- a/ios/web/navigation/serializable_user_data_manager_impl.mm
|
| +++ b/ios/web/navigation/serializable_user_data_manager_impl.mm
|
| @@ -50,6 +50,23 @@ class SerializableUserDataManagerWrapper : public base::SupportsUserData::Data {
|
| // The SerializableUserDataManagerWrapper owned by this object.
|
| SerializableUserDataManagerImpl manager_;
|
| };
|
| +
|
| +// Returns a dictionary mapping old CRWSessionStorage serialised properties to
|
| +// the corresponding key in the serialised user data. When adding a mapping to
|
| +// this dictionary, create a new crbug to track its removal and mark it with a
|
| +// release at least one year after the introduction of the mapping.
|
| +NSDictionary* GetLegacyKeyConversion() {
|
| + NSMutableDictionary* legacy_key_conversion = [NSMutableDictionary dictionary];
|
| + // TODO(crbug.com/661633): those mappings where introduced between M57 and
|
| + // M58, so remove them after M67 has shipped to stable.
|
| + [legacy_key_conversion addEntriesFromDictionary:@{
|
| + @"tabId" : @"TabID",
|
| + @"openerId" : @"OpenerID",
|
| + @"openerNavigationIndex" : @"OpenerNavigationIndex",
|
| + @"lastVisitedTimestamp" : @"LastVisitedTimestamp",
|
| + }];
|
| + return [legacy_key_conversion copy];
|
| +}
|
| } // namespace
|
|
|
| // static
|
| @@ -58,12 +75,7 @@ std::unique_ptr<SerializableUserData> SerializableUserData::Create() {
|
| }
|
|
|
| SerializableUserDataImpl::SerializableUserDataImpl()
|
| - : data_(@{}), legacy_key_conversions_(@{
|
| - @"tabId" : @"TabID",
|
| - @"openerId" : @"OpenerID",
|
| - @"openerNavigationIndex" : @"OpenerNavigationIndex",
|
| - @"lastVisitedTimestamp" : @"LastVisitedTimestamp",
|
| - }) {}
|
| + : data_(@{}), legacy_key_conversions_(GetLegacyKeyConversion()) {}
|
|
|
| SerializableUserDataImpl::~SerializableUserDataImpl() {}
|
|
|
|
|