refactor: remove CreateViewForWidget patch (#47084)

* refactor: remove CreateViewForWidget patch

Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>

* chore: rm unintended osr change

Co-authored-by: deepak1556 <hop2deep@gmail.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
This commit is contained in:
trop[bot] 2025-05-14 16:01:44 -05:00 committed by GitHub
commit ec1b0f4923
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 20 additions and 84 deletions

View file

@ -170,7 +170,7 @@ class OffScreenRenderWidgetHostView
content::RenderWidgetHostViewBase* CreateViewForWidget(
content::RenderWidgetHost*,
content::RenderWidgetHost*,
content::WebContentsView*) override;
content::WebContentsView*);
const viz::LocalSurfaceId& GetLocalSurfaceId() const override;
const viz::FrameSinkId& GetFrameSinkId() const override;

View file

@ -122,14 +122,19 @@ OffScreenWebContentsView::CreateViewForChildWidget(
auto* web_contents_impl =
static_cast<content::WebContentsImpl*>(web_contents_);
auto* view = static_cast<OffScreenRenderWidgetHostView*>(
web_contents_impl->GetOuterWebContents()
? web_contents_impl->GetOuterWebContents()->GetRenderWidgetHostView()
: web_contents_impl->GetRenderWidgetHostView());
OffScreenRenderWidgetHostView* embedder_host_view = nullptr;
if (web_contents_impl->GetOuterWebContents()) {
embedder_host_view = static_cast<OffScreenRenderWidgetHostView*>(
web_contents_impl->GetOuterWebContents()->GetRenderWidgetHostView());
} else {
embedder_host_view = static_cast<OffScreenRenderWidgetHostView*>(
web_contents_impl->GetRenderWidgetHostView());
}
return new OffScreenRenderWidgetHostView(
transparent_, offscreen_use_shared_texture_, painting_,
view->frame_rate(), callback_, render_widget_host, view, GetSize());
embedder_host_view->frame_rate(), callback_, render_widget_host,
embedder_host_view, GetSize());
}
void OffScreenWebContentsView::RenderViewReady() {