Reland: Do not call 'navigation committed' callback if there was no pending item to commit.

GetPendingItem can return null inside webView:didCommitNavigation:
This is due to crbug.com/925304, which allows to discard pending items
by another navigations prematurely.

If pending item is null, it means that Navigation Manager will not commit
that item and WebStateObservers can crash because they expect to have at
least one committed item.

This CL leaves navigation as "uncommitted" if there was no pending item
inside webView:didCommitNavigation:

Original CL: https://chromium-review.googlesource.com/c/1448683

TBR=eugenebut@google.com

(cherry picked from commit 621ddc377ebc96f7ecd524a39956b911fd70d6f1)

Bug: 925304
Change-Id: I7852da807d183e87d1fd029d75ed63cde2287d7b
Reviewed-on: https://chromium-review.googlesource.com/c/1450300
Commit-Queue: Eugene But <eugenebut@chromium.org>
Reviewed-by: Justin Cohen <justincohen@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#628537}
Reviewed-on: https://chromium-review.googlesource.com/c/1451219
Reviewed-by: Eugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/branch-heads/3683@{#148}
Cr-Branched-From: e51029943e0a38dd794b73caaf6373d5496ae783-refs/heads/master@{#625896}
1 file changed