From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samuel Attard <samuel.r.attard@gmail.com>
Date: Fri, 18 Dec 2020 15:19:39 -0800
Subject: Don't use potentially null "GetWebFrame()->View()" when get blink
 prefs

For whatever reason (still haven't narrowed it down to an exact test case) when using OOPIFs the "GetWebFrame()->View()" call during "RenderFrameCreated" call be nullptr.  Accessing the prefs via the render_view though still works.

This regressed in https://chromium-review.googlesource.com/c/chromium/src/+/2572256

Upstream: https://chromium-review.googlesource.com/c/chromium/src/+/2598393

diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index c3bed8fa670cb079bc182addd93f9507e5448dca..150124a2827d7d8697a07b23c03bd14e758ea5c8 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -2358,7 +2358,7 @@ const blink::WebView* RenderFrameImpl::GetWebView() const {
 }
 
 const blink::web_pref::WebPreferences& RenderFrameImpl::GetBlinkPreferences() {
-  return GetWebView()->GetWebPreferences();
+  return render_view_->GetWebView()->GetWebPreferences();
 }
 
 const blink::RendererPreferences& RenderFrameImpl::GetRendererPreferences()
