chromium/third_party/blink/renderer/modules/imagecapture/image_capture.cc

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

#include "third_party/blink/renderer/modules/imagecapture/image_capture.h"

#include <algorithm>
#include <utility>

#include "base/containers/contains.h"
#include "base/functional/callback_helpers.h"
#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
#include "base/types/strong_alias.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "third_party/blink/public/mojom/permissions/permission_status.mojom-blink.h"
#include "third_party/blink/public/platform/browser_interface_broker_proxy.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/renderer/bindings/core/v8/callback_promise_adapter.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_union_string_stringsequence.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_constrain_boolean_parameters.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_constrain_dom_string_parameters.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_constrain_double_range.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_constrain_point_2d_parameters.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_fill_light_mode.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_media_settings_range.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_media_track_capabilities.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_media_track_constraints.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_media_track_settings.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_photo_capabilities.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_photo_settings.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_point_2d.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_union_boolean_constrainbooleanparameters.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_union_boolean_constraindoublerange_double.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_union_constraindomstringparameters_string_stringsequence.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_union_constraindoublerange_double.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_union_constrainpoint2dparameters_point2dsequence.h"
#include "third_party/blink/renderer/core/dom/dom_exception.h"
#include "third_party/blink/renderer/core/fileapi/blob.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/imagebitmap/image_bitmap.h"
#include "third_party/blink/renderer/modules/imagecapture/image_capture_frame_grabber.h"
#include "third_party/blink/renderer/modules/mediastream/media_stream_track.h"
#include "third_party/blink/renderer/modules/mediastream/media_stream_video_track.h"
#include "third_party/blink/renderer/modules/mediastream/overconstrained_error.h"
#include "third_party/blink/renderer/modules/permissions/permission_utils.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/heap/persistent.h"
#include "third_party/blink/renderer/platform/instrumentation/use_counter.h"
#include "third_party/blink/renderer/platform/mediastream/media_stream_component.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"

namespace blink {

enum class ImageCapture::MediaTrackConstraintSetType {};

namespace {

BackgroundBlurMode;
EyeGazeCorrectionMode;
FillLightMode;
MeteringMode;
RedEyeReduction;

MediaTrackConstraintSetType;

const char kNoServiceError[] =;

const char kInvalidStateTrackError[] =;

// This adapter simplifies iteration over all basic and advanced
// MediaTrackConstraintSets in a MediaTrackConstraints.
// A MediaTrackConstraints is itself a (basic) MediaTrackConstraintSet and it
// may contain advanced MediaTrackConstraintSets.
class AllConstraintSets {};

CopyPanTiltZoom;

template <typename T>
void CopyCommonMembers(const T* source,
                       T* destination,
                       CopyPanTiltZoom copy_pan_tilt_zoom) {}

void CopyCapabilities(const MediaTrackCapabilities* source,
                      MediaTrackCapabilities* destination,
                      CopyPanTiltZoom copy_pan_tilt_zoom) {}

void CopyConstraintSet(const MediaTrackConstraintSet* source,
                       MediaTrackConstraintSet* destination) {}

void CopyConstraints(const MediaTrackConstraints* source,
                     MediaTrackConstraints* destination) {}

void CopySettings(const MediaTrackSettings* source,
                  MediaTrackSettings* destination,
                  CopyPanTiltZoom copy_pan_tilt_zoom) {}

MediaSettingsRange* DuplicateRange(const MediaSettingsRange* range) {}

// TODO(crbug.com/708723): Integrate image capture constraints processing with
// the main implementation and remove this support enum.
enum class ConstraintType {};

bool IsEmptySequence(bool /*constraint*/) {}

bool IsEmptySequence(const HeapVector<Member<Point2D>>& constraint) {}

bool IsEmptySequence(const V8UnionStringOrStringSequence* constraint) {}

template <typename Constraint>
ConstraintType GetConstraintType(const Constraint* constraint) {}

ConstraintType GetConstraintType(const ConstrainDoubleRange* constraint) {}

ConstraintType GetConstraintType(
    const V8UnionBooleanOrConstrainBooleanParameters* constraint) {}

ConstraintType GetConstraintType(
    const V8UnionBooleanOrConstrainDoubleRangeOrDouble* constraint) {}

ConstraintType GetConstraintType(
    const V8UnionConstrainDOMStringParametersOrStringOrStringSequence*
        constraint) {}

ConstraintType GetConstraintType(
    const V8UnionConstrainDoubleRangeOrDouble* constraint) {}

ConstraintType GetConstraintType(
    const V8UnionConstrainPoint2DParametersOrPoint2DSequence* constraint) {}

MediaTrackConstraintSetType GetMediaTrackConstraintSetType(
    const MediaTrackConstraintSet* constraint_set,
    const MediaTrackConstraints* constraints) {}

bool IsBareValueToBeTreatedAsExact(
    MediaTrackConstraintSetType constraint_set_type) {}

bool IsBooleanFalseConstraint(
    V8UnionBooleanOrConstrainDoubleRangeOrDouble* constraint) {}

// Check if a constraint is to be considered here as a value constraint.
// Here we consider a constraint to be a value constraint only if it depends on
// capability values (and not just the existence of the capability) whether
// the capability satisfies the constraint.
bool IsValueConstraintType(ConstraintType constraint_type,
                           MediaTrackConstraintSetType constraint_set_type) {}

template <typename Constraint>
bool IsValueConstraint(const Constraint* constraint,
                       MediaTrackConstraintSetType constraint_set_type) {}

bool MayRejectWithOverconstrainedError(
    MediaTrackConstraintSetType constraint_set_type) {}

bool TrackIsInactive(const MediaStreamTrack& track) {}

BackgroundBlurMode ParseBackgroundBlur(bool blink_mode) {}

EyeGazeCorrectionMode ParseEyeGazeCorrection(bool blink_mode) {}

MeteringMode ParseFaceFraming(bool blink_mode) {}

MeteringMode ParseMeteringMode(const String& blink_mode) {}

FillLightMode ParseFillLightMode(const String& blink_mode) {}

bool ToBooleanMode(BackgroundBlurMode mode) {}

bool ToBooleanMode(EyeGazeCorrectionMode mode) {}

WebString ToString(MeteringMode value) {}

V8FillLightMode ToV8FillLightMode(FillLightMode value) {}

WebString ToString(RedEyeReduction value) {}

MediaSettingsRange* ToMediaSettingsRange(
    const media::mojom::blink::Range& range) {}

// Check exact value constraints.
//
// The checks can fail only if the exact value constraint is not satisfied by
// an effective capability (which takes taking into consideration restrictions
// placed by other constraints).
// https://w3c.github.io/mediacapture-main/#dfn-fitness-distance
// Step 2 & More definitions
//
// TODO(crbug.com/708723): Integrate image capture constraints processing with
// the main implementation and remove these support functions.

// For exact `sequence<Point2D>` constraints such as `pointsOfInterest`.
// There is no capability for `pointsOfInterest` in `MediaTrackCapabilities`
// to be used as a storage for an effective capability.
// As a substitute, we use `MediaTrackSettings` and its `pointsOfInterest`
// field to convey restrictions placed by previous exact `pointsOfInterest`
// constraints.
bool CheckExactValueConstraint(
    const HeapVector<Member<Point2D>>* effective_setting,
    const HeapVector<Member<Point2D>>& exact_constraint) {}

// For exact `double` constraints and `MediaSettingsRange` effective
// capabilities such as exposureCompensation, ..., zoom.
bool CheckExactValueConstraint(const MediaSettingsRange* effective_capability,
                               double exact_constraint) {}

// For exact `DOMString` constraints and `sequence<DOMString>` effective
// capabilities such as whiteBalanceMode, exposureMode and focusMode.
bool CheckExactValueConstraint(const Vector<String>& effective_capability,
                               const String& exact_constraint) {}

// For exact `sequence<DOMString>` constraints and `sequence<DOMString>`
// effective capabilities such as whiteBalanceMode, exposureMode and focusMode.
bool CheckExactValueConstraint(const Vector<String>& effective_capability,
                               const Vector<String>& exact_constraints) {}

CapabilityExists;

// Check if the existence of a capability satisfies a constraint.
// The check can fail only if the constraint is mandatory ('exact', 'max' or
// 'min' or a bare value to be treated as exact) and is not an empty sequence
// (which MUST be interpreted as if the constraint were not specified).
// Usually the check fails only if the capability does not exists but in
// the case of pan/tilt/zoom: false constraints in advanced constraint sets (to
// be treated as exact) the check fails only if the capability exists.
//
// TODO(crbug.com/708723): Integrate image capture constraints processing with
// the main implementation and remove these support functions.
bool CheckIfCapabilityExistenceSatisfiesConstraintType(
    ConstraintType constraint_type,
    CapabilityExists capability_exists,
    MediaTrackConstraintSetType constraint_set_type) {}

template <typename Constraint>
bool CheckIfCapabilityExistenceSatisfiesConstraint(
    const Constraint* constraint,
    CapabilityExists capability_exists,
    MediaTrackConstraintSetType constraint_set_type) {}

// Check value constraints.
//
// For value constraints, the checks can fail only if the value constraint is
// mandatory ('exact', 'max' or 'min' or a bare value to be treated as exact),
// not an empty sequence (which MUST be interpreted as if the constraint were
// not specified) and not satisfied by an effective capability (which takes
// taking into consideration restrictions placed by other constraints).
// https://w3c.github.io/mediacapture-main/#dfn-fitness-distance
// Step 2 & More definitions
// https://w3c.github.io/mediacapture-main/#dfn-selectsettings
//
// For non-value constraints, the checks always succeed.
// This is to simplify `CheckMediaTrackConstraintSet()`.
//
// TODO(crbug.com/708723): Integrate image capture constraints processing with
// the main implementation and remove these support functions.

// For `ConstrainPoint2D` constraints such as `pointsOfInterest`.
// There is no capability for `pointsOfInterest` in `MediaTrackCapabilities`
// to be used as a storage for an effective capability.
// As a substitute, we use `MediaTrackSettings` and its `pointsOfInterest`
// field to convey restrictions placed by previous exact `pointsOfInterest`
// constraints.
bool CheckValueConstraint(
    const HeapVector<Member<Point2D>>* effective_setting,
    const V8UnionConstrainPoint2DParametersOrPoint2DSequence* constraint,
    MediaTrackConstraintSetType constraint_set_type) {}

// For `ConstrainDouble` constraints and `MediaSettingsRange` effective
// capabilities such as exposureCompensation, ..., focusDistance.
bool CheckValueConstraint(const MediaSettingsRange* effective_capability,
                          const V8UnionConstrainDoubleRangeOrDouble* constraint,
                          MediaTrackConstraintSetType constraint_set_type) {}

// For `(boolean or ConstrainDouble)` constraints and `MediaSettingsRange`
// effective capabilities such as pan, tilt and zoom.
bool CheckValueConstraint(
    const MediaSettingsRange* effective_capability,
    const V8UnionBooleanOrConstrainDoubleRangeOrDouble* constraint,
    MediaTrackConstraintSetType constraint_set_type) {}

// For `ConstrainBoolean` constraints and `sequence<boolean>` effective
// capabilities such as torch and backgroundBlur.
bool CheckValueConstraint(
    const Vector<bool>& effective_capability,
    const V8UnionBooleanOrConstrainBooleanParameters* constraint,
    MediaTrackConstraintSetType constraint_set_type) {}

// For `ConstrainDOMString` constraints and `sequence<DOMString>` effective
// capabilities such as whiteBalanceMode, exposureMode and focusMode.
bool CheckValueConstraint(
    const Vector<String>& effective_capability,
    const V8UnionConstrainDOMStringParametersOrStringOrStringSequence*
        constraint,
    MediaTrackConstraintSetType constraint_set_type) {}

// Apply exact value constraints to photo settings and return new effective
// capabilities.
//
// Roughly the SelectSettings algorithm steps 3 and 5.
// https://www.w3.org/TR/mediacapture-streams/#dfn-selectsettings
//
// TODO(crbug.com/708723): Integrate image capture constraints processing with
// the main implementation and remove these support functions.

// For exact `boolean` constraints and `sequence<boolean>` effective
// capabilities such as torch and backgroundBlur.
Vector<bool> ApplyExactValueConstraint(bool* has_setting_ptr,
                                       bool* setting_ptr,
                                       const Vector<bool>& effective_capability,
                                       bool exact_constraint) {}

// For exact `double` constraints and `MediaSettingsRange` effective
// capabilities such as exposureCompensation, ..., zoom.
MediaSettingsRange* ApplyExactValueConstraint(
    bool* has_setting_ptr,
    double* setting_ptr,
    const MediaSettingsRange* effective_capability,
    double exact_constraint) {}

// For exact `DOMString` constraints and `sequence<DOMString>` effective
// capabilities such as whiteBalanceMode, exposureMode and focusMode.
Vector<String> ApplyExactValueConstraint(
    bool* has_setting_ptr,
    MeteringMode* setting_ptr,
    const Vector<String>& effective_capability,
    const String& exact_constraint) {}

// For exact `sequence<DOMString>` constraints and `sequence<DOMString>`
// effective capabilities such as whiteBalanceMode, exposureMode and focusMode.
Vector<String> ApplyExactValueConstraint(
    bool* has_setting_ptr,
    MeteringMode* setting_ptr,
    const Vector<String>& effective_capability,
    const Vector<String>& exact_constraints) {}

// Apply ideal value constraints to photo settings and return effective
// capabilities intact (ideal constraints have no effect on effective
// capabilities).
//
// Roughly the SelectSettings algorithm step 3.
// https://www.w3.org/TR/mediacapture-streams/#dfn-selectsettings
//
// TODO(crbug.com/708723): Integrate image capture constraints processing with
// the main implementation and remove these support functions.

// For ideal `boolean` constraints and `sequence<boolean>` effective
// capabilities such as torch and backgroundBlur.
Vector<bool> ApplyIdealValueConstraint(bool* has_setting_ptr,
                                       bool* setting_ptr,
                                       const Vector<bool>& effective_capability,
                                       bool ideal_constraint) {}

// For ideal `double` constraints and `MediaSettingsRange` effective
// capabilities such as exposureCompensation, ..., zoom.
MediaSettingsRange* ApplyIdealValueConstraint(
    bool* has_setting_ptr,
    double* setting_ptr,
    MediaSettingsRange* effective_capability,
    std::optional<double> ideal_constraint,
    double current_setting) {}

// For ideal `DOMString` constraints and `sequence<DOMString>` effective
// capabilities such as whiteBalanceMode, exposureMode and focusMode.
Vector<String> ApplyIdealValueConstraint(
    bool* has_setting_ptr,
    MeteringMode* setting_ptr,
    const Vector<String>& effective_capability,
    const String& ideal_constraint,
    const String& current_setting) {}

// For ideal `sequence<DOMString>` constraints and `sequence<DOMString>`
// effective capabilities such as whiteBalanceMode, exposureMode and focusMode.
Vector<String> ApplyIdealValueConstraint(
    bool* has_setting_ptr,
    MeteringMode* setting_ptr,
    const Vector<String>& effective_capability,
    const Vector<String>& ideal_constraints,
    const String& current_setting) {}

// Apply value constraints to photo settings and return new effective
// capabilities.
//
// Roughly the SelectSettings algorithm steps 3 and 5.
// https://www.w3.org/TR/mediacapture-streams/#dfn-selectsettings
//
// TODO(crbug.com/708723): Integrate image capture constraints processing with
// the main implementation and remove these support functions.

// For `ConstrainBoolean` constraints and `sequence<boolean>` effective
// capabilities such as torch and backgroundBlur.
Vector<bool> ApplyValueConstraint(
    bool* has_setting_ptr,
    bool* setting_ptr,
    const Vector<bool>& effective_capability,
    const V8UnionBooleanOrConstrainBooleanParameters* constraint,
    MediaTrackConstraintSetType constraint_set_type) {}

// For `ConstrainDouble` constraints and `MediaSettingsRange` effective
// capabilities such as exposureCompensation, ..., focusDistance.
MediaSettingsRange* ApplyValueConstraint(
    bool* has_setting_ptr,
    double* setting_ptr,
    const MediaSettingsRange* effective_capability,
    const V8UnionConstrainDoubleRangeOrDouble* constraint,
    MediaTrackConstraintSetType constraint_set_type,
    double current_setting) {}

// For `(boolean or ConstrainDouble)` constraints and `MediaSettingsRange`
// effective capabilities such as pan, tilt and zoom.
MediaSettingsRange* ApplyValueConstraint(
    bool* has_setting_ptr,
    double* setting_ptr,
    const MediaSettingsRange* effective_capability,
    const V8UnionBooleanOrConstrainDoubleRangeOrDouble* constraint,
    MediaTrackConstraintSetType constraint_set_type,
    double current_setting) {}

// For `ConstrainDOMString` constraints and `sequence<DOMString>` effective
// capabilities such as whiteBalanceMode, exposureMode and focusMode.
Vector<String> ApplyValueConstraint(
    bool* has_setting_ptr,
    MeteringMode* setting_ptr,
    const Vector<String>& effective_capability,
    const V8UnionConstrainDOMStringParametersOrStringOrStringSequence*
        constraint,
    MediaTrackConstraintSetType constraint_set_type,
    const String& current_setting) {}

// For `ConstrainPoint2D` constraints such as `pointsOfInterest`.
// There is no capability for `pointsOfInterest` in `MediaTrackCapabilities`
// to be used as a storage for an effective capability.
// As a substitute, we use `MediaTrackSettings` and its `pointsOfInterest`
// field to convey restrictions placed by previous exact `pointsOfInterest`
// constraints.
void ApplyValueConstraint(bool* has_setting_ptr,
                          Vector<media::mojom::blink::Point2DPtr>* setting_ptr,
                          const HeapVector<Member<Point2D>>* effective_setting,
                          const HeapVector<Member<Point2D>>& constraint) {}

// For `ConstrainPoint2D` constraints such as `pointsOfInterest`.
// There is no capability for `pointsOfInterest` in `MediaTrackCapabilities`
// to be used as a storage for an effective capability.
// As a substitute, we use `MediaTrackSettings` and its `pointsOfInterest`
// field to convey restrictions placed by previous exact `pointsOfInterest`
// constraints.
std::optional<HeapVector<Member<Point2D>>> ApplyValueConstraint(
    bool* has_setting_ptr,
    Vector<media::mojom::blink::Point2DPtr>* setting_ptr,
    const HeapVector<Member<Point2D>>* effective_setting,
    const V8UnionConstrainPoint2DParametersOrPoint2DSequence* constraint,
    MediaTrackConstraintSetType constraint_set_type) {}

void MaybeSetBackgroundBlurSetting(bool value,
                                   const Vector<bool>& capability,
                                   bool& has_setting,
                                   BackgroundBlurMode& setting) {}

void MaybeSetBoolSetting(bool value,
                         const Vector<bool>& capability,
                         std::optional<bool>& setting) {}

void MaybeSetBoolSetting(bool value,
                         const Vector<bool>& capability,
                         bool& has_setting,
                         bool& setting) {}

void MaybeSetEyeGazeCorrectionSetting(
    bool value,
    const Vector<bool>& capability,
    std::optional<EyeGazeCorrectionMode>& setting) {}

void MaybeSetFaceFramingSetting(bool value,
                                const Vector<bool>& capability,
                                bool& has_setting,
                                MeteringMode& setting) {}

void MaybeSetDoubleSetting(double value,
                           const MediaSettingsRange& capability,
                           bool& has_setting,
                           double& setting) {}

}  // anonymous namespace

ImageCapture* ImageCapture::Create(ExecutionContext* context,
                                   MediaStreamTrack* track,
                                   ExceptionState& exception_state) {}

ImageCapture::~ImageCapture() {}

void ImageCapture::ContextDestroyed() {}

ScriptPromise<PhotoCapabilities> ImageCapture::getPhotoCapabilities(
    ScriptState* script_state) {}

ScriptPromise<PhotoSettings> ImageCapture::getPhotoSettings(
    ScriptState* script_state) {}

ScriptPromise<Blob> ImageCapture::takePhoto(
    ScriptState* script_state,
    const PhotoSettings* photo_settings) {}

ScriptPromise<ImageBitmap> ImageCapture::grabFrame(ScriptState* script_state) {}

void ImageCapture::UpdateAndCheckMediaTrackSettingsAndCapabilities(
    base::OnceCallback<void(bool)> callback) {}

void ImageCapture::GotPhotoState(
    base::OnceCallback<void(bool)> callback,
    media::mojom::blink::PhotoStatePtr photo_state) {}

bool ImageCapture::CheckAndApplyMediaTrackConstraintsToSettings(
    media::mojom::blink::PhotoSettings* settings,
    const MediaTrackConstraints* constraints,
    ScriptPromiseResolverBase* resolver) const {}

void ImageCapture::GetMediaTrackCapabilities(
    MediaTrackCapabilities* capabilities) const {}

// TODO(mcasas): make the implementation fully Spec compliant, see the TODOs
// inside the method, https://crbug.com/708723.
void ImageCapture::SetMediaTrackConstraints(
    ScriptPromiseResolverBase* resolver,
    const MediaTrackConstraints* constraints) {}

void ImageCapture::SetVideoTrackDeviceSettingsFromTrack(
    base::OnceClosure initialized_callback,
    media::mojom::blink::PhotoStatePtr photo_state) {}

void ImageCapture::OnSetVideoTrackDeviceSettingsFromTrack(
    base::OnceClosure done_callback,
    bool result) {}

MediaTrackConstraints* ImageCapture::GetMediaTrackConstraints() const {}

void ImageCapture::ClearMediaTrackConstraints() {}

void ImageCapture::GetMediaTrackSettings(MediaTrackSettings* settings) const {}

ImageCapture::ImageCapture(ExecutionContext* context,
                           MediaStreamTrack* track,
                           bool pan_tilt_zoom_allowed,
                           base::OnceClosure initialized_callback,
                           base::TimeDelta grab_frame_timeout)
    :{}

// TODO(crbug.com/708723): Integrate image capture constraints processing with
// the main implementation and remove this support function.
void ImageCapture::ApplyMediaTrackConstraintSetToSettings(
    media::mojom::blink::PhotoSettings* settings,
    MediaTrackCapabilities* effective_capabilities,
    MediaTrackSettings* effective_settings,
    const MediaTrackConstraintSet* constraint_set,
    MediaTrackConstraintSetType constraint_set_type) const {}

// TODO(crbug.com/708723): Integrate image capture constraints processing with
// the main implementation and remove this support function.
bool ImageCapture::CheckMediaTrackConstraintSet(
    const MediaTrackCapabilities* effective_capabilities,
    const MediaTrackSettings* effective_settings,
    const MediaTrackConstraintSet* constraint_set,
    MediaTrackConstraintSetType constraint_set_type,
    ScriptPromiseResolverBase* resolver) const {}

void ImageCapture::OnPermissionStatusChange(
    mojom::blink::PermissionStatus status) {}

bool ImageCapture::HasPanTiltZoomPermissionGranted() const {}

void ImageCapture::GetMojoPhotoState(ScriptPromiseResolverBase* resolver,
                                     PromiseResolverFunction resolver_cb) {}

void ImageCapture::OnMojoGetPhotoState(
    ScriptPromiseResolverBase* resolver,
    PromiseResolverFunction resolve_function,
    bool trigger_take_photo,
    media::mojom::blink::PhotoStatePtr photo_state) {}

void ImageCapture::OnMojoSetPhotoOptions(ScriptPromiseResolverBase* resolver,
                                         bool trigger_take_photo,
                                         bool result) {}

void ImageCapture::OnMojoTakePhoto(ScriptPromiseResolverBase* resolver,
                                   media::mojom::blink::BlobPtr blob) {}

void ImageCapture::UpdateMediaTrackSettingsAndCapabilities(
    base::OnceClosure initialized_callback,
    media::mojom::blink::PhotoStatePtr photo_state) {}

void ImageCapture::OnServiceConnectionError() {}

void ImageCapture::MaybeRejectWithOverconstrainedError(
    ScriptPromiseResolverBase* resolver,
    const char* constraint,
    const char* message) const {}

void ImageCapture::ResolveWithNothing(ScriptPromiseResolverBase* resolver) {}

void ImageCapture::ResolveWithPhotoSettings(
    ScriptPromiseResolverBase* resolver) {}

void ImageCapture::ResolveWithPhotoCapabilities(
    ScriptPromiseResolverBase* resolver) {}

bool ImageCapture::IsPageVisible() const {}

const String& ImageCapture::SourceId() const {}

const std::optional<const char*>
ImageCapture::GetConstraintWithCapabilityExistenceMismatch(
    const MediaTrackConstraintSet* constraint_set,
    MediaTrackConstraintSetType constraint_set_type) const {}

ImageCapture* ImageCapture::Clone() const {}

void ImageCapture::Trace(Visitor* visitor) const {}

}  // namespace blink