#include "third_party/blink/renderer/modules/sensor/testing/internals_sensor.h"
#include <utility>
#include "base/types/expected.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "services/device/public/cpp/generic_sensor/orientation_util.h"
#include "services/device/public/mojom/sensor.mojom-blink.h"
#include "services/device/public/mojom/sensor_provider.mojom-blink.h"
#include "third_party/blink/public/mojom/sensor/web_sensor_provider_automation.mojom-blink.h"
#include "third_party/blink/public/platform/browser_interface_broker_proxy.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/script_value.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_throw_dom_exception.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_create_virtual_sensor_options.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_virtual_sensor_information.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_virtual_sensor_reading.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_virtual_sensor_type.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/platform/bindings/script_state.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
namespace blink {
namespace {
device::mojom::blink::SensorType ToMojoSensorType(
V8VirtualSensorType::Enum type) { … }
device::mojom::blink::VirtualSensorMetadataPtr ToMojoSensorMetadata(
CreateVirtualSensorOptions* options) { … }
base::expected<device::mojom::blink::SensorReadingRawPtr, String>
ToMojoRawReading(V8VirtualSensorType::Enum type,
VirtualSensorReading* reading) { … }
}
ScriptPromise<IDLUndefined> InternalsSensor::createVirtualSensor(
ScriptState* script_state,
Internals&,
V8VirtualSensorType type,
CreateVirtualSensorOptions* options) { … }
ScriptPromise<IDLUndefined> InternalsSensor::updateVirtualSensor(
ScriptState* script_state,
Internals&,
V8VirtualSensorType type,
VirtualSensorReading* reading) { … }
ScriptPromise<IDLUndefined> InternalsSensor::removeVirtualSensor(
ScriptState* script_state,
Internals&,
V8VirtualSensorType type) { … }
ScriptPromise<VirtualSensorInformation>
InternalsSensor::getVirtualSensorInformation(ScriptState* script_state,
Internals&,
V8VirtualSensorType type) { … }
}