Add logging to debug nullptr in TabWebContentsDelegateAndroid.addNewContents

Adds logging which verifies that the |delegate_| used by WebContentsImpl for
WebContentsCreated is the same used for AddNewContents. A failure will result
in a crash on Android.

Helps debug by providing the following info:
- If delegate is null at WebContentsCreated and non-null at AddNewContents,
there is a race between WebContentsCreated and delegate assignment.
- If delegate is non-null in both cases, but different, it means we're
updating the delegate between the two, which is also not safe.
- If no log messages are fired and we still crash, it means AddNewContents
was called twice.

Bug: 758186
Change-Id: I103cd77c148af25adb1c7002354bb3b853c913b5
Reviewed-on: https://chromium-review.googlesource.com/c/1407269
Commit-Queue: Eric Karl <[email protected]>
Reviewed-by: Bo <[email protected]>
Cr-Commit-Position: refs/heads/master@{#622232}
2 files changed