Commit a2ecca69 authored by Stephane Zermatten's avatar Stephane Zermatten Committed by Commit Bot

[Autofill Assistant] Fix to always use the page URL in controller.

Before this patch, scripts were checked for the url from DidFinishLoad.
This generally works, because most URLs loaded from a page belong to the
same domain, but not all. In some cases, depending on loading order,
this resulted in the set of runnable script being cleared unexpectedly.

With this patch, the controller always uses the page URL. In most cases,
since DidFinishLoad reports loading resources, this reports the same
URL, wehich is a no-op for GetOrCheckScripts. The set of runnable
scripts should now be stable on a given page.

Bug: 806868
Change-Id: Ifb8f5955c00396a9d2165eb0bacf73c8c825f76d
Reviewed-on: https://chromium-review.googlesource.com/1257002Reviewed-by: default avatarRouslan Solomakhin <rouslan@chromium.org>
Commit-Queue: Stephane Zermatten <szermatt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595855}
parent 4fe547be
......@@ -207,7 +207,10 @@ void Controller::DidFinishLoad(content::RenderFrameHost* render_frame_host,
const GURL& validated_url) {
// TODO(crbug.com/806868): Find a better time to get and update assistant
// scripts.
GetOrCheckScripts(validated_url);
// validated_url might not be the page URL. Ignore it and always check the
// last committed url.
GetOrCheckScripts(web_contents()->GetLastCommittedURL());
}
void Controller::WebContentsDestroyed() {
......
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