Commit 1620462e authored by Peter Conn's avatar Peter Conn Committed by Commit Bot

Revert "Fix Android WebView crash when an app loads a JavaScript URL during navigation."

This reverts commit 532b7d7a.

Reason for revert: 794139

Original change's description:
> Fix Android WebView crash when an app loads a JavaScript URL during navigation.
> 
> When there's an ongoing navigation, if the app loada a JavaScript URL we create
> a temporary NavigationRequest in NavigatorImpl::RequestNavigation. However the
> call to RenderFrameHostManager::GetFrameHostForNavigation was resetting the
> speculative RFH of the original NavigationRequest since the site instance of a
> JavaScript load is always the same as the existing frame.
> 
> Bug: 793432
> Change-Id: I5a25eea9a8733cd5cebe71f700b30ebb4c0b1710
> Reviewed-on: https://chromium-review.googlesource.com/820453
> Commit-Queue: John Abd-El-Malek <jam@chromium.org>
> Reviewed-by: Nasko Oskov <nasko@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#523264}

TBR=nasko@chromium.org,jam@chromium.org

Change-Id: I1e08c1de84199879576782a8719e4a771d66248b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 793432
Reviewed-on: https://chromium-review.googlesource.com/822610Reviewed-by: default avatarPeter Conn <peconn@chromium.org>
Commit-Queue: Peter Conn <peconn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523418}
parent 5d4c88ea
......@@ -1157,10 +1157,9 @@ void NavigatorImpl::RequestNavigation(
// a Javascript URL should not interrupt a previous navigation.
// Note: The scoped_request will be destroyed at the end of this function.
if (dest_url.SchemeIs(url::kJavaScriptScheme)) {
// Don't call frame_tree_node->render_manager()->GetFrameHostForNavigation
// as that might clear the speculative RFH of an ongoing navigation.
RenderFrameHostImpl* render_frame_host =
frame_tree_node->current_frame_host();
frame_tree_node->render_manager()->GetFrameHostForNavigation(
*scoped_request.get());
render_frame_host->CommitNavigation(
nullptr, // response
mojom::URLLoaderClientEndpointsPtr(),
......
......@@ -211,7 +211,7 @@ void WebContentsViewAndroid::Focus() {
RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid();
if (web_contents_->ShowingInterstitialPage()) {
web_contents_->GetInterstitialPage()->Focus();
} else if (rwhv) {
} else {
rwhv->Focus();
}
}
......
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