#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif
#include "third_party/blink/public/mojom/service_worker/embedded_worker.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/service_worker/embedded_worker.mojom-params-data.h"
#include "third_party/blink/public/mojom/service_worker/embedded_worker.mojom-shared-message-ids.h"
#include "third_party/blink/public/mojom/service_worker/embedded_worker.mojom-blink-import-headers.h"
#include "third_party/blink/public/mojom/service_worker/embedded_worker.mojom-blink-test-utils.h"
#include "mojo/public/cpp/bindings/lib/wtf_serialization.h"
namespace blink::mojom::blink {
EmbeddedWorkerStartParams::EmbeddedWorkerStartParams()
: … { … }
EmbeddedWorkerStartParams::EmbeddedWorkerStartParams(
int64_t service_worker_version_id_in,
const ::blink::KURL& scope_in,
const ::blink::KURL& script_url_in,
::blink::mojom::blink::ScriptType script_type_in,
::blink::mojom::blink::FetchClientSettingsObjectPtr outside_fetch_client_settings_object_in,
const WTF::String& user_agent_in,
::blink::mojom::blink::UserAgentMetadataPtr ua_metadata_in,
int32_t service_worker_route_id_in,
const ::base::UnguessableToken& devtools_worker_token_in,
const ::blink::KURL& script_url_to_skip_throttling_in,
bool wait_for_debugger_in,
bool is_installed_in,
const ::blink::RendererPreferences& renderer_preferences_in,
WTF::Vector<WTF::String> forced_enabled_runtime_features_in,
::mojo::PendingReceiver<::blink::mojom::blink::ServiceWorker> service_worker_receiver_in,
::mojo::PendingReceiver<::service_manager::mojom::blink::InterfaceProvider> interface_provider_in,
::mojo::PendingReceiver<::blink::mojom::blink::ControllerServiceWorker> controller_receiver_in,
::blink::mojom::blink::ServiceWorkerInstalledScriptsInfoPtr installed_scripts_info_in,
::mojo::PendingAssociatedRemote<EmbeddedWorkerInstanceHost> instance_host_in,
::blink::mojom::blink::ServiceWorkerProviderInfoForStartWorkerPtr provider_info_in,
::mojo::PendingRemote<::blink::mojom::blink::WorkerContentSettingsProxy> content_settings_proxy_in,
::mojo::PendingReceiver<::blink::mojom::blink::RendererPreferenceWatcher> preference_watcher_receiver_in,
::std::unique_ptr<::blink::PendingURLLoaderFactoryBundle> subresource_loader_factories_in,
::mojo::PendingReceiver<::blink::mojom::blink::SubresourceLoaderUpdater> subresource_loader_updater_in,
const ::blink::ServiceWorkerToken& service_worker_token_in,
int64_t ukm_source_id_in,
::blink::mojom::blink::WorkerMainScriptLoadParamsPtr main_script_load_params_in,
::blink::mojom::blink::PolicyContainerPtr policy_container_in,
const ::blink::BlinkStorageKey& storage_key_in,
WTF::Vector<WTF::String> cors_exempt_header_list_in)
: … { … }
EmbeddedWorkerStartParams::~EmbeddedWorkerStartParams() = default;
void EmbeddedWorkerStartParams::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool EmbeddedWorkerStartParams::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
EmbeddedWorkerStartTiming::EmbeddedWorkerStartTiming()
: … { … }
EmbeddedWorkerStartTiming::EmbeddedWorkerStartTiming(
::base::TimeTicks start_worker_received_time_in,
::base::TimeTicks script_evaluation_start_time_in,
::base::TimeTicks script_evaluation_end_time_in)
: … { … }
EmbeddedWorkerStartTiming::~EmbeddedWorkerStartTiming() = default;
void EmbeddedWorkerStartTiming::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool EmbeddedWorkerStartTiming::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
const char EmbeddedWorkerInstanceClient::Name_[] = …;
EmbeddedWorkerInstanceClient::IPCStableHashFunction EmbeddedWorkerInstanceClient::MessageToMethodInfo_(mojo::Message& message) { … }
const char* EmbeddedWorkerInstanceClient::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t EmbeddedWorkerInstanceClient::StartWorker_Sym::IPCStableHash() { … }
uint32_t EmbeddedWorkerInstanceClient::StopWorker_Sym::IPCStableHash() { … }
# endif
EmbeddedWorkerInstanceClientProxy::EmbeddedWorkerInstanceClientProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void EmbeddedWorkerInstanceClientProxy::StartWorker(
EmbeddedWorkerStartParamsPtr in_params) { … }
void EmbeddedWorkerInstanceClientProxy::StopWorker(
) { … }
bool EmbeddedWorkerInstanceClientStubDispatch::Accept(
EmbeddedWorkerInstanceClient* impl,
mojo::Message* message) { … }
bool EmbeddedWorkerInstanceClientStubDispatch::AcceptWithResponder(
EmbeddedWorkerInstanceClient* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kEmbeddedWorkerInstanceClientValidationInfo[] = …;
bool EmbeddedWorkerInstanceClientRequestValidator::Accept(mojo::Message* message) { … }
const char EmbeddedWorkerInstanceHost::Name_[] = …;
EmbeddedWorkerInstanceHost::IPCStableHashFunction EmbeddedWorkerInstanceHost::MessageToMethodInfo_(mojo::Message& message) { … }
const char* EmbeddedWorkerInstanceHost::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t EmbeddedWorkerInstanceHost::RequestTermination_Sym::IPCStableHash() { … }
uint32_t EmbeddedWorkerInstanceHost::CountFeature_Sym::IPCStableHash() { … }
uint32_t EmbeddedWorkerInstanceHost::OnReadyForInspection_Sym::IPCStableHash() { … }
uint32_t EmbeddedWorkerInstanceHost::OnScriptLoaded_Sym::IPCStableHash() { … }
uint32_t EmbeddedWorkerInstanceHost::OnScriptEvaluationStart_Sym::IPCStableHash() { … }
uint32_t EmbeddedWorkerInstanceHost::OnStarted_Sym::IPCStableHash() { … }
uint32_t EmbeddedWorkerInstanceHost::OnReportException_Sym::IPCStableHash() { … }
uint32_t EmbeddedWorkerInstanceHost::OnReportConsoleMessage_Sym::IPCStableHash() { … }
uint32_t EmbeddedWorkerInstanceHost::OnStopped_Sym::IPCStableHash() { … }
# endif
class EmbeddedWorkerInstanceHost_RequestTermination_ForwardToCallback
: public mojo::MessageReceiver { … };
EmbeddedWorkerInstanceHostProxy::EmbeddedWorkerInstanceHostProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void EmbeddedWorkerInstanceHostProxy::RequestTermination(
RequestTerminationCallback callback) { … }
void EmbeddedWorkerInstanceHostProxy::CountFeature(
::blink::mojom::blink::WebFeature in_feature) { … }
void EmbeddedWorkerInstanceHostProxy::OnReadyForInspection(
::mojo::PendingRemote<::blink::mojom::blink::DevToolsAgent> in_agent, ::mojo::PendingReceiver<::blink::mojom::blink::DevToolsAgentHost> in_agent_host) { … }
void EmbeddedWorkerInstanceHostProxy::OnScriptLoaded(
) { … }
void EmbeddedWorkerInstanceHostProxy::OnScriptEvaluationStart(
) { … }
void EmbeddedWorkerInstanceHostProxy::OnStarted(
::blink::mojom::blink::ServiceWorkerStartStatus in_status, ::blink::mojom::blink::ServiceWorkerFetchHandlerType in_fetch_handler_type, bool in_has_hid_event_handlers, bool in_has_usb_event_handlers, int32_t in_thread_id, EmbeddedWorkerStartTimingPtr in_start_timing) { … }
void EmbeddedWorkerInstanceHostProxy::OnReportException(
const ::WTF::String& in_error_message, int32_t in_line_number, int32_t in_column_number, const ::blink::KURL& in_source_url) { … }
void EmbeddedWorkerInstanceHostProxy::OnReportConsoleMessage(
::blink::mojom::blink::ConsoleMessageSource in_source, ::blink::mojom::blink::ConsoleMessageLevel in_message_level, const ::WTF::String& in_message, int32_t in_line_number, const ::blink::KURL& in_source_url) { … }
void EmbeddedWorkerInstanceHostProxy::OnStopped(
) { … }
class EmbeddedWorkerInstanceHost_RequestTermination_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool EmbeddedWorkerInstanceHost_RequestTermination_ForwardToCallback::Accept(
mojo::Message* message) { … }
void EmbeddedWorkerInstanceHost_RequestTermination_ProxyToResponder::Run(
bool in_will_be_terminated) { … }
bool EmbeddedWorkerInstanceHostStubDispatch::Accept(
EmbeddedWorkerInstanceHost* impl,
mojo::Message* message) { … }
bool EmbeddedWorkerInstanceHostStubDispatch::AcceptWithResponder(
EmbeddedWorkerInstanceHost* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kEmbeddedWorkerInstanceHostValidationInfo[] = …;
bool EmbeddedWorkerInstanceHostRequestValidator::Accept(mojo::Message* message) { … }
bool EmbeddedWorkerInstanceHostResponseValidator::Accept(mojo::Message* message) { … }
}
namespace mojo {
bool StructTraits<::blink::mojom::blink::EmbeddedWorkerStartParams::DataView, ::blink::mojom::blink::EmbeddedWorkerStartParamsPtr>::Read(
::blink::mojom::blink::EmbeddedWorkerStartParams::DataView input,
::blink::mojom::blink::EmbeddedWorkerStartParamsPtr* output) { … }
bool StructTraits<::blink::mojom::blink::EmbeddedWorkerStartTiming::DataView, ::blink::mojom::blink::EmbeddedWorkerStartTimingPtr>::Read(
::blink::mojom::blink::EmbeddedWorkerStartTiming::DataView input,
::blink::mojom::blink::EmbeddedWorkerStartTimingPtr* output) { … }
}
namespace blink::mojom::blink {
void EmbeddedWorkerInstanceClientInterceptorForTesting::StartWorker(EmbeddedWorkerStartParamsPtr params) { … }
void EmbeddedWorkerInstanceClientInterceptorForTesting::StopWorker() { … }
EmbeddedWorkerInstanceClientAsyncWaiter::EmbeddedWorkerInstanceClientAsyncWaiter(
EmbeddedWorkerInstanceClient* proxy) : … { … }
EmbeddedWorkerInstanceClientAsyncWaiter::~EmbeddedWorkerInstanceClientAsyncWaiter() = default;
void EmbeddedWorkerInstanceHostInterceptorForTesting::RequestTermination(RequestTerminationCallback callback) { … }
void EmbeddedWorkerInstanceHostInterceptorForTesting::CountFeature(::blink::mojom::blink::WebFeature feature) { … }
void EmbeddedWorkerInstanceHostInterceptorForTesting::OnReadyForInspection(::mojo::PendingRemote<::blink::mojom::blink::DevToolsAgent> agent, ::mojo::PendingReceiver<::blink::mojom::blink::DevToolsAgentHost> agent_host) { … }
void EmbeddedWorkerInstanceHostInterceptorForTesting::OnScriptLoaded() { … }
void EmbeddedWorkerInstanceHostInterceptorForTesting::OnScriptEvaluationStart() { … }
void EmbeddedWorkerInstanceHostInterceptorForTesting::OnStarted(::blink::mojom::blink::ServiceWorkerStartStatus status, ::blink::mojom::blink::ServiceWorkerFetchHandlerType fetch_handler_type, bool has_hid_event_handlers, bool has_usb_event_handlers, int32_t thread_id, EmbeddedWorkerStartTimingPtr start_timing) { … }
void EmbeddedWorkerInstanceHostInterceptorForTesting::OnReportException(const ::WTF::String& error_message, int32_t line_number, int32_t column_number, const ::blink::KURL& source_url) { … }
void EmbeddedWorkerInstanceHostInterceptorForTesting::OnReportConsoleMessage(::blink::mojom::blink::ConsoleMessageSource source, ::blink::mojom::blink::ConsoleMessageLevel message_level, const ::WTF::String& message, int32_t line_number, const ::blink::KURL& source_url) { … }
void EmbeddedWorkerInstanceHostInterceptorForTesting::OnStopped() { … }
EmbeddedWorkerInstanceHostAsyncWaiter::EmbeddedWorkerInstanceHostAsyncWaiter(
EmbeddedWorkerInstanceHost* proxy) : … { … }
EmbeddedWorkerInstanceHostAsyncWaiter::~EmbeddedWorkerInstanceHostAsyncWaiter() = default;
void EmbeddedWorkerInstanceHostAsyncWaiter::RequestTermination(
bool* out_will_be_terminated) { … }
bool EmbeddedWorkerInstanceHostAsyncWaiter::RequestTermination(
) { … }
}
#if defined(__clang__)
#pragma clang diagnostic pop
#endif