Commit 3423776a authored by edchin's avatar edchin Committed by Commit Bot

[ios] Fix recent tabs crash in iOS 10

Previously, model changes and table updates were not synchronized for
handling "Hide for now" on long presses in recent tabs.

This CL moves the model changes into the same block as table updates
so that they are fed together into |-performBatchUpdates:| in iOS 11
and |-beginUpdates| in iOS 10.

This was only crashing in iOS 10 iPad, but theoretically, it is wrong
and would crash in other configurations.

Bug: 851946
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I4fe35eb06cf77d1fb6097a5508d72dd1e93fc6ee
Reviewed-on: https://chromium-review.googlesource.com/1108346Reviewed-by: default avataredchin <edchin@chromium.org>
Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Commit-Queue: edchin <edchin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569175}
parent 1160a82c
......@@ -1009,10 +1009,9 @@ const int kRecentlyClosedTabsSectionIndex = 0;
sync_sessions::OpenTabsUIDelegate* openTabs =
syncService->GetOpenTabsUIDelegate();
[self.tableViewModel removeSectionWithIdentifier:sectionIdentifier];
_syncedSessions->EraseSession(section - kNumberOfSectionsBeforeSessions);
void (^tableUpdates)(void) = ^{
[self.tableViewModel removeSectionWithIdentifier:sectionIdentifier];
_syncedSessions->EraseSession(section - kNumberOfSectionsBeforeSessions);
[self.tableView deleteSections:[NSIndexSet indexSetWithIndex:section]
withRowAnimation:UITableViewRowAnimationLeft];
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment