Browse Source

fixes widget host fetching from render view host (#21013)

trop[bot] 5 years ago
parent
commit
5b33e9d9b7
1 changed files with 2 additions and 3 deletions
  1. 2 3
      shell/browser/api/atom_api_web_contents.cc

+ 2 - 3
shell/browser/api/atom_api_web_contents.cc

@@ -837,9 +837,8 @@ void WebContents::BeforeUnloadFired(bool proceed,
 }
 
 void WebContents::RenderViewCreated(content::RenderViewHost* render_view_host) {
-  auto* const impl = content::RenderWidgetHostImpl::FromID(
-      render_view_host->GetProcess()->GetID(),
-      render_view_host->GetRoutingID());
+  auto* impl = static_cast<content::RenderWidgetHostImpl*>(
+      render_view_host->GetWidget());
   if (impl)
     impl->disable_hidden_ = !background_throttling_;
 }