Commit 82d5a0c7 authored by Rohit Rao's avatar Rohit Rao Committed by Commit Bot

[ios] Temporary fix for CRWSessionStorage being released early in ClosingWebStateObserver.

RestoreIOSLiveTab is not compiled with ARC and therefore is not properly
retaining the CRWSessionStorage* which it is passed. Temporarily work
around this bug by keeping a strong pointer to the CRWSessionStorage* in
ClosingWebStateObserver, until RestoreIOSLiveTab can be fixed properly.

BUG=1070852

Change-Id: Ic3d8a4d0cc3c29bfae4f657de06b98aa869b3bc1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2150035Reviewed-by: default avatarJustin Cohen <justincohen@chromium.org>
Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Commit-Queue: Rohit Rao <rohitrao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#759116}
parent 302fb6b6
...@@ -67,8 +67,13 @@ ...@@ -67,8 +67,13 @@
web::NavigationManager* navigationManager = webState->GetNavigationManager(); web::NavigationManager* navigationManager = webState->GetNavigationManager();
if (navigationManager->IsRestoreSessionInProgress()) { if (navigationManager->IsRestoreSessionInProgress()) {
auto live_tab = std::make_unique<sessions::RestoreIOSLiveTab>( // TODO(crbug.com/1070852): RestoreIOSLiveTab is not compiled with ARC and
webState->BuildSessionStorage()); // therefore is not properly retaining the CRWSessionStorage* which it is
// passed. Temporarily work around this bug by keeping a strong pointer to
// the CRWSessionStorage* here, until RestoreIOSLiveTab can be fixed
// properly.
CRWSessionStorage* storage = webState->BuildSessionStorage();
auto live_tab = std::make_unique<sessions::RestoreIOSLiveTab>(storage);
_restoreService->CreateHistoricalTab(live_tab.get(), atIndex); _restoreService->CreateHistoricalTab(live_tab.get(), atIndex);
return; return;
} }
......
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