Commit 8cc1ac56 authored by Francois Doray's avatar Francois Doray Committed by Chromium LUCI CQ

[content] Do not unnecessarily handle delegated_frame_host_ being null in RenderWidgetHostViewMac.

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: Ia9356857eb82e75d8d3527e278036c12dfdc636d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2618183
Commit-Queue: Charlie Reis <creis@chromium.org>
Auto-Submit: François Doray <fdoray@chromium.org>
Reviewed-by: default avatarCharlie Reis <creis@chromium.org>
Reviewed-by: default avatardanakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#843683}
parent c48a2fa8
...@@ -445,9 +445,6 @@ void RenderWidgetHostViewMac::WasUnOccluded() { ...@@ -445,9 +445,6 @@ void RenderWidgetHostViewMac::WasUnOccluded() {
browser_compositor_->SetRenderWidgetHostIsHidden(false); browser_compositor_->SetRenderWidgetHostIsHidden(false);
DelegatedFrameHost* delegated_frame_host =
browser_compositor_->GetDelegatedFrameHost();
bool has_saved_frame = bool has_saved_frame =
browser_compositor_->has_saved_frame_before_state_transition(); browser_compositor_->has_saved_frame_before_state_transition();
...@@ -458,17 +455,18 @@ void RenderWidgetHostViewMac::WasUnOccluded() { ...@@ -458,17 +455,18 @@ void RenderWidgetHostViewMac::WasUnOccluded() {
? tab_switch_start_state.Clone() ? tab_switch_start_state.Clone()
: blink::mojom::RecordContentToVisibleTimeRequestPtr()); : blink::mojom::RecordContentToVisibleTimeRequestPtr());
if (delegated_frame_host) { // If the frame for the renderer is already available, then the
// If the frame for the renderer is already available, then the // tab-switching time is the presentation time for the browser-compositor.
// tab-switching time is the presentation time for the browser-compositor. DelegatedFrameHost* delegated_frame_host =
const bool record_presentation_time = has_saved_frame; browser_compositor_->GetDelegatedFrameHost();
delegated_frame_host->WasShown( DCHECK(delegated_frame_host);
browser_compositor_->GetRendererLocalSurfaceId(), const bool record_presentation_time = has_saved_frame;
browser_compositor_->GetRendererSize(), delegated_frame_host->WasShown(
record_presentation_time browser_compositor_->GetRendererLocalSurfaceId(),
? std::move(tab_switch_start_state) browser_compositor_->GetRendererSize(),
: blink::mojom::RecordContentToVisibleTimeRequestPtr()); record_presentation_time
} ? std::move(tab_switch_start_state)
: blink::mojom::RecordContentToVisibleTimeRequestPtr());
} }
void RenderWidgetHostViewMac::WasOccluded() { void RenderWidgetHostViewMac::WasOccluded() {
......
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