Commit 80056be0 authored by yilkal's avatar yilkal Committed by Commit Bot

Check Navigation committed in SupervisedUserNavigationObserver.

This CL makes sure that navigation has committed
in SupervisedUserNavigationObserver::DidFinishNavigation before
trying to access the RenderFrameHost that hosted the navigation.

Bug: 1042620
Change-Id: I8258023537c769338c82e54927d38107759b1db3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2008317Reviewed-by: default avatarAlex Moshchuk <alexmos@chromium.org>
Reviewed-by: default avatarAga Wronska <agawronska@chromium.org>
Commit-Queue: Yilkal Abe <yilkal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#734566}
parent 2ee1bc79
......@@ -102,6 +102,9 @@ void SupervisedUserNavigationObserver::UpdateMainFrameFilteringStatus(
void SupervisedUserNavigationObserver::DidFinishNavigation(
content::NavigationHandle* navigation_handle) {
if (!navigation_handle->HasCommitted())
return;
int frame_id = navigation_handle->GetFrameTreeNodeId();
int64_t navigation_id = navigation_handle->GetNavigationId();
......@@ -117,7 +120,7 @@ void SupervisedUserNavigationObserver::DidFinishNavigation(
// have been filtered by the NavigationThrottle.
if (navigation_handle->IsSameDocument() &&
navigation_handle->IsInMainFrame()) {
auto* render_frame_host = navigation_handle->GetRenderFrameHost();
auto* render_frame_host = web_contents()->GetMainFrame();
int process_id = render_frame_host->GetProcess()->GetID();
int routing_id = render_frame_host->GetRoutingID();
......
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