#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif
#include "third_party/blink/public/mojom/printing/web_printing.mojom-blink.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/printing/web_printing.mojom-params-data.h"
#include "third_party/blink/public/mojom/printing/web_printing.mojom-shared-message-ids.h"
#include "third_party/blink/public/mojom/printing/web_printing.mojom-blink-import-headers.h"
#include "third_party/blink/public/mojom/printing/web_printing.mojom-blink-test-utils.h"
#include "mojo/public/cpp/bindings/lib/wtf_serialization.h"
namespace blink::mojom::blink {
WebPrinterInfo::WebPrinterInfo()
: … { … }
WebPrinterInfo::WebPrinterInfo(
const WTF::String& printer_name_in,
::mojo::PendingRemote<WebPrinter> printer_remote_in)
: … { … }
WebPrinterInfo::~WebPrinterInfo() = default;
void WebPrinterInfo::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool WebPrinterInfo::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
WebPrintingRange::WebPrintingRange()
: … { … }
WebPrintingRange::WebPrintingRange(
uint32_t from_in,
uint32_t to_in)
: … { … }
WebPrintingRange::~WebPrintingRange() = default;
size_t WebPrintingRange::Hash(size_t seed) const { … }
void WebPrintingRange::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool WebPrintingRange::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
WebPrintingMediaSize::WebPrintingMediaSize()
: … { … }
WebPrintingMediaSize::WebPrintingMediaSize(
WebPrintingMediaSizeDimensionPtr x_dimension_in,
WebPrintingMediaSizeDimensionPtr y_dimension_in)
: … { … }
WebPrintingMediaSize::~WebPrintingMediaSize() = default;
size_t WebPrintingMediaSize::Hash(size_t seed) const { … }
void WebPrintingMediaSize::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool WebPrintingMediaSize::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
WebPrintingMediaCollection::WebPrintingMediaCollection()
: … { … }
WebPrintingMediaCollection::WebPrintingMediaCollection(
WebPrintingMediaSizePtr media_size_in,
const WTF::String& media_size_name_in)
: … { … }
WebPrintingMediaCollection::~WebPrintingMediaCollection() = default;
size_t WebPrintingMediaCollection::Hash(size_t seed) const { … }
void WebPrintingMediaCollection::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool WebPrintingMediaCollection::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
WebPrinterAttributes::WebPrinterAttributes()
: … { … }
WebPrinterAttributes::WebPrinterAttributes(
uint32_t copies_default_in,
WebPrintingRangePtr copies_supported_in,
WebPrintingMediaCollectionPtr media_col_default_in,
WTF::Vector<WebPrintingMediaCollectionPtr> media_col_database_in,
const WTF::String& media_source_default_in,
WTF::Vector<WTF::String> media_source_supported_in,
WebPrintingMultipleDocumentHandling multiple_document_handling_default_in,
WTF::Vector<WebPrintingMultipleDocumentHandling> multiple_document_handling_supported_in,
WebPrintingOrientationRequested orientation_requested_default_in,
WTF::Vector<WebPrintingOrientationRequested> orientation_requested_supported_in,
const ::gfx::Size& printer_resolution_default_in,
WTF::Vector<::gfx::Size> printer_resolution_supported_in,
WebPrintColorMode print_color_mode_default_in,
WTF::Vector<WebPrintColorMode> print_color_mode_supported_in,
WebPrinterState printer_state_in,
const WTF::String& printer_state_message_in,
WTF::Vector<WebPrinterStateReason> printer_state_reasons_in,
std::optional<WebPrintingSides> sides_default_in,
WTF::Vector<WebPrintingSides> sides_supported_in)
: … { … }
WebPrinterAttributes::~WebPrinterAttributes() = default;
void WebPrinterAttributes::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool WebPrinterAttributes::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
WebPrintingMediaCollectionRequested::WebPrintingMediaCollectionRequested()
: … { … }
WebPrintingMediaCollectionRequested::WebPrintingMediaCollectionRequested(
const ::gfx::Size& media_size_in)
: … { … }
WebPrintingMediaCollectionRequested::~WebPrintingMediaCollectionRequested() = default;
void WebPrintingMediaCollectionRequested::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool WebPrintingMediaCollectionRequested::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
WebPrintJobTemplateAttributes::WebPrintJobTemplateAttributes()
: … { … }
WebPrintJobTemplateAttributes::WebPrintJobTemplateAttributes(
const WTF::String& job_name_in,
uint32_t copies_in,
WebPrintingMediaCollectionRequestedPtr media_col_in,
const WTF::String& media_source_in,
std::optional<WebPrintingMultipleDocumentHandling> multiple_document_handling_in,
std::optional<WebPrintingOrientationRequested> orientation_requested_in,
const std::optional<::gfx::Size>& printer_resolution_in,
std::optional<WebPrintColorMode> print_color_mode_in,
std::optional<WebPrintingSides> sides_in)
: … { … }
WebPrintJobTemplateAttributes::~WebPrintJobTemplateAttributes() = default;
void WebPrintJobTemplateAttributes::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool WebPrintJobTemplateAttributes::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
WebPrintJobUpdate::WebPrintJobUpdate()
: … { … }
WebPrintJobUpdate::WebPrintJobUpdate(
WebPrintJobState state_in,
uint32_t pages_printed_in)
: … { … }
WebPrintJobUpdate::~WebPrintJobUpdate() = default;
size_t WebPrintJobUpdate::Hash(size_t seed) const { … }
void WebPrintJobUpdate::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool WebPrintJobUpdate::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
WebPrintJobInfo::WebPrintJobInfo()
: … { … }
WebPrintJobInfo::WebPrintJobInfo(
const WTF::String& job_name_in,
uint32_t job_pages_in,
::mojo::PendingReceiver<WebPrintJobStateObserver> observer_in,
::mojo::PendingRemote<WebPrintJobController> controller_in)
: … { … }
WebPrintJobInfo::~WebPrintJobInfo() = default;
void WebPrintJobInfo::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool WebPrintJobInfo::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
WebPrintingMediaSizeDimension::WebPrintingMediaSizeDimension() : … { … }
WebPrintingMediaSizeDimension::~WebPrintingMediaSizeDimension() { … }
void WebPrintingMediaSizeDimension::set_range(
WebPrintingRangePtr range) { … }
void WebPrintingMediaSizeDimension::set_value(
uint32_t value) { … }
void WebPrintingMediaSizeDimension::DestroyActive() { … }
size_t WebPrintingMediaSizeDimension::Hash(size_t seed) const { … }
bool WebPrintingMediaSizeDimension::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
GetPrintersResult::GetPrintersResult() : … { … }
GetPrintersResult::~GetPrintersResult() { … }
void GetPrintersResult::set_printers(
WTF::Vector<WebPrinterInfoPtr> printers) { … }
void GetPrintersResult::set_error(
GetPrintersError error) { … }
void GetPrintersResult::DestroyActive() { … }
bool GetPrintersResult::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
WebPrinterFetchResult::WebPrinterFetchResult() : … { … }
WebPrinterFetchResult::~WebPrinterFetchResult() { … }
void WebPrinterFetchResult::set_printer_attributes(
WebPrinterAttributesPtr printer_attributes) { … }
void WebPrinterFetchResult::set_error(
WebPrinterFetchError error) { … }
void WebPrinterFetchResult::DestroyActive() { … }
bool WebPrinterFetchResult::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
WebPrintResult::WebPrintResult() : … { … }
WebPrintResult::~WebPrintResult() { … }
void WebPrintResult::set_print_job_info(
WebPrintJobInfoPtr print_job_info) { … }
void WebPrintResult::set_error(
WebPrintError error) { … }
void WebPrintResult::DestroyActive() { … }
bool WebPrintResult::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
const char WebPrintJobStateObserver::Name_[] = …;
WebPrintJobStateObserver::IPCStableHashFunction WebPrintJobStateObserver::MessageToMethodInfo_(mojo::Message& message) { … }
const char* WebPrintJobStateObserver::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t WebPrintJobStateObserver::OnWebPrintJobUpdate_Sym::IPCStableHash() { … }
# endif
WebPrintJobStateObserverProxy::WebPrintJobStateObserverProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void WebPrintJobStateObserverProxy::OnWebPrintJobUpdate(
WebPrintJobUpdatePtr in_update) { … }
bool WebPrintJobStateObserverStubDispatch::Accept(
WebPrintJobStateObserver* impl,
mojo::Message* message) { … }
bool WebPrintJobStateObserverStubDispatch::AcceptWithResponder(
WebPrintJobStateObserver* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kWebPrintJobStateObserverValidationInfo[] = …;
bool WebPrintJobStateObserverRequestValidator::Accept(mojo::Message* message) { … }
const char WebPrintJobController::Name_[] = …;
WebPrintJobController::IPCStableHashFunction WebPrintJobController::MessageToMethodInfo_(mojo::Message& message) { … }
const char* WebPrintJobController::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t WebPrintJobController::Cancel_Sym::IPCStableHash() { … }
# endif
WebPrintJobControllerProxy::WebPrintJobControllerProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void WebPrintJobControllerProxy::Cancel(
) { … }
bool WebPrintJobControllerStubDispatch::Accept(
WebPrintJobController* impl,
mojo::Message* message) { … }
bool WebPrintJobControllerStubDispatch::AcceptWithResponder(
WebPrintJobController* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kWebPrintJobControllerValidationInfo[] = …;
bool WebPrintJobControllerRequestValidator::Accept(mojo::Message* message) { … }
const char WebPrinter::Name_[] = …;
WebPrinter::IPCStableHashFunction WebPrinter::MessageToMethodInfo_(mojo::Message& message) { … }
const char* WebPrinter::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t WebPrinter::FetchAttributes_Sym::IPCStableHash() { … }
uint32_t WebPrinter::Print_Sym::IPCStableHash() { … }
# endif
class WebPrinter_FetchAttributes_ForwardToCallback
: public mojo::MessageReceiver { … };
class WebPrinter_Print_ForwardToCallback
: public mojo::MessageReceiver { … };
WebPrinterProxy::WebPrinterProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void WebPrinterProxy::FetchAttributes(
FetchAttributesCallback callback) { … }
void WebPrinterProxy::Print(
::mojo::PendingRemote<::blink::mojom::blink::Blob> in_document, WebPrintJobTemplateAttributesPtr in_attributes, PrintCallback callback) { … }
class WebPrinter_FetchAttributes_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool WebPrinter_FetchAttributes_ForwardToCallback::Accept(
mojo::Message* message) { … }
void WebPrinter_FetchAttributes_ProxyToResponder::Run(
WebPrinterFetchResultPtr in_result) { … }
class WebPrinter_Print_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool WebPrinter_Print_ForwardToCallback::Accept(
mojo::Message* message) { … }
void WebPrinter_Print_ProxyToResponder::Run(
WebPrintResultPtr in_result) { … }
bool WebPrinterStubDispatch::Accept(
WebPrinter* impl,
mojo::Message* message) { … }
bool WebPrinterStubDispatch::AcceptWithResponder(
WebPrinter* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kWebPrinterValidationInfo[] = …;
bool WebPrinterRequestValidator::Accept(mojo::Message* message) { … }
bool WebPrinterResponseValidator::Accept(mojo::Message* message) { … }
const char WebPrintingService::Name_[] = …;
WebPrintingService::IPCStableHashFunction WebPrintingService::MessageToMethodInfo_(mojo::Message& message) { … }
const char* WebPrintingService::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t WebPrintingService::GetPrinters_Sym::IPCStableHash() { … }
# endif
class WebPrintingService_GetPrinters_ForwardToCallback
: public mojo::MessageReceiver { … };
WebPrintingServiceProxy::WebPrintingServiceProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void WebPrintingServiceProxy::GetPrinters(
GetPrintersCallback callback) { … }
class WebPrintingService_GetPrinters_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool WebPrintingService_GetPrinters_ForwardToCallback::Accept(
mojo::Message* message) { … }
void WebPrintingService_GetPrinters_ProxyToResponder::Run(
GetPrintersResultPtr in_result) { … }
bool WebPrintingServiceStubDispatch::Accept(
WebPrintingService* impl,
mojo::Message* message) { … }
bool WebPrintingServiceStubDispatch::AcceptWithResponder(
WebPrintingService* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kWebPrintingServiceValidationInfo[] = …;
bool WebPrintingServiceRequestValidator::Accept(mojo::Message* message) { … }
bool WebPrintingServiceResponseValidator::Accept(mojo::Message* message) { … }
}
namespace mojo {
bool StructTraits<::blink::mojom::blink::WebPrinterInfo::DataView, ::blink::mojom::blink::WebPrinterInfoPtr>::Read(
::blink::mojom::blink::WebPrinterInfo::DataView input,
::blink::mojom::blink::WebPrinterInfoPtr* output) { … }
bool StructTraits<::blink::mojom::blink::WebPrintingRange::DataView, ::blink::mojom::blink::WebPrintingRangePtr>::Read(
::blink::mojom::blink::WebPrintingRange::DataView input,
::blink::mojom::blink::WebPrintingRangePtr* output) { … }
bool StructTraits<::blink::mojom::blink::WebPrintingMediaSize::DataView, ::blink::mojom::blink::WebPrintingMediaSizePtr>::Read(
::blink::mojom::blink::WebPrintingMediaSize::DataView input,
::blink::mojom::blink::WebPrintingMediaSizePtr* output) { … }
bool StructTraits<::blink::mojom::blink::WebPrintingMediaCollection::DataView, ::blink::mojom::blink::WebPrintingMediaCollectionPtr>::Read(
::blink::mojom::blink::WebPrintingMediaCollection::DataView input,
::blink::mojom::blink::WebPrintingMediaCollectionPtr* output) { … }
bool StructTraits<::blink::mojom::blink::WebPrinterAttributes::DataView, ::blink::mojom::blink::WebPrinterAttributesPtr>::Read(
::blink::mojom::blink::WebPrinterAttributes::DataView input,
::blink::mojom::blink::WebPrinterAttributesPtr* output) { … }
bool StructTraits<::blink::mojom::blink::WebPrintingMediaCollectionRequested::DataView, ::blink::mojom::blink::WebPrintingMediaCollectionRequestedPtr>::Read(
::blink::mojom::blink::WebPrintingMediaCollectionRequested::DataView input,
::blink::mojom::blink::WebPrintingMediaCollectionRequestedPtr* output) { … }
bool StructTraits<::blink::mojom::blink::WebPrintJobTemplateAttributes::DataView, ::blink::mojom::blink::WebPrintJobTemplateAttributesPtr>::Read(
::blink::mojom::blink::WebPrintJobTemplateAttributes::DataView input,
::blink::mojom::blink::WebPrintJobTemplateAttributesPtr* output) { … }
bool StructTraits<::blink::mojom::blink::WebPrintJobUpdate::DataView, ::blink::mojom::blink::WebPrintJobUpdatePtr>::Read(
::blink::mojom::blink::WebPrintJobUpdate::DataView input,
::blink::mojom::blink::WebPrintJobUpdatePtr* output) { … }
bool StructTraits<::blink::mojom::blink::WebPrintJobInfo::DataView, ::blink::mojom::blink::WebPrintJobInfoPtr>::Read(
::blink::mojom::blink::WebPrintJobInfo::DataView input,
::blink::mojom::blink::WebPrintJobInfoPtr* output) { … }
bool UnionTraits<::blink::mojom::blink::WebPrintingMediaSizeDimension::DataView, ::blink::mojom::blink::WebPrintingMediaSizeDimensionPtr>::Read(
::blink::mojom::blink::WebPrintingMediaSizeDimension::DataView input,
::blink::mojom::blink::WebPrintingMediaSizeDimensionPtr* output) { … }
bool UnionTraits<::blink::mojom::blink::GetPrintersResult::DataView, ::blink::mojom::blink::GetPrintersResultPtr>::Read(
::blink::mojom::blink::GetPrintersResult::DataView input,
::blink::mojom::blink::GetPrintersResultPtr* output) { … }
bool UnionTraits<::blink::mojom::blink::WebPrinterFetchResult::DataView, ::blink::mojom::blink::WebPrinterFetchResultPtr>::Read(
::blink::mojom::blink::WebPrinterFetchResult::DataView input,
::blink::mojom::blink::WebPrinterFetchResultPtr* output) { … }
bool UnionTraits<::blink::mojom::blink::WebPrintResult::DataView, ::blink::mojom::blink::WebPrintResultPtr>::Read(
::blink::mojom::blink::WebPrintResult::DataView input,
::blink::mojom::blink::WebPrintResultPtr* output) { … }
}
namespace blink::mojom::blink {
void WebPrintJobStateObserverInterceptorForTesting::OnWebPrintJobUpdate(WebPrintJobUpdatePtr update) { … }
WebPrintJobStateObserverAsyncWaiter::WebPrintJobStateObserverAsyncWaiter(
WebPrintJobStateObserver* proxy) : … { … }
WebPrintJobStateObserverAsyncWaiter::~WebPrintJobStateObserverAsyncWaiter() = default;
void WebPrintJobControllerInterceptorForTesting::Cancel() { … }
WebPrintJobControllerAsyncWaiter::WebPrintJobControllerAsyncWaiter(
WebPrintJobController* proxy) : … { … }
WebPrintJobControllerAsyncWaiter::~WebPrintJobControllerAsyncWaiter() = default;
void WebPrinterInterceptorForTesting::FetchAttributes(FetchAttributesCallback callback) { … }
void WebPrinterInterceptorForTesting::Print(::mojo::PendingRemote<::blink::mojom::blink::Blob> document, WebPrintJobTemplateAttributesPtr attributes, PrintCallback callback) { … }
WebPrinterAsyncWaiter::WebPrinterAsyncWaiter(
WebPrinter* proxy) : … { … }
WebPrinterAsyncWaiter::~WebPrinterAsyncWaiter() = default;
void WebPrinterAsyncWaiter::FetchAttributes(
WebPrinterFetchResultPtr* out_result) { … }
WebPrinterFetchResultPtr WebPrinterAsyncWaiter::FetchAttributes(
) { … }
void WebPrinterAsyncWaiter::Print(
::mojo::PendingRemote<::blink::mojom::blink::Blob> document, WebPrintJobTemplateAttributesPtr attributes, WebPrintResultPtr* out_result) { … }
WebPrintResultPtr WebPrinterAsyncWaiter::Print(
::mojo::PendingRemote<::blink::mojom::blink::Blob> document, WebPrintJobTemplateAttributesPtr attributes) { … }
void WebPrintingServiceInterceptorForTesting::GetPrinters(GetPrintersCallback callback) { … }
WebPrintingServiceAsyncWaiter::WebPrintingServiceAsyncWaiter(
WebPrintingService* proxy) : … { … }
WebPrintingServiceAsyncWaiter::~WebPrintingServiceAsyncWaiter() = default;
void WebPrintingServiceAsyncWaiter::GetPrinters(
GetPrintersResultPtr* out_result) { … }
GetPrintersResultPtr WebPrintingServiceAsyncWaiter::GetPrinters(
) { … }
}
#if defined(__clang__)
#pragma clang diagnostic pop
#endif