Commit 51ba32ba authored by Dave Tapuska's avatar Dave Tapuska Committed by Commit Bot

Add a separate WebSwapResult class so we don't depend on WebWidgetClient

Remove definition from WebWidgetClient because it is used in various
classes that have no concept of the WebWidgetClient.

Stop including web_widget_client.h inside chrome_client.h

Change-Id: I14f6fa28c87054cd1004e078c828a24b817c50f4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2078592
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745079}
parent d2f9bb38
......@@ -489,7 +489,7 @@ static void PrintDocumentTofile(v8::Isolate* isolate,
}
void OnSwapCompletedHelper(CallbackAndContext* callback_and_context,
blink::WebWidgetClient::SwapResult,
blink::WebSwapResult,
base::TimeTicks) {
RunCallbackHelper(callback_and_context);
}
......
......@@ -3284,7 +3284,7 @@ void RenderWidget::RequestDecode(const cc::PaintImage& image,
// Enables measuring and reporting both presentation times and swap times in
// swap promises.
class ReportTimeSwapPromise : public cc::SwapPromise {
using ReportTimeCallback = blink::WebWidgetClient::ReportTimeCallback;
using ReportTimeCallback = blink::WebReportTimeCallback;
public:
ReportTimeSwapPromise(ReportTimeCallback swap_time_callback,
......@@ -3319,19 +3319,19 @@ class ReportTimeSwapPromise : public cc::SwapPromise {
cc::SwapPromise::DidNotSwapAction DidNotSwap(
DidNotSwapReason reason) override {
blink::WebWidgetClient::SwapResult result;
blink::WebSwapResult result;
switch (reason) {
case cc::SwapPromise::DidNotSwapReason::SWAP_FAILS:
result = blink::WebWidgetClient::SwapResult::kDidNotSwapSwapFails;
result = blink::WebSwapResult::kDidNotSwapSwapFails;
break;
case cc::SwapPromise::DidNotSwapReason::COMMIT_FAILS:
result = blink::WebWidgetClient::SwapResult::kDidNotSwapCommitFails;
result = blink::WebSwapResult::kDidNotSwapCommitFails;
break;
case cc::SwapPromise::DidNotSwapReason::COMMIT_NO_UPDATE:
result = blink::WebWidgetClient::SwapResult::kDidNotSwapCommitNoUpdate;
result = blink::WebSwapResult::kDidNotSwapCommitNoUpdate;
break;
case cc::SwapPromise::DidNotSwapReason::ACTIVATION_FAILS:
result = blink::WebWidgetClient::SwapResult::kDidNotSwapActivationFails;
result = blink::WebSwapResult::kDidNotSwapActivationFails;
break;
}
// During a failed swap, return the current time regardless of whether we're
......@@ -3339,8 +3339,8 @@ class ReportTimeSwapPromise : public cc::SwapPromise {
task_runner_->PostTask(
FROM_HERE,
base::BindOnce(
[](blink::WebWidgetClient::SwapResult result,
base::TimeTicks swap_time, ReportTimeCallback swap_time_callback,
[](blink::WebSwapResult result, base::TimeTicks swap_time,
ReportTimeCallback swap_time_callback,
ReportTimeCallback presentation_time_callback) {
ReportTime(std::move(swap_time_callback), result, swap_time);
ReportTime(std::move(presentation_time_callback), result,
......@@ -3367,13 +3367,13 @@ class ReportTimeSwapPromise : public cc::SwapPromise {
frame_token,
base::BindOnce(&RunCallbackAfterPresentation,
std::move(presentation_time_callback), swap_time));
ReportTime(std::move(swap_time_callback),
blink::WebWidgetClient::SwapResult::kDidSwap, swap_time);
ReportTime(std::move(swap_time_callback), blink::WebSwapResult::kDidSwap,
swap_time);
} else {
ReportTime(std::move(swap_time_callback),
blink::WebWidgetClient::SwapResult::kDidSwap, swap_time);
ReportTime(std::move(swap_time_callback), blink::WebSwapResult::kDidSwap,
swap_time);
ReportTime(std::move(presentation_time_callback),
blink::WebWidgetClient::SwapResult::kDidSwap, swap_time);
blink::WebSwapResult::kDidSwap, swap_time);
}
}
......@@ -3393,12 +3393,12 @@ class ReportTimeSwapPromise : public cc::SwapPromise {
presentation_time - swap_time);
}
ReportTime(std::move(presentation_time_callback),
blink::WebWidgetClient::SwapResult::kDidSwap,
blink::WebSwapResult::kDidSwap,
presentation_time_is_valid ? presentation_time : swap_time);
}
static void ReportTime(ReportTimeCallback callback,
blink::WebWidgetClient::SwapResult result,
blink::WebSwapResult result,
base::TimeTicks time) {
if (callback)
std::move(callback).Run(result, time);
......@@ -3415,7 +3415,7 @@ class ReportTimeSwapPromise : public cc::SwapPromise {
DISALLOW_COPY_AND_ASSIGN(ReportTimeSwapPromise);
};
void RenderWidget::NotifySwapTime(ReportTimeCallback callback) {
void RenderWidget::NotifySwapTime(blink::WebReportTimeCallback callback) {
NotifySwapAndPresentationTime(base::NullCallback(), std::move(callback));
}
......@@ -3465,8 +3465,8 @@ viz::FrameSinkId RenderWidget::GetFrameSinkId() {
}
void RenderWidget::NotifySwapAndPresentationTime(
ReportTimeCallback swap_time_callback,
ReportTimeCallback presentation_time_callback) {
blink::WebReportTimeCallback swap_time_callback,
blink::WebReportTimeCallback presentation_time_callback) {
layer_tree_host_->QueueSwapPromise(std::make_unique<ReportTimeSwapPromise>(
std::move(swap_time_callback), std::move(presentation_time_callback),
layer_tree_host_->GetTaskRunnerProvider()->MainThreadTaskRunner(),
......
......@@ -440,7 +440,7 @@ class CONTENT_EXPORT RenderWidget
void ForceRecalculateRasterScales() override;
void RequestDecode(const cc::PaintImage& image,
base::OnceCallback<void(bool)> callback) override;
void NotifySwapTime(ReportTimeCallback callback) override;
void NotifySwapTime(blink::WebReportTimeCallback callback) override;
void SetEventListenerProperties(
cc::EventListenerClass event_class,
cc::EventListenerProperties properties) override;
......@@ -470,8 +470,8 @@ class CONTENT_EXPORT RenderWidget
// production code uses |NotifySwapTime()| above which calls this one passing
// a null callback as |swap_time_callback|.
void NotifySwapAndPresentationTime(
ReportTimeCallback swap_time_callback,
ReportTimeCallback presentation_time_callback);
blink::WebReportTimeCallback swap_time_callback,
blink::WebReportTimeCallback presentation_time_callback);
// Override point to obtain that the current input method state and caret
// position.
......
......@@ -576,8 +576,7 @@ class NotifySwapTimesRenderWidgetUnittest : public RenderWidgetUnittest {
widget()->NotifySwapAndPresentationTime(
base::BindOnce(
[](base::OnceClosure swap_quit_closure, base::TimeTicks* swap_time,
blink::WebWidgetClient::SwapResult result,
base::TimeTicks timestamp) {
blink::WebSwapResult result, base::TimeTicks timestamp) {
DCHECK(!timestamp.is_null());
*swap_time = timestamp;
std::move(swap_quit_closure).Run();
......@@ -585,8 +584,7 @@ class NotifySwapTimesRenderWidgetUnittest : public RenderWidgetUnittest {
swap_run_loop.QuitClosure(), &swap_time),
base::BindOnce(
[](base::OnceClosure presentation_quit_closure,
blink::WebWidgetClient::SwapResult result,
base::TimeTicks timestamp) {
blink::WebSwapResult result, base::TimeTicks timestamp) {
DCHECK(!timestamp.is_null());
std::move(presentation_quit_closure).Run();
},
......
......@@ -391,6 +391,7 @@ source_set("blink_headers") {
"web/web_settings.h",
"web/web_shared_worker.h",
"web/web_shared_worker_client.h",
"web/web_swap_result.h",
"web/web_testing_support.h",
"web/web_text_check_client.h",
"web/web_text_checking_completion.h",
......
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_SWAP_RESULT_H_
#define THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_SWAP_RESULT_H_
#include "base/callback.h"
#include "base/time/time.h"
namespace blink {
// SwapResult mirrors the values of cc::SwapPromise::DidNotSwapReason, and
// should be kept consistent with it. SwapResult additionally adds a success
// value (kDidSwap).
// These values are written to logs. New enum values can be added, but
// existing enums must never be renumbered, deleted or reused.
enum class WebSwapResult {
kDidSwap = 0,
kDidNotSwapSwapFails = 1,
kDidNotSwapCommitFails = 2,
kDidNotSwapCommitNoUpdate = 3,
kDidNotSwapActivationFails = 4,
kSwapResultLast = kDidNotSwapActivationFails,
};
using WebReportTimeCallback =
base::OnceCallback<void(WebSwapResult, base::TimeTicks)>;
} // namespace blink
#endif // THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_SWAP_RESULT_H_
......@@ -49,6 +49,7 @@
#include "third_party/blink/public/platform/web_touch_action.h"
#include "third_party/blink/public/web/web_meaningful_layout.h"
#include "third_party/blink/public/web/web_navigation_policy.h"
#include "third_party/blink/public/web/web_swap_result.h"
class SkBitmap;
......@@ -279,26 +280,10 @@ class WebWidgetClient {
virtual void RequestDecode(const cc::PaintImage& image,
base::OnceCallback<void(bool)> callback) {}
// SwapResult mirrors the values of cc::SwapPromise::DidNotSwapReason, and
// should be kept consistent with it. SwapResult additionally adds a success
// value (kDidSwap).
// These values are written to logs. New enum values can be added, but
// existing enums must never be renumbered, deleted or reused.
enum SwapResult {
kDidSwap = 0,
kDidNotSwapSwapFails = 1,
kDidNotSwapCommitFails = 2,
kDidNotSwapCommitNoUpdate = 3,
kDidNotSwapActivationFails = 4,
kSwapResultMax,
};
using ReportTimeCallback =
base::OnceCallback<void(SwapResult, base::TimeTicks)>;
// The |callback| will be fired when the corresponding renderer frame is
// submitted (still called "swapped") to the display compositor (either with
// DidSwap or DidNotSwap).
virtual void NotifySwapTime(ReportTimeCallback callback) {}
virtual void NotifySwapTime(WebReportTimeCallback callback) {}
// Set or get what event handlers exist in the document contained in the
// WebWidget in order to inform the compositor thread if it is able to handle
......
......@@ -53,6 +53,7 @@ include_rules = [
"+cc/paint/paint_worklet_input.h",
"+cc/trees/browser_controls_params.h",
"+cc/trees/paint_holding_commit_trigger.h",
"+cc/trees/layer_tree_host.h",
"+components/performance_manager/public/mojom/coordination_unit.mojom-blink.h",
"+gpu/config/gpu_feature_info.h",
"-inspector/v8",
......@@ -119,6 +120,9 @@ specific_include_rules = {
"+url/url_util.h"
],
"data_object_item.cc" : [ "+ui/gfx/codec" ],
"chrome_client.h" : [
"+components/viz/common/surfaces/frame_sink_id.h",
],
"clipboard_utilities.cc" : [ "+net/base/escape.h" ],
"find_in_page.cc" : [
"+third_party/blink/renderer/core/frame/web_local_frame_impl.h",
......
......@@ -4,6 +4,7 @@
#include "third_party/blink/renderer/core/events/pointer_event_factory.h"
#include "third_party/blink/public/platform/web_screen_info.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_pointer_event_init.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame_view.h"
......
......@@ -37,6 +37,7 @@
#include "cc/input/main_thread_scrolling_reason.h"
#include "cc/layers/picture_layer.h"
#include "cc/tiles/frame_viewer_instrumentation.h"
#include "cc/trees/layer_tree_host.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/mojom/scroll/scroll_into_view_params.mojom-blink.h"
#include "third_party/blink/public/mojom/scroll/scrollbar_mode.mojom-blink.h"
......
......@@ -7,6 +7,7 @@
#include "build/build_config.h"
#include "third_party/blink/public/mojom/input/focus_type.mojom-blink.h"
#include "third_party/blink/public/platform/task_type.h"
#include "third_party/blink/public/platform/web_screen_info.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_drag_event_init.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_pointer_event_init.h"
#include "third_party/blink/renderer/core/clipboard/data_object.h"
......
......@@ -36,6 +36,7 @@
#include "base/stl_util.h"
#include "cc/base/region.h"
#include "cc/layers/picture_layer.h"
#include "cc/trees/layer_tree_host.h"
#include "cc/trees/transform_node.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/dom_node_ids.h"
......
......@@ -6,6 +6,7 @@
#include "cc/layers/heads_up_display_layer.h"
#include "cc/layers/picture_layer.h"
#include "cc/trees/layer_tree_host.h"
#include "third_party/blink/public/common/input/web_pointer_event.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
......
......@@ -28,15 +28,18 @@
#include "base/gtest_prod_util.h"
#include "base/optional.h"
#include "cc/input/event_listener_properties.h"
#include "cc/input/layer_selection_bound.h"
#include "cc/input/overscroll_behavior.h"
#include "cc/trees/paint_holding_commit_trigger.h"
#include "components/viz/common/surfaces/frame_sink_id.h"
#include "third_party/blink/public/common/dom_storage/session_storage_namespace_id.h"
#include "third_party/blink/public/common/feature_policy/feature_policy.h"
#include "third_party/blink/public/mojom/devtools/console_message.mojom-blink-forward.h"
#include "third_party/blink/public/mojom/input/focus_type.mojom-blink-forward.h"
#include "third_party/blink/public/platform/blame_context.h"
#include "third_party/blink/public/platform/web_drag_operation.h"
#include "third_party/blink/public/web/web_widget_client.h"
#include "third_party/blink/public/platform/web_float_rect.h"
#include "third_party/blink/public/web/web_swap_result.h"
#include "third_party/blink/renderer/core/accessibility/ax_object_cache.h"
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/frame/sandbox_flags.h"
......@@ -457,8 +460,7 @@ class CORE_EXPORT ChromeClient : public GarbageCollected<ChromeClient> {
// |frame| is submitted (still called "swapped") to the display compositor
// (either with DidSwap or DidNotSwap).
using ReportTimeCallback =
WTF::CrossThreadOnceFunction<void(WebWidgetClient::SwapResult,
base::TimeTicks)>;
WTF::CrossThreadOnceFunction<void(WebSwapResult, base::TimeTicks)>;
virtual void NotifySwapTime(LocalFrame& frame, ReportTimeCallback callback) {}
virtual void FallbackCursorModeLockCursor(LocalFrame* frame,
......
......@@ -151,16 +151,15 @@ void FirstMeaningfulPaintDetector::RegisterNotifySwapTime(PaintEvent event) {
WrapCrossThreadWeakPersistent(this), event));
}
void FirstMeaningfulPaintDetector::ReportSwapTime(
PaintEvent event,
WebWidgetClient::SwapResult result,
base::TimeTicks timestamp) {
void FirstMeaningfulPaintDetector::ReportSwapTime(PaintEvent event,
WebSwapResult result,
base::TimeTicks timestamp) {
DCHECK(event == PaintEvent::kProvisionalFirstMeaningfulPaint);
DCHECK_GT(outstanding_swap_promise_count_, 0U);
--outstanding_swap_promise_count_;
// If the swap fails for any reason, we use the timestamp when the SwapPromise
// was broken. |result| == WebWidgetClient::SwapResult::kDidNotSwapSwapFails
// was broken. |result| == WebSwapResult::kDidNotSwapSwapFails
// usually means the compositor decided not swap because there was no actual
// damage, which can happen when what's being painted isn't visible. In this
// case, the timestamp will be consistent with the case where the swap
......
......@@ -6,7 +6,7 @@
#define THIRD_PARTY_BLINK_RENDERER_CORE_PAINT_FIRST_MEANINGFUL_PAINT_DETECTOR_H_
#include "base/macros.h"
#include "third_party/blink/public/web/web_widget_client.h"
#include "third_party/blink/public/web/web_swap_result.h"
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/paint/paint_event.h"
#include "third_party/blink/renderer/platform/heap/handle.h"
......@@ -39,7 +39,7 @@ class CORE_EXPORT FirstMeaningfulPaintDetector
int visible_height);
void NotifyInputEvent();
void NotifyPaint();
void ReportSwapTime(PaintEvent, WebWidgetClient::SwapResult, base::TimeTicks);
void ReportSwapTime(PaintEvent, WebSwapResult, base::TimeTicks);
void NotifyFirstContentfulPaint(base::TimeTicks swap_stamp);
void OnNetwork2Quiet();
......
......@@ -62,15 +62,14 @@ class FirstMeaningfulPaintDetectorTest : public PageTestBase {
void ClearFirstPaintSwapPromise() {
platform()->AdvanceClock(base::TimeDelta::FromMilliseconds(1));
GetPaintTiming().ReportSwapTime(
PaintEvent::kFirstPaint, WebWidgetClient::SwapResult::kDidSwap, Now());
GetPaintTiming().ReportSwapTime(PaintEvent::kFirstPaint,
WebSwapResult::kDidSwap, Now());
}
void ClearFirstContentfulPaintSwapPromise() {
platform()->AdvanceClock(base::TimeDelta::FromMilliseconds(1));
GetPaintTiming().ReportSwapTime(PaintEvent::kFirstContentfulPaint,
WebWidgetClient::SwapResult::kDidSwap,
Now());
WebSwapResult::kDidSwap, Now());
}
void ClearProvisionalFirstMeaningfulPaintSwapPromise() {
......@@ -81,7 +80,7 @@ class FirstMeaningfulPaintDetectorTest : public PageTestBase {
void ClearProvisionalFirstMeaningfulPaintSwapPromise(
base::TimeTicks timestamp) {
Detector().ReportSwapTime(PaintEvent::kProvisionalFirstMeaningfulPaint,
WebWidgetClient::SwapResult::kDidSwap, timestamp);
WebSwapResult::kDidSwap, timestamp);
}
unsigned OutstandingDetectorSwapPromiseCount() {
......
......@@ -239,7 +239,7 @@ void ImageElementTiming::NotifyBackgroundImagePainted(
}
}
void ImageElementTiming::ReportImagePaintSwapTime(WebWidgetClient::SwapResult,
void ImageElementTiming::ReportImagePaintSwapTime(WebSwapResult,
base::TimeTicks timestamp) {
WindowPerformance* performance =
DOMWindowPerformance::performance(*GetSupplementable());
......
......@@ -7,7 +7,7 @@
#include <utility>
#include "third_party/blink/public/web/web_widget_client.h"
#include "third_party/blink/public/web/web_swap_result.h"
#include "third_party/blink/renderer/core/dom/element.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/platform/heap/heap_allocator.h"
......@@ -77,8 +77,7 @@ class CORE_EXPORT ImageElementTiming final
const IntRect* image_border);
// Callback for the swap promise. Reports paint timestamps.
void ReportImagePaintSwapTime(WebWidgetClient::SwapResult,
base::TimeTicks timestamp);
void ReportImagePaintSwapTime(WebSwapResult, base::TimeTicks timestamp);
// Class containing information about image element timing.
class ElementTimingInfo final : public GarbageCollected<ElementTimingInfo> {
......
......@@ -190,11 +190,11 @@ void PaintTiming::RegisterNotifySwapTime(PaintEvent event,
}
void PaintTiming::ReportSwapTime(PaintEvent event,
WebWidgetClient::SwapResult result,
WebSwapResult result,
base::TimeTicks timestamp) {
DCHECK(IsMainThread());
// If the swap fails for any reason, we use the timestamp when the SwapPromise
// was broken. |result| == WebWidgetClient::SwapResult::kDidNotSwapSwapFails
// was broken. |result| == WebSwapResult::kDidNotSwapSwapFails
// usually means the compositor decided not swap because there was no actual
// damage, which can happen when what's being painted isn't visible. In this
// case, the timestamp will be consistent with the case where the swap
......@@ -256,12 +256,12 @@ void PaintTiming::SetFirstImagePaintSwap(base::TimeTicks stamp) {
NotifyPaintTimingChanged();
}
void PaintTiming::ReportSwapResultHistogram(
WebWidgetClient::SwapResult result) {
DEFINE_STATIC_LOCAL(EnumerationHistogram, did_swap_histogram,
("PageLoad.Internal.Renderer.PaintTiming.SwapResult",
WebWidgetClient::SwapResult::kSwapResultMax));
did_swap_histogram.Count(result);
void PaintTiming::ReportSwapResultHistogram(WebSwapResult result) {
DEFINE_STATIC_LOCAL(
EnumerationHistogram, did_swap_histogram,
("PageLoad.Internal.Renderer.PaintTiming.SwapResult",
static_cast<uint32_t>(WebSwapResult::kSwapResultLast) + 1));
did_swap_histogram.Count(static_cast<uint32_t>(result));
}
} // namespace blink
......@@ -8,7 +8,7 @@
#include <memory>
#include "base/macros.h"
#include "third_party/blink/public/web/web_widget_client.h"
#include "third_party/blink/public/web/web_swap_result.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/paint/first_meaningful_paint_detector.h"
#include "third_party/blink/renderer/core/paint/paint_event.h"
......@@ -31,8 +31,7 @@ class CORE_EXPORT PaintTiming final : public GarbageCollected<PaintTiming>,
USING_GARBAGE_COLLECTED_MIXIN(PaintTiming);
friend class FirstMeaningfulPaintDetector;
using ReportTimeCallback =
WTF::CrossThreadOnceFunction<void(WebWidgetClient::SwapResult,
base::TimeTicks)>;
WTF::CrossThreadOnceFunction<void(WebSwapResult, base::TimeTicks)>;
public:
static const char kSupplementName[];
......@@ -99,11 +98,9 @@ class CORE_EXPORT PaintTiming final : public GarbageCollected<PaintTiming>,
}
void RegisterNotifySwapTime(PaintEvent, ReportTimeCallback);
void ReportSwapTime(PaintEvent,
WebWidgetClient::SwapResult,
base::TimeTicks timestamp);
void ReportSwapTime(PaintEvent, WebSwapResult, base::TimeTicks timestamp);
void ReportSwapResultHistogram(WebWidgetClient::SwapResult);
void ReportSwapResultHistogram(WebSwapResult);
// The caller owns the |clock| which must outlive the PaintTiming.
void SetTickClockForTesting(const base::TickClock* clock);
......
......@@ -410,7 +410,7 @@ void PaintTimingCallbackManagerImpl::
void PaintTimingCallbackManagerImpl::ReportPaintTime(
std::unique_ptr<PaintTimingCallbackManager::CallbackQueue> frame_callbacks,
WebWidgetClient::SwapResult result,
WebSwapResult result,
base::TimeTicks paint_time) {
while (!frame_callbacks->empty()) {
std::move(frame_callbacks->front()).Run(paint_time);
......
......@@ -6,7 +6,7 @@
#define THIRD_PARTY_BLINK_RENDERER_CORE_PAINT_PAINT_TIMING_DETECTOR_H_
#include "third_party/blink/public/common/input/web_input_event.h"
#include "third_party/blink/public/web/web_widget_client.h"
#include "third_party/blink/public/web/web_swap_result.h"
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/layout/layout_box_model_object.h"
#include "third_party/blink/renderer/core/paint/paint_timing_visualizer.h"
......@@ -86,7 +86,7 @@ class PaintTimingCallbackManagerImpl final
void ReportPaintTime(
std::unique_ptr<std::queue<
PaintTimingCallbackManager::LocalThreadCallback>> frame_callbacks,
WebWidgetClient::SwapResult,
WebSwapResult,
base::TimeTicks paint_time);
void Trace(Visitor* visitor) override;
......
......@@ -358,7 +358,7 @@ void WindowPerformance::RegisterEventTiming(const AtomicString& event_type,
}
}
void WindowPerformance::ReportEventTimings(WebWidgetClient::SwapResult result,
void WindowPerformance::ReportEventTimings(WebSwapResult result,
base::TimeTicks timestamp) {
DOMHighResTimeStamp end_time = MonotonicTimeToDOMHighResTimeStamp(timestamp);
bool event_timing_enabled =
......
......@@ -32,7 +32,7 @@
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_TIMING_WINDOW_PERFORMANCE_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_TIMING_WINDOW_PERFORMANCE_H_
#include "third_party/blink/public/web/web_widget_client.h"
#include "third_party/blink/public/web/web_swap_result.h"
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/execution_context/execution_context_lifecycle_observer.h"
#include "third_party/blink/renderer/core/frame/performance_monitor.h"
......@@ -113,8 +113,7 @@ class CORE_EXPORT WindowPerformance final : public Performance,
// Method called once swap promise is resolved. It will add all event timings
// that have not been added since the last swap promise.
void ReportEventTimings(WebWidgetClient::SwapResult result,
base::TimeTicks timestamp);
void ReportEventTimings(WebSwapResult result, base::TimeTicks timestamp);
void DispatchFirstInputTiming(PerformanceEventTiming* entry);
......
......@@ -61,8 +61,7 @@ class WindowPerformanceTest : public testing::Test {
}
void SimulateSwapPromise(base::TimeTicks timestamp) {
performance_->ReportEventTimings(WebWidgetClient::SwapResult::kDidSwap,
timestamp);
performance_->ReportEventTimings(WebSwapResult::kDidSwap, timestamp);
}
LocalFrame* GetFrame() const { return &page_holder_->GetFrame(); }
......
......@@ -17,6 +17,7 @@
#include "third_party/blink/public/mojom/worker/dedicated_worker_host_factory.mojom-blink.h"
#include "third_party/blink/public/platform/web_content_settings_client.h"
#include "third_party/blink/public/platform/web_fetch_client_settings_object.h"
#include "third_party/blink/public/web/web_widget_client.h"
#include "third_party/blink/renderer/bindings/core/v8/serialization/post_message_helper.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_post_message_options.h"
#include "third_party/blink/renderer/core/dom/document.h"
......
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