#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif
#include "extensions/common/mojom/service_worker_host.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 "extensions/common/mojom/service_worker_host.mojom-params-data.h"
#include "extensions/common/mojom/service_worker_host.mojom-shared-message-ids.h"
#include "extensions/common/mojom/service_worker_host.mojom-import-headers.h"
#include "extensions/common/mojom/service_worker_host.mojom-test-utils.h"
namespace extensions::mojom {
const char ServiceWorkerHost::Name_[] = …;
ServiceWorkerHost::IPCStableHashFunction ServiceWorkerHost::MessageToMethodInfo_(mojo::Message& message) { … }
const char* ServiceWorkerHost::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t ServiceWorkerHost::DidInitializeServiceWorkerContext_Sym::IPCStableHash() { … }
uint32_t ServiceWorkerHost::DidStartServiceWorkerContext_Sym::IPCStableHash() { … }
uint32_t ServiceWorkerHost::DidStopServiceWorkerContext_Sym::IPCStableHash() { … }
uint32_t ServiceWorkerHost::RequestWorker_Sym::IPCStableHash() { … }
uint32_t ServiceWorkerHost::WorkerResponseAck_Sym::IPCStableHash() { … }
uint32_t ServiceWorkerHost::OpenChannelToExtension_Sym::IPCStableHash() { … }
uint32_t ServiceWorkerHost::OpenChannelToNativeApp_Sym::IPCStableHash() { … }
uint32_t ServiceWorkerHost::OpenChannelToTab_Sym::IPCStableHash() { … }
# endif
class ServiceWorkerHost_RequestWorker_ForwardToCallback
: public mojo::MessageReceiver { … };
ServiceWorkerHostProxy::ServiceWorkerHostProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void ServiceWorkerHostProxy::DidInitializeServiceWorkerContext(
const std::string& in_extension_id, int64_t in_service_worker_version_id, int32_t in_worker_thread_id, const ::blink::ServiceWorkerToken& in_service_worker_token, ::mojo::PendingAssociatedRemote<::extensions::mojom::EventDispatcher> in_event_dispatcher) { … }
void ServiceWorkerHostProxy::DidStartServiceWorkerContext(
const std::string& in_extension_id, const ::base::UnguessableToken& in_activation_token, const ::GURL& in_service_worker_scope, int64_t in_service_worker_version_id, int32_t in_worker_thread_id) { … }
void ServiceWorkerHostProxy::DidStopServiceWorkerContext(
const std::string& in_extension_id, const ::base::UnguessableToken& in_activation_token, const ::GURL& in_service_worker_scope, int64_t in_service_worker_version_id, int32_t in_worker_thread_id) { … }
void ServiceWorkerHostProxy::RequestWorker(
::extensions::mojom::RequestParamsPtr in_params, RequestWorkerCallback callback) { … }
void ServiceWorkerHostProxy::WorkerResponseAck(
const ::base::Uuid& in_request_uuid) { … }
void ServiceWorkerHostProxy::OpenChannelToExtension(
::extensions::mojom::ExternalConnectionInfoPtr in_info, ::extensions::mojom::ChannelType in_channel_type, const std::string& in_channel_name, const ::extensions::PortId& in_port_id, ::mojo::PendingAssociatedRemote<::extensions::mojom::MessagePort> in_port, ::mojo::PendingAssociatedReceiver<::extensions::mojom::MessagePortHost> in_port_host) { … }
void ServiceWorkerHostProxy::OpenChannelToNativeApp(
const std::string& in_native_app_name, const ::extensions::PortId& in_port_id, ::mojo::PendingAssociatedRemote<::extensions::mojom::MessagePort> in_port, ::mojo::PendingAssociatedReceiver<::extensions::mojom::MessagePortHost> in_port_host) { … }
void ServiceWorkerHostProxy::OpenChannelToTab(
int32_t in_tab_id, int32_t in_frame_id, const std::optional<std::string>& in_document_id, ::extensions::mojom::ChannelType in_channel_type, const std::string& in_channel_name, const ::extensions::PortId& in_port_id, ::mojo::PendingAssociatedRemote<::extensions::mojom::MessagePort> in_port, ::mojo::PendingAssociatedReceiver<::extensions::mojom::MessagePortHost> in_port_host) { … }
class ServiceWorkerHost_RequestWorker_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool ServiceWorkerHost_RequestWorker_ForwardToCallback::Accept(
mojo::Message* message) { … }
void ServiceWorkerHost_RequestWorker_ProxyToResponder::Run(
bool in_success, ::base::Value::List in_response_wrapper, const std::string& in_error, ::extensions::mojom::ExtraResponseDataPtr in_extra_data) { … }
bool ServiceWorkerHostStubDispatch::Accept(
ServiceWorkerHost* impl,
mojo::Message* message) { … }
bool ServiceWorkerHostStubDispatch::AcceptWithResponder(
ServiceWorkerHost* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kServiceWorkerHostValidationInfo[] = …;
bool ServiceWorkerHostRequestValidator::Accept(mojo::Message* message) { … }
bool ServiceWorkerHostResponseValidator::Accept(mojo::Message* message) { … }
}
namespace mojo {
}
namespace extensions::mojom {
void ServiceWorkerHostInterceptorForTesting::DidInitializeServiceWorkerContext(const std::string& extension_id, int64_t service_worker_version_id, int32_t worker_thread_id, const ::blink::ServiceWorkerToken& service_worker_token, ::mojo::PendingAssociatedRemote<::extensions::mojom::EventDispatcher> event_dispatcher) { … }
void ServiceWorkerHostInterceptorForTesting::DidStartServiceWorkerContext(const std::string& extension_id, const ::base::UnguessableToken& activation_token, const ::GURL& service_worker_scope, int64_t service_worker_version_id, int32_t worker_thread_id) { … }
void ServiceWorkerHostInterceptorForTesting::DidStopServiceWorkerContext(const std::string& extension_id, const ::base::UnguessableToken& activation_token, const ::GURL& service_worker_scope, int64_t service_worker_version_id, int32_t worker_thread_id) { … }
void ServiceWorkerHostInterceptorForTesting::RequestWorker(::extensions::mojom::RequestParamsPtr params, RequestWorkerCallback callback) { … }
void ServiceWorkerHostInterceptorForTesting::WorkerResponseAck(const ::base::Uuid& request_uuid) { … }
void ServiceWorkerHostInterceptorForTesting::OpenChannelToExtension(::extensions::mojom::ExternalConnectionInfoPtr info, ::extensions::mojom::ChannelType channel_type, const std::string& channel_name, const ::extensions::PortId& port_id, ::mojo::PendingAssociatedRemote<::extensions::mojom::MessagePort> port, ::mojo::PendingAssociatedReceiver<::extensions::mojom::MessagePortHost> port_host) { … }
void ServiceWorkerHostInterceptorForTesting::OpenChannelToNativeApp(const std::string& native_app_name, const ::extensions::PortId& port_id, ::mojo::PendingAssociatedRemote<::extensions::mojom::MessagePort> port, ::mojo::PendingAssociatedReceiver<::extensions::mojom::MessagePortHost> port_host) { … }
void ServiceWorkerHostInterceptorForTesting::OpenChannelToTab(int32_t tab_id, int32_t frame_id, const std::optional<std::string>& document_id, ::extensions::mojom::ChannelType channel_type, const std::string& channel_name, const ::extensions::PortId& port_id, ::mojo::PendingAssociatedRemote<::extensions::mojom::MessagePort> port, ::mojo::PendingAssociatedReceiver<::extensions::mojom::MessagePortHost> port_host) { … }
ServiceWorkerHostAsyncWaiter::ServiceWorkerHostAsyncWaiter(
ServiceWorkerHost* proxy) : … { … }
ServiceWorkerHostAsyncWaiter::~ServiceWorkerHostAsyncWaiter() = default;
void ServiceWorkerHostAsyncWaiter::RequestWorker(
::extensions::mojom::RequestParamsPtr params, bool* out_success, ::base::Value::List* out_response_wrapper, std::string* out_error, ::extensions::mojom::ExtraResponseDataPtr* out_extra_data) { … }
}
#if defined(__clang__)
#pragma clang diagnostic pop
#endif