#include "cc/trees/proxy_main.h"
#include <algorithm>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "base/functional/bind.h"
#include "base/metrics/histogram_macros.h"
#include "base/notreached.h"
#include "base/synchronization/waitable_event.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/traced_value.h"
#include "base/types/optional_ref.h"
#include "cc/base/completion_event.h"
#include "cc/base/devtools_instrumentation.h"
#include "cc/base/features.h"
#include "cc/benchmarks/benchmark_instrumentation.h"
#include "cc/input/browser_controls_offset_tags_info.h"
#include "cc/paint/paint_worklet_layer_painter.h"
#include "cc/resources/ui_resource_manager.h"
#include "cc/trees/latency_info_swap_promise.h"
#include "cc/trees/layer_tree_frame_sink.h"
#include "cc/trees/layer_tree_host.h"
#include "cc/trees/mutator_host.h"
#include "cc/trees/paint_holding_reason.h"
#include "cc/trees/proxy_impl.h"
#include "cc/trees/render_frame_metadata_observer.h"
#include "cc/trees/scoped_abort_remaining_swap_promises.h"
#include "cc/trees/swap_promise.h"
#include "services/metrics/public/cpp/ukm_recorder.h"
namespace cc {
ProxyMain::ProxyMain(LayerTreeHost* layer_tree_host,
TaskRunnerProvider* task_runner_provider)
: … { … }
ProxyMain::~ProxyMain() { … }
void ProxyMain::InitializeOnImplThread(
CompletionEvent* completion_event,
int id,
const LayerTreeSettings* settings,
RenderingStatsInstrumentation* rendering_stats_instrumentation) { … }
void ProxyMain::DestroyProxyImplOnImplThread(
CompletionEvent* completion_event) { … }
void ProxyMain::BeginMainFrameNotExpectedSoon() { … }
void ProxyMain::BeginMainFrameNotExpectedUntil(base::TimeTicks time) { … }
void ProxyMain::DidCommitAndDrawFrame(int source_frame_number) { … }
void ProxyMain::DidLoseLayerTreeFrameSink() { … }
void ProxyMain::RequestNewLayerTreeFrameSink() { … }
void ProxyMain::DidInitializeLayerTreeFrameSink(bool success) { … }
void ProxyMain::DidCompletePageScaleAnimation() { … }
void ProxyMain::BeginMainFrame(
std::unique_ptr<BeginMainFrameAndCommitState> begin_main_frame_state) { … }
void ProxyMain::DidCompleteCommit(int source_frame_number,
CommitTimestamps commit_timestamps) { … }
void ProxyMain::DidPresentCompositorFrame(
uint32_t frame_token,
std::vector<PresentationTimeCallbackBuffer::Callback>
presentation_callbacks,
std::vector<PresentationTimeCallbackBuffer::SuccessfulCallbackWithDetails>
sucessful_presentation_callbacks,
const viz::FrameTimingDetails& frame_timing_details) { … }
void ProxyMain::NotifyThroughputTrackerResults(CustomTrackerResults results) { … }
void ProxyMain::DidObserveFirstScrollDelay(
int source_frame_number,
base::TimeDelta first_scroll_delay,
base::TimeTicks first_scroll_timestamp) { … }
void ProxyMain::NotifyImageDecodeRequestFinished(int request_id,
bool decode_succeeded) { … }
void ProxyMain::NotifyTransitionRequestFinished(uint32_t sequence_id) { … }
bool ProxyMain::IsStarted() const { … }
void ProxyMain::SetLayerTreeFrameSink(
LayerTreeFrameSink* layer_tree_frame_sink) { … }
void ProxyMain::SetVisible(bool visible) { … }
void ProxyMain::SetShouldWarmUp() { … }
void ProxyMain::SetNeedsAnimate() { … }
void ProxyMain::SetNeedsUpdateLayers() { … }
void ProxyMain::SetNeedsCommit() { … }
void ProxyMain::SetNeedsRedraw(const gfx::Rect& damage_rect) { … }
void ProxyMain::SetTargetLocalSurfaceId(
const viz::LocalSurfaceId& target_local_surface_id) { … }
void ProxyMain::DetachInputDelegateAndRenderFrameObserver() { … }
bool ProxyMain::RequestedAnimatePending() { … }
void ProxyMain::SetDeferMainFrameUpdate(bool defer_main_frame_update) { … }
void ProxyMain::SetPauseRendering(bool pause_rendering) { … }
void ProxyMain::SetInputResponsePending() { … }
bool ProxyMain::StartDeferringCommits(base::TimeDelta timeout,
PaintHoldingReason reason) { … }
void ProxyMain::StopDeferringCommits(PaintHoldingCommitTrigger trigger) { … }
bool ProxyMain::IsDeferringCommits() const { … }
bool ProxyMain::CommitRequested() const { … }
void ProxyMain::Start() { … }
void ProxyMain::Stop() { … }
void ProxyMain::QueueImageDecode(int request_id, const PaintImage& image) { … }
void ProxyMain::SetMutator(std::unique_ptr<LayerTreeMutator> mutator) { … }
void ProxyMain::SetPaintWorkletLayerPainter(
std::unique_ptr<PaintWorkletLayerPainter> painter) { … }
bool ProxyMain::MainFrameWillHappenForTesting() { … }
void ProxyMain::ReleaseLayerTreeFrameSink() { … }
void ProxyMain::UpdateBrowserControlsState(
BrowserControlsState constraints,
BrowserControlsState current,
bool animate,
base::optional_ref<const BrowserControlsOffsetTagsInfo> offset_tags_info) { … }
void ProxyMain::RequestBeginMainFrameNotExpected(bool new_state) { … }
bool ProxyMain::SendCommitRequestToImplThreadIfNeeded(
CommitPipelineStage required_stage) { … }
bool ProxyMain::IsMainThread() const { … }
bool ProxyMain::IsImplThread() const { … }
base::SingleThreadTaskRunner* ProxyMain::ImplThreadTaskRunner() { … }
void ProxyMain::SetSourceURL(ukm::SourceId source_id, const GURL& url) { … }
void ProxyMain::SetUkmSmoothnessDestination(
base::WritableSharedMemoryMapping ukm_smoothness_data) { … }
void ProxyMain::SetRenderFrameObserver(
std::unique_ptr<RenderFrameMetadataObserver> observer) { … }
void ProxyMain::CompositeImmediatelyForTest(base::TimeTicks frame_begin_time,
bool raster,
base::OnceClosure callback) { … }
double ProxyMain::GetPercentDroppedFrames() const { … }
}