chromium/third_party/blink/renderer/modules/compute_pressure/pressure_client_impl.h

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

#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_COMPUTE_PRESSURE_PRESSURE_CLIENT_IMPL_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_COMPUTE_PRESSURE_PRESSURE_CLIENT_IMPL_H_

#include "base/time/time.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "services/device/public/mojom/pressure_manager.mojom-blink-forward.h"
#include "services/device/public/mojom/pressure_update.mojom-blink-forward.h"
#include "third_party/blink/renderer/core/dom/dom_high_res_time_stamp.h"
#include "third_party/blink/renderer/core/execution_context/execution_context_lifecycle_observer.h"
#include "third_party/blink/renderer/modules/compute_pressure/pressure_observer.h"
#include "third_party/blink/renderer/modules/modules_export.h"
#include "third_party/blink/renderer/platform/heap/collection_support/heap_hash_set.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/mojo/heap_mojo_receiver.h"

namespace blink {

class ExecutionContext;
class PressureObserverManager;

// This class implements the "device::mojom::blink::PressureClient"
// interface to receive "device::mojom::blink::PressureUpdate" from
// "content::PressureClientImpl" and broadcasts the information to active
// PressureObservers.
//
// This class keeps track of State and active PressureObservers per source type.
class MODULES_EXPORT PressureClientImpl final
    : public GarbageCollected<PressureClientImpl>,
      public ExecutionContextClient,
      public device::mojom::blink::PressureClient {};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_MODULES_COMPUTE_PRESSURE_PRESSURE_CLIENT_IMPL_H_