| Index: components/latency_tracker/latency_tracker.h
|
| diff --git a/components/latency_tracker/latency_tracker.h b/components/latency_tracker/latency_tracker.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..3d94047d3aea12c82acc61ab2963c8569c7dbe5d
|
| --- /dev/null
|
| +++ b/components/latency_tracker/latency_tracker.h
|
| @@ -0,0 +1,52 @@
|
| +// Copyright 2017 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 COMPONENTS_LATENCY_TRACKER_LATENCY_TRACKER_H_
|
| +#define COMPONENTS_LATENCY_TRACKER_LATENCY_TRACKER_H_
|
| +
|
| +#include <stdint.h>
|
| +
|
| +#include <vector>
|
| +
|
| +#include "base/macros.h"
|
| +//#include "content/browser/renderer_host/event_with_latency_info.h"
|
| +//#include "content/common/content_export.h"
|
| +//#include "content/common/input/input_event_ack_state.h"
|
| +#include "ui/events/latency_info.h"
|
| +
|
| +namespace latency_tracker {
|
| +
|
| +//class RenderWidgetHostDelegate;
|
| +
|
| +// Utility class for tracking the latency of events passing through
|
| +//// a given RenderWidgetHost.
|
| +class LatencyTracker {
|
| + public:
|
| + LatencyTracker() = default;
|
| + ~LatencyTracker() = default;
|
| +
|
| + // Terminates latency tracking for events that triggered rendering, also
|
| + // performing relevant UMA latency reporting.
|
| + // Called when the RenderWidgetHost receives a swap update from the GPU.
|
| + void OnGpuSwapBufersCompleted(const ui::LatencyInfo& latency,
|
| + bool is_running_navigation_hint_task);
|
| +
|
| + protected:
|
| + virtual void ReportRapporScrollLatency(
|
| + const std::string& name,
|
| + const ui::LatencyInfo::LatencyComponent& start_component,
|
| + const ui::LatencyInfo::LatencyComponent& end_component);
|
| +
|
| + private:
|
| + void ComputeTouchAndWheelScrollLatencyHistograms(
|
| + const ui::LatencyInfo::LatencyComponent& gpu_swap_begin_component,
|
| + const ui::LatencyInfo::LatencyComponent& gpu_swap_end_component,
|
| + const ui::LatencyInfo& latency);
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(LatencyTracker);
|
| +};
|
| +
|
| +} // namespace latency_tracker
|
| +
|
| +#endif // COMPONENTS_LATENCY_TRACKER_LATENCY_TRACKER_H_
|
|
|