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 f703ab8f616e9765ed3384654a271f251c16ac71..4f92c7c4a069d324b0d11a849937151143816f84 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -2370,7 +2370,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()
