Add extra null-checks for return value of WebContents::FromRenderFrameHost()

The result value of WebContents::FromRenderFrameHost() can be a nullptr if
the RenderFrameHost's delegate is not a WebContents, so we need to add this
extra check in all the binders method that still don't have it to prevent
potential crashes.

Bug: 936482,1006361, 1040649
Change-Id: I688015361d34ec50e43feac0b88053159fbe941c
Reviewed-by: Dominick Ng <>
Reviewed-by: Oksana Zhuravlova <>
Commit-Queue: Mario Sanchez Prada <>
Cr-Commit-Position: refs/heads/master@{#730338}
1 file changed