Commit da0c64a5 authored by Avi Drissman's avatar Avi Drissman Committed by Commit Bot

Don't use WebContents::GetURL().

WebContents::GetURL() is deprecated because there's no way to know
*what* URL it's giving you. In this particular case, it pulled a
URL from the *future* of a page's navigation history, which caused
a loop to not terminate properly.

(And all the metrics are wrong :( ouch )

BUG=854430
TEST=as in bug

Change-Id: I798af0278ffde3421fa933644513fafba8bd0b2d
Reviewed-on: https://chromium-review.googlesource.com/1113660Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#570092}
parent 0852c4cc
......@@ -88,7 +88,7 @@ enum class DialogOriginRelationship {
DialogOriginRelationship GetDialogOriginRelationship(
content::WebContents* web_contents,
content::RenderFrameHost* alerting_frame) {
GURL main_frame_url = web_contents->GetURL();
GURL main_frame_url = web_contents->GetLastCommittedURL();
if (!main_frame_url.SchemeIsHTTPOrHTTPS())
return DialogOriginRelationship::NON_HTTP_MAIN_FRAME;
......
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