Commit 0d72b49b authored by Francois Doray's avatar Francois Doray Committed by Chromium LUCI CQ

[content] Assert that RenderWidgetHostViewAura::frame_sink_id_ is valid.

This is a cleanup prior to fixing crbug.com/1164477. It improves
readability by removing code that handles situations that never occur.

Bug: 1164477
Change-Id: I97e77b54ffc40e100b07b00ab44fbe3a46bb9eb9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2618159
Commit-Queue: Charlie Reis <creis@chromium.org>
Reviewed-by: default avatarCharlie Reis <creis@chromium.org>
Reviewed-by: default avatardanakj <danakj@chromium.org>
Auto-Submit: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#842807}
parent eacc052e
......@@ -307,6 +307,11 @@ RenderWidgetHostViewAura::RenderWidgetHostViewAura(
device_scale_factor_(0.0f),
event_handler_(new RenderWidgetHostViewEventHandler(host(), this, this)),
frame_sink_id_(host()->GetFrameSinkId()) {
// CreateDelegatedFrameHostClient() and CreateAuraWindow() assume that the
// FrameSinkId is valid. RenderWidgetHostImpl::GetFrameSinkId() always returns
// a valid FrameSinkId.
DCHECK(frame_sink_id_.is_valid());
CreateDelegatedFrameHostClient();
host()->SetView(this);
......@@ -2015,14 +2020,10 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) {
: SK_ColorWHITE);
// This needs to happen only after |window_| has been initialized using
// Init(), because it needs to have the layer.
if (frame_sink_id_.is_valid())
window_->SetEmbedFrameSinkId(frame_sink_id_);
window_->SetEmbedFrameSinkId(frame_sink_id_);
}
void RenderWidgetHostViewAura::CreateDelegatedFrameHostClient() {
if (!frame_sink_id_.is_valid())
return;
delegated_frame_host_client_ =
std::make_unique<DelegatedFrameHostClientAura>(this);
delegated_frame_host_ = std::make_unique<DelegatedFrameHost>(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment