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

Issue 832812 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 1
Type: Bug



Sign in to add a comment

Crashes when trying to stop WebContents during Navigation Starts

Project Member Reported by yyzhong@chromium.org, Apr 13 2018

Issue description

What steps will reproduce the problem?
- Call WebContents.Stop() during WebContentsObserver.DidStartNavigation()

What is the expected result?
- Stop navigation

What happens instead?
- Crashed


I am working on b/74124275 which I need to stop the current navigation and open up another WebContents. When I do so I see the crashes at NavigationRequest::BeginNavigation(). 

code location:
https://cs.chromium.org/chromium/src/content/browser/frame_host/navigation_request.cc?rcl=eb780fd434496084168f4aade94cfb4e571d5225&l=549



 
Cc: yyzhong@chromium.org
AFAIK this is not supported intentionally. Other WebContentsObservers will want to observe a navigation starting after your observer.

If you want to stop the navigation in your observer, just post a task to WebContents::Stop, which should be safe.

Comment 3 by creis@chromium.org, Apr 13 2018

Cc: clamy@chromium.org creis@chromium.org nasko@chromium.org
Status: WontFix (was: Untriaged)
Comment 2 is correct.  This is intentional to avoid a use-after-free on the pending NavigationEntry, which can't be discarded as we're in the middle of starting the navigation.  Posting a task is the way to do this if you have to do it from a WebContentsObserver.  NavigationThrottles may offer a better approach if you're trying to stop a navigation.

Sign in to add a comment