#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif
#include "third_party/blink/public/mojom/push_messaging/push_messaging.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/push_messaging/push_messaging.mojom-params-data.h"
#include "third_party/blink/public/mojom/push_messaging/push_messaging.mojom-shared-message-ids.h"
#include "third_party/blink/public/mojom/push_messaging/push_messaging.mojom-blink-import-headers.h"
#include "third_party/blink/public/mojom/push_messaging/push_messaging.mojom-blink-test-utils.h"
#include "mojo/public/cpp/bindings/lib/wtf_serialization.h"
namespace blink::mojom::blink {
PushSubscriptionOptions::PushSubscriptionOptions()
: … { … }
PushSubscriptionOptions::PushSubscriptionOptions(
bool user_visible_only_in,
WTF::Vector<uint8_t> application_server_key_in)
: … { … }
PushSubscriptionOptions::~PushSubscriptionOptions() = default;
void PushSubscriptionOptions::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool PushSubscriptionOptions::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
PushSubscription::PushSubscription()
: … { … }
PushSubscription::PushSubscription(
const ::blink::KURL& endpoint_in,
std::optional<::base::Time> expirationTime_in,
PushSubscriptionOptionsPtr options_in,
WTF::Vector<uint8_t> p256dh_in,
WTF::Vector<uint8_t> auth_in)
: … { … }
PushSubscription::~PushSubscription() = default;
void PushSubscription::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool PushSubscription::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
const char PushMessaging::Name_[] = …;
PushMessaging::IPCStableHashFunction PushMessaging::MessageToMethodInfo_(mojo::Message& message) { … }
const char* PushMessaging::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t PushMessaging::Subscribe_Sym::IPCStableHash() { … }
uint32_t PushMessaging::Unsubscribe_Sym::IPCStableHash() { … }
uint32_t PushMessaging::GetSubscription_Sym::IPCStableHash() { … }
# endif
class PushMessaging_Subscribe_ForwardToCallback
: public mojo::MessageReceiver { … };
class PushMessaging_Unsubscribe_ForwardToCallback
: public mojo::MessageReceiver { … };
class PushMessaging_GetSubscription_ForwardToCallback
: public mojo::MessageReceiver { … };
PushMessagingProxy::PushMessagingProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void PushMessagingProxy::Subscribe(
int64_t in_service_worker_registration_id, PushSubscriptionOptionsPtr in_options, bool in_user_gesture, SubscribeCallback callback) { … }
void PushMessagingProxy::Unsubscribe(
int64_t in_service_worker_registration_id, UnsubscribeCallback callback) { … }
void PushMessagingProxy::GetSubscription(
int64_t in_service_worker_registration_id, GetSubscriptionCallback callback) { … }
class PushMessaging_Subscribe_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool PushMessaging_Subscribe_ForwardToCallback::Accept(
mojo::Message* message) { … }
void PushMessaging_Subscribe_ProxyToResponder::Run(
::blink::mojom::blink::PushRegistrationStatus in_status, PushSubscriptionPtr in_subscription) { … }
class PushMessaging_Unsubscribe_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool PushMessaging_Unsubscribe_ForwardToCallback::Accept(
mojo::Message* message) { … }
void PushMessaging_Unsubscribe_ProxyToResponder::Run(
PushErrorType in_error_type, bool in_did_unsubscribe, const WTF::String& in_error_message) { … }
class PushMessaging_GetSubscription_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool PushMessaging_GetSubscription_ForwardToCallback::Accept(
mojo::Message* message) { … }
void PushMessaging_GetSubscription_ProxyToResponder::Run(
::blink::mojom::blink::PushGetRegistrationStatus in_status, PushSubscriptionPtr in_subscription) { … }
bool PushMessagingStubDispatch::Accept(
PushMessaging* impl,
mojo::Message* message) { … }
bool PushMessagingStubDispatch::AcceptWithResponder(
PushMessaging* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kPushMessagingValidationInfo[] = …;
bool PushMessagingRequestValidator::Accept(mojo::Message* message) { … }
bool PushMessagingResponseValidator::Accept(mojo::Message* message) { … }
}
namespace mojo {
bool StructTraits<::blink::mojom::blink::PushSubscriptionOptions::DataView, ::blink::mojom::blink::PushSubscriptionOptionsPtr>::Read(
::blink::mojom::blink::PushSubscriptionOptions::DataView input,
::blink::mojom::blink::PushSubscriptionOptionsPtr* output) { … }
bool StructTraits<::blink::mojom::blink::PushSubscription::DataView, ::blink::mojom::blink::PushSubscriptionPtr>::Read(
::blink::mojom::blink::PushSubscription::DataView input,
::blink::mojom::blink::PushSubscriptionPtr* output) { … }
}
namespace blink::mojom::blink {
void PushMessagingInterceptorForTesting::Subscribe(int64_t service_worker_registration_id, PushSubscriptionOptionsPtr options, bool user_gesture, SubscribeCallback callback) { … }
void PushMessagingInterceptorForTesting::Unsubscribe(int64_t service_worker_registration_id, UnsubscribeCallback callback) { … }
void PushMessagingInterceptorForTesting::GetSubscription(int64_t service_worker_registration_id, GetSubscriptionCallback callback) { … }
PushMessagingAsyncWaiter::PushMessagingAsyncWaiter(
PushMessaging* proxy) : … { … }
PushMessagingAsyncWaiter::~PushMessagingAsyncWaiter() = default;
void PushMessagingAsyncWaiter::Subscribe(
int64_t service_worker_registration_id, PushSubscriptionOptionsPtr options, bool user_gesture, ::blink::mojom::blink::PushRegistrationStatus* out_status, PushSubscriptionPtr* out_subscription) { … }
void PushMessagingAsyncWaiter::Unsubscribe(
int64_t service_worker_registration_id, PushErrorType* out_error_type, bool* out_did_unsubscribe, WTF::String* out_error_message) { … }
void PushMessagingAsyncWaiter::GetSubscription(
int64_t service_worker_registration_id, ::blink::mojom::blink::PushGetRegistrationStatus* out_status, PushSubscriptionPtr* out_subscription) { … }
}
#if defined(__clang__)
#pragma clang diagnostic pop
#endif