New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 594001 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Mar 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug



Sign in to add a comment

Base URL is not restored by NavigationController when a new NavigationEntry is created in RendererDidNavigateToNewPage

Project Member Reported by mnaga...@chromium.org, Mar 11 2016

Issue description

Basically, what the summary says. See also b/27534809 for details.

In Android WebView, when `loadDataFromBaseURL` is called alone, at the moment when NavigationController receives `RendererDidNavigateToNewPage` there is a pending entry, and the current entry gets cloned from it, preserving the base URL. But when `loadDataFromBaseURL` is followed by `loadUrl("javascript:...")`, the pending entry is not used, and a new navigation entry gets created instead containing only the data URL received from the renderer.

We just need to set base URL when creating a new entry. We actually have base URL in the IPC message params.
 

Comment 1 by boliu@chromium.org, Mar 11 2016

Labels: -Pri-2 ReleaseBlock-Stable M-50 Pri-1
Should merge back to m50 if possible?
I agree. I would even merge it into M49 if possible.
Project Member

Comment 3 by bugdroid1@chromium.org, Mar 14 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ce1f4d009316d8f5f4c49b18e1bd94687d80c59d

commit ce1f4d009316d8f5f4c49b18e1bd94687d80c59d
Author: mnaganov <mnaganov@chromium.org>
Date: Mon Mar 14 23:24:54 2016

Store and use last base URL between DidStart / DidStopLoading

As it turns out that the committed entry may omit the base
URL if there has been a javascript: URL navigation after
LoadDataWithBaseURL. Thus we have to store the base url on
DidStartLoading and use it in DidStopLoading / DidFinishLoad.

We have to preserve the old hack with SetToBaseURLForDataURLIfNeeded
because if the base URL is not valid, DidFinishLoad doesn't
receive it from the renderer.

This change is a short-term workaround. The correct solution
is to pass a flag that the load was through LoadDataWithBaseURL
via Blink, so base URL can be restored correctly within
NavigationController.

BUG= 594001 

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

Cr-Commit-Position: refs/heads/master@{#381108}

[modify] https://crrev.com/ce1f4d009316d8f5f4c49b18e1bd94687d80c59d/android_webview/javatests/src/org/chromium/android_webview/test/LoadDataWithBaseUrlTest.java
[modify] https://crrev.com/ce1f4d009316d8f5f4c49b18e1bd94687d80c59d/content/browser/android/web_contents_observer_proxy.cc
[modify] https://crrev.com/ce1f4d009316d8f5f4c49b18e1bd94687d80c59d/content/browser/android/web_contents_observer_proxy.h

Labels: Merge-Request-50

Comment 5 by tin...@google.com, Mar 14 2016

Labels: -Merge-Request-50 Merge-Approved-50 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M50 (branch: 2661)
Project Member

Comment 6 by bugdroid1@chromium.org, Mar 14 2016

Labels: -merge-approved-50 merge-merged-2661
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c278e82252a35dd31989c5e0b658b3d10788163d

commit c278e82252a35dd31989c5e0b658b3d10788163d
Author: Mikhail Naganov <mnaganov@chromium.org>
Date: Mon Mar 14 23:45:44 2016

Store and use last base URL between DidStart / DidStopLoading

As it turns out that the committed entry may omit the base
URL if there has been a javascript: URL navigation after
LoadDataWithBaseURL. Thus we have to store the base url on
DidStartLoading and use it in DidStopLoading / DidFinishLoad.

We have to preserve the old hack with SetToBaseURLForDataURLIfNeeded
because if the base URL is not valid, DidFinishLoad doesn't
receive it from the renderer.

This change is a short-term workaround. The correct solution
is to pass a flag that the load was through LoadDataWithBaseURL
via Blink, so base URL can be restored correctly within
NavigationController.

BUG= 594001 

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

Cr-Commit-Position: refs/heads/master@{#381108}
(cherry picked from commit ce1f4d009316d8f5f4c49b18e1bd94687d80c59d)

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

Cr-Commit-Position: refs/branch-heads/2661@{#228}
Cr-Branched-From: ef6f6ae5e4c96622286b563658d5cd62a6cf1197-refs/heads/master@{#378081}

[modify] https://crrev.com/c278e82252a35dd31989c5e0b658b3d10788163d/android_webview/javatests/src/org/chromium/android_webview/test/LoadDataWithBaseUrlTest.java
[modify] https://crrev.com/c278e82252a35dd31989c5e0b658b3d10788163d/content/browser/android/web_contents_observer_proxy.cc
[modify] https://crrev.com/c278e82252a35dd31989c5e0b658b3d10788163d/content/browser/android/web_contents_observer_proxy.h

Cc: amineer@chromium.org
Alex, do you think it makes sense to consider this change for M49 after testing on M50 first? I can imagine lots of apps may be calling `loadUrl("javascript:")` immediately after `loadDataWithBaseUrl`.
This issue is impacting a large portion of MoPub customers as it's breaking specific ads rendering in the MoPub SDK and is causing a revenue loss for our app developers. Would be great to get this fixed in M49. Thank you!
Labels: Merge-Request-49
Bo has confirmed that his fix for another loadDataWithBaseURL problem (crbug.com/594611) doesn't involve any changes to the code changed in #6, so it can be merged into M49 independently.

Comment 10 by tin...@google.com, Mar 16 2016

Labels: -Merge-Request-49 Merge-Review-49 Hotlist-Merge-Review
[Automated comment] Request affecting a post-stable build (M49), manual review required.

Comment 11 by amin...@google.com, Mar 16 2016

Labels: -Merge-Review-49 Merge-Approved-49
Merge approved for M49 branch 2623.
Project Member

Comment 12 by bugdroid1@chromium.org, Mar 16 2016

Labels: -merge-approved-49 merge-merged-2623
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/78fca66434b0e5986b4501ea291175ae4b6b56df

commit 78fca66434b0e5986b4501ea291175ae4b6b56df
Author: Mikhail Naganov <mnaganov@chromium.org>
Date: Wed Mar 16 20:14:27 2016

Store and use last base URL between DidStart / DidStopLoading

As it turns out that the committed entry may omit the base
URL if there has been a javascript: URL navigation after
LoadDataWithBaseURL. Thus we have to store the base url on
DidStartLoading and use it in DidStopLoading / DidFinishLoad.

We have to preserve the old hack with SetToBaseURLForDataURLIfNeeded
because if the base URL is not valid, DidFinishLoad doesn't
receive it from the renderer.

This change is a short-term workaround. The correct solution
is to pass a flag that the load was through LoadDataWithBaseURL
via Blink, so base URL can be restored correctly within
NavigationController.

BUG= 594001 

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

Cr-Commit-Position: refs/heads/master@{#381108}
(cherry picked from commit ce1f4d009316d8f5f4c49b18e1bd94687d80c59d)

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

Cr-Commit-Position: refs/branch-heads/2623@{#627}
Cr-Branched-From: 92d77538a86529ca35f9220bd3cd512cbea1f086-refs/heads/master@{#369907}

[modify] https://crrev.com/78fca66434b0e5986b4501ea291175ae4b6b56df/android_webview/javatests/src/org/chromium/android_webview/test/LoadDataWithBaseUrlTest.java
[modify] https://crrev.com/78fca66434b0e5986b4501ea291175ae4b6b56df/content/browser/android/web_contents_observer_proxy.cc
[modify] https://crrev.com/78fca66434b0e5986b4501ea291175ae4b6b56df/content/browser/android/web_contents_observer_proxy.h

Status: Fixed (was: Assigned)
Is there an ETA for when M49 will be redeployed with this fix, or has that already happened? 

Comment 15 by boliu@chromium.org, Mar 17 2016

> Is there an ETA for when M49 will be redeployed with this fix, or has that already happened?

Not yet. Waiting for another crash fix. Hoping for next week.
Hi there- pinging this thread to see if there are updates on ETA for push. Thank you. 

Comment 17 by torne@chromium.org, Mar 22 2016

We pushed a respin of M49 yesterday, to the same users who received the previous M49 build.
Thanks. Do you have the specific build of M49 after which this issue is fixed? We tested a few builds and still saw the issue. However, it was resolved in M50, so I think we were just testing incorrect versions of M49. 
49.0.2623.102 seems to be the first build with the merge from Comment 12.
The fix should be available to all users at this point with 49.0.2623.105+ (which should be 100% released).  Let us know if you can still repro.

Sign in to add a comment