Chromium Code Reviews| Index: chrome/browser/page_load_metrics/metrics_web_contents_observer.cc |
| diff --git a/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc b/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc |
| index 044495e8c15477c6feb9d26f3b8e58b564fdebe0..d56e391d04b3dcc5e53741f207c8f6d068abdabc 100644 |
| --- a/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc |
| +++ b/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc |
| @@ -178,11 +178,10 @@ void MetricsWebContentsObserver::WillStartNavigationRequest( |
| // WebContent's opener. This is more accurate than using referrers due to |
| // referrer sanitizing and origin referrers. Note that this could potentially |
| // be inaccurate if the opener has since navigated. |
| - content::WebContents* opener = web_contents()->GetOpener(); |
| - const GURL& opener_url = |
| - !has_navigated_ && opener |
| - ? web_contents()->GetOpener()->GetLastCommittedURL() |
| - : GURL::EmptyGURL(); |
| + content::RenderFrameHost* opener = web_contents()->GetOpener(); |
| + const GURL& opener_url = !has_navigated_ && opener |
| + ? opener->GetLastCommittedURL() |
|
ncarter (slow)
2017/05/22 17:32:42
I think this is an accuracy improvement, but let's
Łukasz Anforowicz
2017/05/22 18:25:38
Good point. Some notes about the change above:
-
Bryan McQuade
2017/05/23 13:57:02
Thanks so much for the thorough analysis & reachin
Łukasz Anforowicz
2017/05/23 18:56:03
The change of return type of WebContents::GetOpene
Bryan McQuade
2017/05/23 19:06:40
Thanks! I see now. This change SGTM, thanks!
|
| + : GURL::EmptyGURL(); |
| const GURL& currently_committed_url = |
| committed_load_ ? committed_load_->url() : opener_url; |
| has_navigated_ = true; |