#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif
#include "third_party/blink/public/mojom/serial/serial.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 "third_party/blink/public/mojom/serial/serial.mojom-params-data.h"
#include "third_party/blink/public/mojom/serial/serial.mojom-shared-message-ids.h"
#include "third_party/blink/public/mojom/serial/serial.mojom-import-headers.h"
#include "third_party/blink/public/mojom/serial/serial.mojom-test-utils.h"
namespace blink::mojom {
SerialPortInfo::SerialPortInfo()
: … { … }
SerialPortInfo::SerialPortInfo(
const ::base::UnguessableToken& token_in,
uint16_t usb_vendor_id_in,
bool has_usb_vendor_id_in,
uint16_t usb_product_id_in,
bool has_usb_product_id_in,
const std::optional<::device::BluetoothUUID>& bluetooth_service_class_id_in,
bool connected_in)
: … { … }
SerialPortInfo::~SerialPortInfo() = default;
void SerialPortInfo::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool SerialPortInfo::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
SerialPortFilter::SerialPortFilter()
: … { … }
SerialPortFilter::SerialPortFilter(
uint32_t vendor_id_in,
bool has_vendor_id_in,
uint16_t product_id_in,
bool has_product_id_in,
const std::optional<::device::BluetoothUUID>& bluetooth_service_class_id_in)
: … { … }
SerialPortFilter::~SerialPortFilter() = default;
void SerialPortFilter::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool SerialPortFilter::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
const char SerialService::Name_[] = …;
SerialService::IPCStableHashFunction SerialService::MessageToMethodInfo_(mojo::Message& message) { … }
const char* SerialService::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t SerialService::SetClient_Sym::IPCStableHash() { … }
uint32_t SerialService::GetPorts_Sym::IPCStableHash() { … }
uint32_t SerialService::RequestPort_Sym::IPCStableHash() { … }
uint32_t SerialService::OpenPort_Sym::IPCStableHash() { … }
uint32_t SerialService::ForgetPort_Sym::IPCStableHash() { … }
# endif
class SerialService_GetPorts_ForwardToCallback
: public mojo::MessageReceiver { … };
class SerialService_RequestPort_ForwardToCallback
: public mojo::MessageReceiver { … };
class SerialService_OpenPort_ForwardToCallback
: public mojo::MessageReceiver { … };
class SerialService_ForgetPort_ForwardToCallback
: public mojo::MessageReceiver { … };
SerialServiceProxy::SerialServiceProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void SerialServiceProxy::SetClient(
::mojo::PendingRemote<SerialServiceClient> in_client) { … }
void SerialServiceProxy::GetPorts(
GetPortsCallback callback) { … }
void SerialServiceProxy::RequestPort(
std::vector<SerialPortFilterPtr> in_filters, const std::vector<::device::BluetoothUUID>& in_allowed_bluetooth_service_class_ids, RequestPortCallback callback) { … }
void SerialServiceProxy::OpenPort(
const ::base::UnguessableToken& in_token, ::device::mojom::SerialConnectionOptionsPtr in_options, ::mojo::PendingRemote<::device::mojom::SerialPortClient> in_client, OpenPortCallback callback) { … }
void SerialServiceProxy::ForgetPort(
const ::base::UnguessableToken& in_token, ForgetPortCallback callback) { … }
class SerialService_GetPorts_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool SerialService_GetPorts_ForwardToCallback::Accept(
mojo::Message* message) { … }
void SerialService_GetPorts_ProxyToResponder::Run(
std::vector<SerialPortInfoPtr> in_ports) { … }
class SerialService_RequestPort_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool SerialService_RequestPort_ForwardToCallback::Accept(
mojo::Message* message) { … }
void SerialService_RequestPort_ProxyToResponder::Run(
SerialPortInfoPtr in_port) { … }
class SerialService_OpenPort_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool SerialService_OpenPort_ForwardToCallback::Accept(
mojo::Message* message) { … }
void SerialService_OpenPort_ProxyToResponder::Run(
::mojo::PendingRemote<::device::mojom::SerialPort> in_port) { … }
class SerialService_ForgetPort_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool SerialService_ForgetPort_ForwardToCallback::Accept(
mojo::Message* message) { … }
void SerialService_ForgetPort_ProxyToResponder::Run(
) { … }
bool SerialServiceStubDispatch::Accept(
SerialService* impl,
mojo::Message* message) { … }
bool SerialServiceStubDispatch::AcceptWithResponder(
SerialService* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kSerialServiceValidationInfo[] = …;
bool SerialServiceRequestValidator::Accept(mojo::Message* message) { … }
bool SerialServiceResponseValidator::Accept(mojo::Message* message) { … }
const char SerialServiceClient::Name_[] = …;
SerialServiceClient::IPCStableHashFunction SerialServiceClient::MessageToMethodInfo_(mojo::Message& message) { … }
const char* SerialServiceClient::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t SerialServiceClient::OnPortConnectedStateChanged_Sym::IPCStableHash() { … }
# endif
SerialServiceClientProxy::SerialServiceClientProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void SerialServiceClientProxy::OnPortConnectedStateChanged(
SerialPortInfoPtr in_port_info) { … }
bool SerialServiceClientStubDispatch::Accept(
SerialServiceClient* impl,
mojo::Message* message) { … }
bool SerialServiceClientStubDispatch::AcceptWithResponder(
SerialServiceClient* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kSerialServiceClientValidationInfo[] = …;
bool SerialServiceClientRequestValidator::Accept(mojo::Message* message) { … }
}
namespace mojo {
bool StructTraits<::blink::mojom::SerialPortInfo::DataView, ::blink::mojom::SerialPortInfoPtr>::Read(
::blink::mojom::SerialPortInfo::DataView input,
::blink::mojom::SerialPortInfoPtr* output) { … }
bool StructTraits<::blink::mojom::SerialPortFilter::DataView, ::blink::mojom::SerialPortFilterPtr>::Read(
::blink::mojom::SerialPortFilter::DataView input,
::blink::mojom::SerialPortFilterPtr* output) { … }
}
namespace blink::mojom {
void SerialServiceInterceptorForTesting::SetClient(::mojo::PendingRemote<SerialServiceClient> client) { … }
void SerialServiceInterceptorForTesting::GetPorts(GetPortsCallback callback) { … }
void SerialServiceInterceptorForTesting::RequestPort(std::vector<SerialPortFilterPtr> filters, const std::vector<::device::BluetoothUUID>& allowed_bluetooth_service_class_ids, RequestPortCallback callback) { … }
void SerialServiceInterceptorForTesting::OpenPort(const ::base::UnguessableToken& token, ::device::mojom::SerialConnectionOptionsPtr options, ::mojo::PendingRemote<::device::mojom::SerialPortClient> client, OpenPortCallback callback) { … }
void SerialServiceInterceptorForTesting::ForgetPort(const ::base::UnguessableToken& token, ForgetPortCallback callback) { … }
SerialServiceAsyncWaiter::SerialServiceAsyncWaiter(
SerialService* proxy) : … { … }
SerialServiceAsyncWaiter::~SerialServiceAsyncWaiter() = default;
void SerialServiceAsyncWaiter::GetPorts(
std::vector<SerialPortInfoPtr>* out_ports) { … }
std::vector<SerialPortInfoPtr> SerialServiceAsyncWaiter::GetPorts(
) { … }
void SerialServiceAsyncWaiter::RequestPort(
std::vector<SerialPortFilterPtr> filters, const std::vector<::device::BluetoothUUID>& allowed_bluetooth_service_class_ids, SerialPortInfoPtr* out_port) { … }
SerialPortInfoPtr SerialServiceAsyncWaiter::RequestPort(
std::vector<SerialPortFilterPtr> filters, const std::vector<::device::BluetoothUUID>& allowed_bluetooth_service_class_ids) { … }
void SerialServiceAsyncWaiter::OpenPort(
const ::base::UnguessableToken& token, ::device::mojom::SerialConnectionOptionsPtr options, ::mojo::PendingRemote<::device::mojom::SerialPortClient> client, ::mojo::PendingRemote<::device::mojom::SerialPort>* out_port) { … }
::mojo::PendingRemote<::device::mojom::SerialPort> SerialServiceAsyncWaiter::OpenPort(
const ::base::UnguessableToken& token, ::device::mojom::SerialConnectionOptionsPtr options, ::mojo::PendingRemote<::device::mojom::SerialPortClient> client) { … }
void SerialServiceAsyncWaiter::ForgetPort(
const ::base::UnguessableToken& token) { … }
void SerialServiceClientInterceptorForTesting::OnPortConnectedStateChanged(SerialPortInfoPtr port_info) { … }
SerialServiceClientAsyncWaiter::SerialServiceClientAsyncWaiter(
SerialServiceClient* proxy) : … { … }
SerialServiceClientAsyncWaiter::~SerialServiceClientAsyncWaiter() = default;
}
#if defined(__clang__)
#pragma clang diagnostic pop
#endif