chromium/components/paint_preview/browser/paint_preview_compositor_client_impl.cc

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/paint_preview/browser/paint_preview_compositor_client_impl.h"

#include <utility>

#include "base/functional/callback.h"
#include "base/task/bind_post_task.h"
#include "base/task/sequenced_task_runner.h"
#include "base/trace_event/common/trace_event_common.h"
#include "base/trace_event/trace_event.h"

namespace paint_preview {

PaintPreviewCompositorClientImpl::PaintPreviewCompositorClientImpl(
    scoped_refptr<base::SequencedTaskRunner> compositor_task_runner,
    base::WeakPtr<PaintPreviewCompositorServiceImpl> service)
    :{}

PaintPreviewCompositorClientImpl::~PaintPreviewCompositorClientImpl() {}

const std::optional<base::UnguessableToken>&
PaintPreviewCompositorClientImpl::Token() const {}

void PaintPreviewCompositorClientImpl::SetDisconnectHandler(
    base::OnceClosure closure) {}

// For the following methods the use of base::Unretained for |compositor_| and
// things |compositor_| owns is safe as:
// 1. |compositor_| is deleted on the |compositor_task_runner_| after other
//    non-delayed tasks in the current sequence are run.
// 2. New tasks cannot be created that reference |compositor_| once it is
//    deleted as its lifetime is tied to that of the
//    PaintPreviewCompositorClient.
//
// NOTE: This is only safe as no delayed tasks are posted and there are no
// cases of base::Unretained(this) or other class members passed as pointers.

void PaintPreviewCompositorClientImpl::BeginSeparatedFrameComposite(
    mojom::PaintPreviewBeginCompositeRequestPtr request,
    mojom::PaintPreviewCompositor::BeginSeparatedFrameCompositeCallback
        callback) {}

void PaintPreviewCompositorClientImpl::BitmapForSeparatedFrame(
    const base::UnguessableToken& frame_guid,
    const gfx::Rect& clip_rect,
    float scale_factor,
    mojom::PaintPreviewCompositor::BitmapForSeparatedFrameCallback callback,
    bool run_callback_on_default_task_runner) {}

void PaintPreviewCompositorClientImpl::BeginMainFrameComposite(
    mojom::PaintPreviewBeginCompositeRequestPtr request,
    mojom::PaintPreviewCompositor::BeginMainFrameCompositeCallback callback) {}

void PaintPreviewCompositorClientImpl::BitmapForMainFrame(
    const gfx::Rect& clip_rect,
    float scale_factor,
    mojom::PaintPreviewCompositor::BitmapForMainFrameCallback callback,
    bool run_callback_on_default_task_runner) {}

void PaintPreviewCompositorClientImpl::SetRootFrameUrl(const GURL& url) {}

void PaintPreviewCompositorClientImpl::IsBoundAndConnected(
    base::OnceCallback<void(bool)> callback) {}

PaintPreviewCompositorClientImpl::OnCompositorCreatedCallback
PaintPreviewCompositorClientImpl::BuildCompositorCreatedCallback(
    base::OnceClosure user_closure,
    OnCompositorCreatedCallback service_callback) {}

void PaintPreviewCompositorClientImpl::OnCompositorCreated(
    base::OnceClosure user_closure,
    OnCompositorCreatedCallback service_callback,
    const base::UnguessableToken& token) {}

void PaintPreviewCompositorClientImpl::NotifyServiceOfInvalidation() {}

void PaintPreviewCompositorClientImpl::DisconnectHandler() {}

}  // namespace paint_preview