Commit 707e8160 authored by Dave Tapuska's avatar Dave Tapuska Committed by Commit Bot

Move DidCommitCompositorFrame to WebViewClient.

The only usage of this API is for the RenderViewImpl notifying observers
that a commit has happened. This callback can simply occur on the
WebViewClient API.

BUG=1097816

Change-Id: Ic9f5fd946c18498ee87d6a3d5f58b04729b5081b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2492887Reviewed-by: default avatardanakj <danakj@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/master@{#820348}
parent 4d808f4a
...@@ -314,14 +314,6 @@ bool RenderViewImpl::SupportsMultipleWindowsForWidget() { ...@@ -314,14 +314,6 @@ bool RenderViewImpl::SupportsMultipleWindowsForWidget() {
return webview_->GetWebPreferences().supports_multiple_windows; return webview_->GetWebPreferences().supports_multiple_windows;
} }
void RenderViewImpl::DidCommitCompositorFrameForWidget() {
for (auto& observer : observers_)
observer.DidCommitCompositorFrame();
if (GetWebView())
GetWebView()->UpdatePreferredSize();
}
// IPC message handlers ----------------------------------------- // IPC message handlers -----------------------------------------
void RenderViewImpl::OnSetHistoryOffsetAndLength(int history_offset, void RenderViewImpl::OnSetHistoryOffsetAndLength(int history_offset,
...@@ -603,6 +595,12 @@ void RenderViewImpl::ZoomLevelChanged() { ...@@ -603,6 +595,12 @@ void RenderViewImpl::ZoomLevelChanged() {
observer.OnZoomLevelChanged(); observer.OnZoomLevelChanged();
} }
void RenderViewImpl::DidCommitCompositorFrameForLocalMainFrame(
base::TimeTicks commit_start_time) {
for (auto& observer : observers_)
observer.DidCommitCompositorFrame();
}
void RenderViewImpl::PropagatePageZoomToNewlyAttachedFrame( void RenderViewImpl::PropagatePageZoomToNewlyAttachedFrame(
bool use_zoom_for_dsf, bool use_zoom_for_dsf,
float device_scale_factor) { float device_scale_factor) {
......
...@@ -210,6 +210,8 @@ class CONTENT_EXPORT RenderViewImpl : public blink::WebViewClient, ...@@ -210,6 +210,8 @@ class CONTENT_EXPORT RenderViewImpl : public blink::WebViewClient,
void OnPageVisibilityChanged(PageVisibilityState visibility) override; void OnPageVisibilityChanged(PageVisibilityState visibility) override;
void OnPageFrozenChanged(bool frozen) override; void OnPageFrozenChanged(bool frozen) override;
void ZoomLevelChanged() override; void ZoomLevelChanged() override;
void DidCommitCompositorFrameForLocalMainFrame(
base::TimeTicks commit_start_time) override;
void OnSetHistoryOffsetAndLength(int history_offset, void OnSetHistoryOffsetAndLength(int history_offset,
int history_length) override; int history_length) override;
...@@ -314,7 +316,6 @@ class CONTENT_EXPORT RenderViewImpl : public blink::WebViewClient, ...@@ -314,7 +316,6 @@ class CONTENT_EXPORT RenderViewImpl : public blink::WebViewClient,
// RenderWidgetDelegate implementation ---------------------------------- // RenderWidgetDelegate implementation ----------------------------------
bool SupportsMultipleWindowsForWidget() override; bool SupportsMultipleWindowsForWidget() override;
void DidCommitCompositorFrameForWidget() override;
// Old WebLocalFrameClient implementations // Old WebLocalFrameClient implementations
// ---------------------------------------- // ----------------------------------------
......
...@@ -251,11 +251,6 @@ void RenderWidget::RequestPresentation(PresentationTimeCallback callback) { ...@@ -251,11 +251,6 @@ void RenderWidget::RequestPresentation(PresentationTimeCallback callback) {
layer_tree_host_->SetNeedsCommitWithForcedRedraw(); layer_tree_host_->SetNeedsCommitWithForcedRedraw();
} }
void RenderWidget::DidCommitCompositorFrame(base::TimeTicks commit_start_time) {
if (delegate())
delegate()->DidCommitCompositorFrameForWidget();
}
void RenderWidget::ScheduleAnimation() { void RenderWidget::ScheduleAnimation() {
// This call is not needed in single thread mode for tests without a // This call is not needed in single thread mode for tests without a
// scheduler, but they override this method in order to schedule a synchronous // scheduler, but they override this method in order to schedule a synchronous
......
...@@ -201,7 +201,6 @@ class CONTENT_EXPORT RenderWidget ...@@ -201,7 +201,6 @@ class CONTENT_EXPORT RenderWidget
void SetWindowRect(const gfx::Rect&) override; void SetWindowRect(const gfx::Rect&) override;
viz::FrameSinkId GetFrameSinkId() override; viz::FrameSinkId GetFrameSinkId() override;
void RecordTimeToFirstActivePaint(base::TimeDelta duration) override; void RecordTimeToFirstActivePaint(base::TimeDelta duration) override;
void DidCommitCompositorFrame(base::TimeTicks commit_start_time) override;
void ConvertViewportToWindow(blink::WebRect* rect); void ConvertViewportToWindow(blink::WebRect* rect);
void UpdateTextInputState(); void UpdateTextInputState();
......
...@@ -21,10 +21,6 @@ class CONTENT_EXPORT RenderWidgetDelegate { ...@@ -21,10 +21,6 @@ class CONTENT_EXPORT RenderWidgetDelegate {
// Returns whether multiple windows are allowed for the widget. If true, then // Returns whether multiple windows are allowed for the widget. If true, then
// Show() may be called more than once. // Show() may be called more than once.
virtual bool SupportsMultipleWindowsForWidget() = 0; virtual bool SupportsMultipleWindowsForWidget() = 0;
// Called when the RenderWidget handles
// LayerTreeViewDelegate::DidCommitCompositorFrame().
virtual void DidCommitCompositorFrameForWidget() = 0;
}; };
} // namespace content } // namespace content
......
...@@ -135,6 +135,12 @@ class WebViewClient { ...@@ -135,6 +135,12 @@ class WebViewClient {
// Called when the View's zoom has changed. // Called when the View's zoom has changed.
virtual void ZoomLevelChanged() {} virtual void ZoomLevelChanged() {}
// Notification that the output of a BeginMainFrame was committed to the
// compositor (thread), though would not be submitted to the display
// compositor yet. This will only be called for local main frames.
virtual void DidCommitCompositorFrameForLocalMainFrame(
base::TimeTicks commit_start_time) {}
// Session history ----------------------------------------------------- // Session history -----------------------------------------------------
// Returns the number of history items before/after the current // Returns the number of history items before/after the current
......
...@@ -125,11 +125,6 @@ class WebWidgetClient { ...@@ -125,11 +125,6 @@ class WebWidgetClient {
// perform actual painting work. // perform actual painting work.
virtual void WillBeginMainFrame() {} virtual void WillBeginMainFrame() {}
// Notification that the output of a BeginMainFrame was committed to the
// compositor (thread), though would not be submitted to the display
// compositor yet (see DidCommitAndDrawCompositorFrame()).
virtual void DidCommitCompositorFrame(base::TimeTicks commit_start_time) {}
// Notifies that the layer tree host has completed a call to // Notifies that the layer tree host has completed a call to
// RequestMainFrameUpdate in response to a BeginMainFrame. // RequestMainFrameUpdate in response to a BeginMainFrame.
virtual void DidBeginMainFrame() {} virtual void DidBeginMainFrame() {}
......
...@@ -663,11 +663,6 @@ void WebFrameWidgetBase::RequestBeginMainFrameNotExpected(bool request) { ...@@ -663,11 +663,6 @@ void WebFrameWidgetBase::RequestBeginMainFrameNotExpected(bool request) {
widget_base_->LayerTreeHost()->RequestBeginMainFrameNotExpected(request); widget_base_->LayerTreeHost()->RequestBeginMainFrameNotExpected(request);
} }
void WebFrameWidgetBase::EndCommitCompositorFrame(
base::TimeTicks commit_start_time) {
Client()->DidCommitCompositorFrame(commit_start_time);
}
void WebFrameWidgetBase::DidCommitAndDrawCompositorFrame() { void WebFrameWidgetBase::DidCommitAndDrawCompositorFrame() {
ForEachLocalFrameControlledByWidget( ForEachLocalFrameControlledByWidget(
local_root_->GetFrame(), local_root_->GetFrame(),
......
...@@ -337,7 +337,6 @@ class CORE_EXPORT WebFrameWidgetBase ...@@ -337,7 +337,6 @@ class CORE_EXPORT WebFrameWidgetBase
void RecordDispatchRafAlignedInputTime( void RecordDispatchRafAlignedInputTime(
base::TimeTicks raf_aligned_input_start_time) override; base::TimeTicks raf_aligned_input_start_time) override;
void RecordTimeToFirstActivePaint(base::TimeDelta duration) override; void RecordTimeToFirstActivePaint(base::TimeDelta duration) override;
void EndCommitCompositorFrame(base::TimeTicks commit_start_time) override;
void DidCommitAndDrawCompositorFrame() override; void DidCommitAndDrawCompositorFrame() override;
std::unique_ptr<cc::LayerTreeFrameSink> AllocateNewLayerTreeFrameSink() std::unique_ptr<cc::LayerTreeFrameSink> AllocateNewLayerTreeFrameSink()
override; override;
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "third_party/blink/public/platform/platform.h" #include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/public/web/web_autofill_client.h" #include "third_party/blink/public/web/web_autofill_client.h"
#include "third_party/blink/public/web/web_view_client.h"
#include "third_party/blink/renderer/core/editing/frame_selection.h" #include "third_party/blink/renderer/core/editing/frame_selection.h"
#include "third_party/blink/renderer/core/exported/web_view_impl.h" #include "third_party/blink/renderer/core/exported/web_view_impl.h"
#include "third_party/blink/renderer/core/frame/local_frame_ukm_aggregator.h" #include "third_party/blink/renderer/core/frame/local_frame_ukm_aggregator.h"
...@@ -103,7 +104,10 @@ void WebViewFrameWidget::EndCommitCompositorFrame( ...@@ -103,7 +104,10 @@ void WebViewFrameWidget::EndCommitCompositorFrame(
base::TimeTicks commit_start_time) { base::TimeTicks commit_start_time) {
DCHECK(commit_compositor_frame_start_time_.has_value()); DCHECK(commit_compositor_frame_start_time_.has_value());
WebFrameWidgetBase::EndCommitCompositorFrame(commit_start_time); web_view_->Client()->DidCommitCompositorFrameForLocalMainFrame(
commit_start_time);
web_view_->UpdatePreferredSize();
web_view_->MainFrameImpl() web_view_->MainFrameImpl()
->GetFrame() ->GetFrame()
->View() ->View()
......
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