Commit 64549361 authored by carlosk's avatar carlosk Committed by Commit bot

Fixes a reuse WebUI bug because of the incorrect shadowing of a boolean value.

This only affects PlzNavigate. When a same-site navigation should reuse the current WebUI, in RFHM::GetFrameHostForNavigation the (shadowing) method-local |should_reuse_web_ui_| would be set to true and the speculative WebUI would (correctly) not be created. But later on as the instance-level |should_reuse_web_ui_| defaults to false, RFHM::CommitPending would try to get the |speculative_web_ui_| which would not be set and *could* cause a crash. As of now the crash doesn't happen because CommitPending is not called when the current RFH is kept for the navigation.

BUG=376094

Review URL: https://codereview.chromium.org/1012863004

Cr-Commit-Position: refs/heads/master@{#322485}
parent 914e56aa
......@@ -773,8 +773,8 @@ RenderFrameHostImpl* RenderFrameHostManager::GetFrameHostForNavigation(
// As SiteInstances are the same, check if the WebUI should be reused.
const NavigationEntry* current_navigation_entry =
delegate_->GetLastCommittedNavigationEntryForRenderManager();
bool should_reuse_web_ui_ = ShouldReuseWebUI(current_navigation_entry,
request.common_params().url);
should_reuse_web_ui_ = ShouldReuseWebUI(current_navigation_entry,
request.common_params().url);
if (!should_reuse_web_ui_) {
speculative_web_ui_ = CreateWebUI(request.common_params().url,
request.bindings());
......
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