Gracefully handle null pending item inside webView:didCommitNavigation:.

webView:didCommitNavigation: used to assume that pending item is
always valid and crashed on dereferencing null pointer. Pending item
should never be null inside webView:didCommitNavigation: but existing
ownership model is incorrect, so pending item could be distroyed before
committing.

This CL adds checks before dereferencing pending item to avoid the
crash. The real fix could be implemented by storing pending item in
NavigationContext object (crbug.com/925304).

Bug: 676458
Change-Id: Idf60e60cbe98111e8fed5d2903ae8bc8b8df3d90
Reviewed-on: https://chromium-review.googlesource.com/c/1444953
Reviewed-by: Justin Cohen <justincohen@chromium.org>
Commit-Queue: Eugene But <eugenebut@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#627509}(cherry picked from commit 010e2b264abf807d9d24f080816e657d6bbaa2ee)
Reviewed-on: https://chromium-review.googlesource.com/c/1448521
Reviewed-by: Kariah Davis <kariahda@chromium.org>
Cr-Commit-Position: refs/branch-heads/3683@{#94}
Cr-Branched-From: e51029943e0a38dd794b73caaf6373d5496ae783-refs/heads/master@{#625896}
1 file changed