Navigation: Avoid early abort when intercepting DidCommit.

After running a callback in the renderer we destroy the
NavigationClient interface that was used to commit, since
by design, it is an interface that lives only during the navigation.

This is not an issue, except with the introduction of mechanisms
intercepting DidCommit* callbacks and messages execution. In this case,
the callback is intercepted, but the destruction still is interpreted
by the NavigationRequest to be an abort.

To counteract this, we introduce a new helper function that we use to
ignore interface disconnects when receiving the DidCommit* messages,
and before processing it. This way we are guaranteed (because we
receive the messages in order DidCommit -> Disconnect) that the
disconnect coming from this source is always ignored.

Bug: 784904
Change-Id: If169c3f9fb76a20200dbb1466e9bc48d736140bf
Reviewed-on: https://chromium-review.googlesource.com/c/1491434
Reviewed-by: Camille Lamy <clamy@chromium.org>
Commit-Queue: Arthur Hemery <ahemery@chromium.org>
Cr-Commit-Position: refs/heads/master@{#636771}
3 files changed