#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.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-import-headers.h"
#include "third_party/blink/public/mojom/printing/web_printing.mojom-test-utils.h"
namespace blink::mojom {
WebPrinterInfo::WebPrinterInfo()
: … { … }
WebPrinterInfo::WebPrinterInfo(
const std::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 std::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,
std::vector<WebPrintingMediaCollectionPtr> media_col_database_in,
const std::optional<std::string>& media_source_default_in,
std::vector<std::string> media_source_supported_in,
WebPrintingMultipleDocumentHandling multiple_document_handling_default_in,
std::vector<WebPrintingMultipleDocumentHandling> multiple_document_handling_supported_in,
WebPrintingOrientationRequested orientation_requested_default_in,
std::vector<WebPrintingOrientationRequested> orientation_requested_supported_in,
const ::gfx::Size& printer_resolution_default_in,
std::vector<::gfx::Size> printer_resolution_supported_in,
WebPrintColorMode print_color_mode_default_in,
std::vector<WebPrintColorMode> print_color_mode_supported_in,
WebPrinterState printer_state_in,
const std::string& printer_state_message_in,
std::vector<WebPrinterStateReason> printer_state_reasons_in,
std::optional<WebPrintingSides> sides_default_in,
std::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 std::string& job_name_in,
uint32_t copies_in,
WebPrintingMediaCollectionRequestedPtr media_col_in,
const std::optional<std::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 std::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(
std::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::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::WebPrinterInfo::DataView, ::blink::mojom::WebPrinterInfoPtr>::Read(
::blink::mojom::WebPrinterInfo::DataView input,
::blink::mojom::WebPrinterInfoPtr* output) { … }
bool StructTraits<::blink::mojom::WebPrintingRange::DataView, ::blink::mojom::WebPrintingRangePtr>::Read(
::blink::mojom::WebPrintingRange::DataView input,
::blink::mojom::WebPrintingRangePtr* output) { … }
bool StructTraits<::blink::mojom::WebPrintingMediaSize::DataView, ::blink::mojom::WebPrintingMediaSizePtr>::Read(
::blink::mojom::WebPrintingMediaSize::DataView input,
::blink::mojom::WebPrintingMediaSizePtr* output) { … }
bool StructTraits<::blink::mojom::WebPrintingMediaCollection::DataView, ::blink::mojom::WebPrintingMediaCollectionPtr>::Read(
::blink::mojom::WebPrintingMediaCollection::DataView input,
::blink::mojom::WebPrintingMediaCollectionPtr* output) { … }
bool StructTraits<::blink::mojom::WebPrinterAttributes::DataView, ::blink::mojom::WebPrinterAttributesPtr>::Read(
::blink::mojom::WebPrinterAttributes::DataView input,
::blink::mojom::WebPrinterAttributesPtr* output) { … }
bool StructTraits<::blink::mojom::WebPrintingMediaCollectionRequested::DataView, ::blink::mojom::WebPrintingMediaCollectionRequestedPtr>::Read(
::blink::mojom::WebPrintingMediaCollectionRequested::DataView input,
::blink::mojom::WebPrintingMediaCollectionRequestedPtr* output) { … }
bool StructTraits<::blink::mojom::WebPrintJobTemplateAttributes::DataView, ::blink::mojom::WebPrintJobTemplateAttributesPtr>::Read(
::blink::mojom::WebPrintJobTemplateAttributes::DataView input,
::blink::mojom::WebPrintJobTemplateAttributesPtr* output) { … }
bool StructTraits<::blink::mojom::WebPrintJobUpdate::DataView, ::blink::mojom::WebPrintJobUpdatePtr>::Read(
::blink::mojom::WebPrintJobUpdate::DataView input,
::blink::mojom::WebPrintJobUpdatePtr* output) { … }
bool StructTraits<::blink::mojom::WebPrintJobInfo::DataView, ::blink::mojom::WebPrintJobInfoPtr>::Read(
::blink::mojom::WebPrintJobInfo::DataView input,
::blink::mojom::WebPrintJobInfoPtr* output) { … }
bool UnionTraits<::blink::mojom::WebPrintingMediaSizeDimension::DataView, ::blink::mojom::WebPrintingMediaSizeDimensionPtr>::Read(
::blink::mojom::WebPrintingMediaSizeDimension::DataView input,
::blink::mojom::WebPrintingMediaSizeDimensionPtr* output) { … }
bool UnionTraits<::blink::mojom::GetPrintersResult::DataView, ::blink::mojom::GetPrintersResultPtr>::Read(
::blink::mojom::GetPrintersResult::DataView input,
::blink::mojom::GetPrintersResultPtr* output) { … }
bool UnionTraits<::blink::mojom::WebPrinterFetchResult::DataView, ::blink::mojom::WebPrinterFetchResultPtr>::Read(
::blink::mojom::WebPrinterFetchResult::DataView input,
::blink::mojom::WebPrinterFetchResultPtr* output) { … }
bool UnionTraits<::blink::mojom::WebPrintResult::DataView, ::blink::mojom::WebPrintResultPtr>::Read(
::blink::mojom::WebPrintResult::DataView input,
::blink::mojom::WebPrintResultPtr* output) { … }
}
namespace blink::mojom {
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::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::Blob> document, WebPrintJobTemplateAttributesPtr attributes, WebPrintResultPtr* out_result) { … }
WebPrintResultPtr WebPrinterAsyncWaiter::Print(
::mojo::PendingRemote<::blink::mojom::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