#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif
#include "services/device/public/mojom/sensor_provider.mojom.h"
#include <math.h>
#include <stdint.h>
#include <utility>
#include "base/debug/alias.h"
#include "base/hash/md5_constexpr.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/thread_pool/thread_pool_instance.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/typed_macros.h"
#include "mojo/public/cpp/bindings/features.h"
#include "mojo/public/cpp/bindings/lib/default_construct_tag_internal.h"
#include "mojo/public/cpp/bindings/lib/generated_code_util.h"
#include "mojo/public/cpp/bindings/lib/message_internal.h"
#include "mojo/public/cpp/bindings/lib/proxy_to_responder.h"
#include "mojo/public/cpp/bindings/lib/send_message_helper.h"
#include "mojo/public/cpp/bindings/lib/serialization_util.h"
#include "mojo/public/cpp/bindings/lib/unserialized_message_context.h"
#include "mojo/public/cpp/bindings/lib/validate_params.h"
#include "mojo/public/cpp/bindings/lib/validation_errors.h"
#include "mojo/public/cpp/bindings/mojo_buildflags.h"
#include "mojo/public/cpp/bindings/urgent_message_scope.h"
#include "mojo/public/interfaces/bindings/interface_control_messages.mojom.h"
#include "third_party/perfetto/include/perfetto/tracing/traced_value.h"
#include "services/device/public/mojom/sensor_provider.mojom-params-data.h"
#include "services/device/public/mojom/sensor_provider.mojom-shared-message-ids.h"
#include "services/device/public/mojom/sensor_provider.mojom-import-headers.h"
#include "services/device/public/mojom/sensor_provider.mojom-test-utils.h"
namespace device::mojom {
constexpr uint64_t SensorInitParams::kReadBufferSizeForTests;
SensorInitParams::SensorInitParams()
: … { … }
SensorInitParams::SensorInitParams(
::mojo::PendingRemote<::device::mojom::Sensor> sensor_in,
::mojo::PendingReceiver<::device::mojom::SensorClient> client_receiver_in,
::base::ReadOnlySharedMemoryRegion memory_in,
uint64_t buffer_offset_in,
::device::mojom::ReportingMode mode_in,
const ::device::PlatformSensorConfiguration& default_configuration_in,
double maximum_frequency_in,
double minimum_frequency_in)
: … { … }
SensorInitParams::~SensorInitParams() = default;
void SensorInitParams::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool SensorInitParams::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
VirtualSensorMetadata::VirtualSensorMetadata()
: … { … }
VirtualSensorMetadata::VirtualSensorMetadata(
bool available_in,
std::optional<double> maximum_frequency_in,
std::optional<double> minimum_frequency_in,
std::optional<::device::mojom::ReportingMode> reporting_mode_in)
: … { … }
VirtualSensorMetadata::~VirtualSensorMetadata() = default;
void VirtualSensorMetadata::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool VirtualSensorMetadata::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
VirtualSensorInformation::VirtualSensorInformation()
: … { … }
VirtualSensorInformation::VirtualSensorInformation(
double sampling_frequency_in)
: … { … }
VirtualSensorInformation::~VirtualSensorInformation() = default;
size_t VirtualSensorInformation::Hash(size_t seed) const { … }
void VirtualSensorInformation::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool VirtualSensorInformation::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
GetVirtualSensorInformationResult::GetVirtualSensorInformationResult() : … { … }
GetVirtualSensorInformationResult::~GetVirtualSensorInformationResult() { … }
void GetVirtualSensorInformationResult::set_info(
VirtualSensorInformationPtr info) { … }
void GetVirtualSensorInformationResult::set_error(
GetVirtualSensorInformationError error) { … }
void GetVirtualSensorInformationResult::DestroyActive() { … }
size_t GetVirtualSensorInformationResult::Hash(size_t seed) const { … }
bool GetVirtualSensorInformationResult::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
const char SensorProvider::Name_[] = …;
SensorProvider::IPCStableHashFunction SensorProvider::MessageToMethodInfo_(mojo::Message& message) { … }
const char* SensorProvider::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t SensorProvider::GetSensor_Sym::IPCStableHash() { … }
uint32_t SensorProvider::CreateVirtualSensor_Sym::IPCStableHash() { … }
uint32_t SensorProvider::UpdateVirtualSensor_Sym::IPCStableHash() { … }
uint32_t SensorProvider::RemoveVirtualSensor_Sym::IPCStableHash() { … }
uint32_t SensorProvider::GetVirtualSensorInformation_Sym::IPCStableHash() { … }
# endif
class SensorProvider_GetSensor_ForwardToCallback
: public mojo::MessageReceiver { … };
class SensorProvider_CreateVirtualSensor_ForwardToCallback
: public mojo::MessageReceiver { … };
class SensorProvider_UpdateVirtualSensor_ForwardToCallback
: public mojo::MessageReceiver { … };
class SensorProvider_RemoveVirtualSensor_ForwardToCallback
: public mojo::MessageReceiver { … };
class SensorProvider_GetVirtualSensorInformation_ForwardToCallback
: public mojo::MessageReceiver { … };
SensorProviderProxy::SensorProviderProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void SensorProviderProxy::GetSensor(
::device::mojom::SensorType in_type, GetSensorCallback callback) { … }
void SensorProviderProxy::CreateVirtualSensor(
::device::mojom::SensorType in_type, VirtualSensorMetadataPtr in_metadata, CreateVirtualSensorCallback callback) { … }
void SensorProviderProxy::UpdateVirtualSensor(
::device::mojom::SensorType in_type, const ::device::SensorReading& in_reading, UpdateVirtualSensorCallback callback) { … }
void SensorProviderProxy::RemoveVirtualSensor(
::device::mojom::SensorType in_type, RemoveVirtualSensorCallback callback) { … }
void SensorProviderProxy::GetVirtualSensorInformation(
::device::mojom::SensorType in_type, GetVirtualSensorInformationCallback callback) { … }
class SensorProvider_GetSensor_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool SensorProvider_GetSensor_ForwardToCallback::Accept(
mojo::Message* message) { … }
void SensorProvider_GetSensor_ProxyToResponder::Run(
SensorCreationResult in_result, SensorInitParamsPtr in_init_params) { … }
class SensorProvider_CreateVirtualSensor_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool SensorProvider_CreateVirtualSensor_ForwardToCallback::Accept(
mojo::Message* message) { … }
void SensorProvider_CreateVirtualSensor_ProxyToResponder::Run(
CreateVirtualSensorResult in_result) { … }
class SensorProvider_UpdateVirtualSensor_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool SensorProvider_UpdateVirtualSensor_ForwardToCallback::Accept(
mojo::Message* message) { … }
void SensorProvider_UpdateVirtualSensor_ProxyToResponder::Run(
UpdateVirtualSensorResult in_result) { … }
class SensorProvider_RemoveVirtualSensor_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool SensorProvider_RemoveVirtualSensor_ForwardToCallback::Accept(
mojo::Message* message) { … }
void SensorProvider_RemoveVirtualSensor_ProxyToResponder::Run(
) { … }
class SensorProvider_GetVirtualSensorInformation_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool SensorProvider_GetVirtualSensorInformation_ForwardToCallback::Accept(
mojo::Message* message) { … }
void SensorProvider_GetVirtualSensorInformation_ProxyToResponder::Run(
GetVirtualSensorInformationResultPtr in_result) { … }
bool SensorProviderStubDispatch::Accept(
SensorProvider* impl,
mojo::Message* message) { … }
bool SensorProviderStubDispatch::AcceptWithResponder(
SensorProvider* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kSensorProviderValidationInfo[] = …;
bool SensorProviderRequestValidator::Accept(mojo::Message* message) { … }
bool SensorProviderResponseValidator::Accept(mojo::Message* message) { … }
}
namespace mojo {
bool StructTraits<::device::mojom::SensorInitParams::DataView, ::device::mojom::SensorInitParamsPtr>::Read(
::device::mojom::SensorInitParams::DataView input,
::device::mojom::SensorInitParamsPtr* output) { … }
bool StructTraits<::device::mojom::VirtualSensorMetadata::DataView, ::device::mojom::VirtualSensorMetadataPtr>::Read(
::device::mojom::VirtualSensorMetadata::DataView input,
::device::mojom::VirtualSensorMetadataPtr* output) { … }
bool StructTraits<::device::mojom::VirtualSensorInformation::DataView, ::device::mojom::VirtualSensorInformationPtr>::Read(
::device::mojom::VirtualSensorInformation::DataView input,
::device::mojom::VirtualSensorInformationPtr* output) { … }
bool UnionTraits<::device::mojom::GetVirtualSensorInformationResult::DataView, ::device::mojom::GetVirtualSensorInformationResultPtr>::Read(
::device::mojom::GetVirtualSensorInformationResult::DataView input,
::device::mojom::GetVirtualSensorInformationResultPtr* output) { … }
}
namespace device::mojom {
void SensorProviderInterceptorForTesting::GetSensor(::device::mojom::SensorType type, GetSensorCallback callback) { … }
void SensorProviderInterceptorForTesting::CreateVirtualSensor(::device::mojom::SensorType type, VirtualSensorMetadataPtr metadata, CreateVirtualSensorCallback callback) { … }
void SensorProviderInterceptorForTesting::UpdateVirtualSensor(::device::mojom::SensorType type, const ::device::SensorReading& reading, UpdateVirtualSensorCallback callback) { … }
void SensorProviderInterceptorForTesting::RemoveVirtualSensor(::device::mojom::SensorType type, RemoveVirtualSensorCallback callback) { … }
void SensorProviderInterceptorForTesting::GetVirtualSensorInformation(::device::mojom::SensorType type, GetVirtualSensorInformationCallback callback) { … }
SensorProviderAsyncWaiter::SensorProviderAsyncWaiter(
SensorProvider* proxy) : … { … }
SensorProviderAsyncWaiter::~SensorProviderAsyncWaiter() = default;
void SensorProviderAsyncWaiter::GetSensor(
::device::mojom::SensorType type, SensorCreationResult* out_result, SensorInitParamsPtr* out_init_params) { … }
void SensorProviderAsyncWaiter::CreateVirtualSensor(
::device::mojom::SensorType type, VirtualSensorMetadataPtr metadata, CreateVirtualSensorResult* out_result) { … }
CreateVirtualSensorResult SensorProviderAsyncWaiter::CreateVirtualSensor(
::device::mojom::SensorType type, VirtualSensorMetadataPtr metadata) { … }
void SensorProviderAsyncWaiter::UpdateVirtualSensor(
::device::mojom::SensorType type, const ::device::SensorReading& reading, UpdateVirtualSensorResult* out_result) { … }
UpdateVirtualSensorResult SensorProviderAsyncWaiter::UpdateVirtualSensor(
::device::mojom::SensorType type, const ::device::SensorReading& reading) { … }
void SensorProviderAsyncWaiter::RemoveVirtualSensor(
::device::mojom::SensorType type) { … }
void SensorProviderAsyncWaiter::GetVirtualSensorInformation(
::device::mojom::SensorType type, GetVirtualSensorInformationResultPtr* out_result) { … }
GetVirtualSensorInformationResultPtr SensorProviderAsyncWaiter::GetVirtualSensorInformation(
::device::mojom::SensorType type) { … }
}
#if defined(__clang__)
#pragma clang diagnostic pop
#endif