#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif
#include "content/common/pepper_plugin.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 "content/common/pepper_plugin.mojom-params-data.h"
#include "content/common/pepper_plugin.mojom-shared-message-ids.h"
#include "content/common/pepper_plugin.mojom-import-headers.h"
#include "content/common/pepper_plugin.mojom-test-utils.h"
#include "content/public/common/webplugininfo_param_traits.h"
namespace content::mojom {
const char PepperHost::Name_[] = …;
PepperHost::IPCStableHashFunction PepperHost::MessageToMethodInfo_(mojo::Message& message) { … }
const char* PepperHost::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t PepperHost::InstanceCreated_Sym::IPCStableHash() { … }
uint32_t PepperHost::BindHungDetectorHost_Sym::IPCStableHash() { … }
uint32_t PepperHost::GetPluginInfo_Sym::IPCStableHash() { … }
uint32_t PepperHost::DidCreateInProcessInstance_Sym::IPCStableHash() { … }
uint32_t PepperHost::DidDeleteInProcessInstance_Sym::IPCStableHash() { … }
uint32_t PepperHost::DidCreateOutOfProcessPepperInstance_Sym::IPCStableHash() { … }
uint32_t PepperHost::DidDeleteOutOfProcessPepperInstance_Sym::IPCStableHash() { … }
uint32_t PepperHost::OpenChannelToPepperPlugin_Sym::IPCStableHash() { … }
# endif
bool PepperHost::GetPluginInfo(const ::GURL& url, const std::string& mime_type, bool* out_found, ::content::WebPluginInfo* out_plugin_info, std::string* out_actual_mime_type) { … }
bool PepperHost::DidCreateOutOfProcessPepperInstance(int32_t plugin_child_id, int32_t pp_instance, bool is_external, int32_t frame_routing_id, const ::GURL& document_url, const ::GURL& plugin_url, bool is_privileged_context) { … }
bool PepperHost::OpenChannelToPepperPlugin(const ::url::Origin& embedder_origin, const ::base::FilePath& path, const std::optional<::url::Origin>& origin_lock, ::mojo::ScopedMessagePipeHandle* out_handle_to_channel, ::base::ProcessId* out_plugin_pid, int32_t* out_plugin_child_id) { … }
class PepperHost_GetPluginInfo_HandleSyncResponse
: public mojo::MessageReceiver { … };
class PepperHost_GetPluginInfo_ForwardToCallback
: public mojo::MessageReceiver { … };
class PepperHost_DidCreateOutOfProcessPepperInstance_HandleSyncResponse
: public mojo::MessageReceiver { … };
class PepperHost_DidCreateOutOfProcessPepperInstance_ForwardToCallback
: public mojo::MessageReceiver { … };
class PepperHost_OpenChannelToPepperPlugin_HandleSyncResponse
: public mojo::MessageReceiver { … };
class PepperHost_OpenChannelToPepperPlugin_ForwardToCallback
: public mojo::MessageReceiver { … };
PepperHostProxy::PepperHostProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void PepperHostProxy::InstanceCreated(
int32_t in_instance_id, ::mojo::PendingAssociatedRemote<PepperPluginInstance> in_instance, ::mojo::PendingAssociatedReceiver<PepperPluginInstanceHost> in_host) { … }
void PepperHostProxy::BindHungDetectorHost(
::mojo::PendingReceiver<PepperHungDetectorHost> in_host, int32_t in_plugin_child_id, const ::base::FilePath& in_plugin_path) { … }
bool PepperHostProxy::GetPluginInfo(
const ::GURL& param_url, const std::string& param_mime_type, bool* out_param_found, ::content::WebPluginInfo* out_param_plugin_info, std::string* out_param_actual_mime_type) { … }
void PepperHostProxy::GetPluginInfo(
const ::GURL& in_url, const std::string& in_mime_type, GetPluginInfoCallback callback) { … }
void PepperHostProxy::DidCreateInProcessInstance(
int32_t in_instance_id, int32_t in_frame_routing_id, const ::GURL& in_document_url, const ::GURL& in_plugin_url) { … }
void PepperHostProxy::DidDeleteInProcessInstance(
int32_t in_instance_id) { … }
bool PepperHostProxy::DidCreateOutOfProcessPepperInstance(
int32_t param_plugin_child_id, int32_t param_pp_instance, bool param_is_external, int32_t param_frame_routing_id, const ::GURL& param_document_url, const ::GURL& param_plugin_url, bool param_is_privileged_context) { … }
void PepperHostProxy::DidCreateOutOfProcessPepperInstance(
int32_t in_plugin_child_id, int32_t in_pp_instance, bool in_is_external, int32_t in_frame_routing_id, const ::GURL& in_document_url, const ::GURL& in_plugin_url, bool in_is_privileged_context, DidCreateOutOfProcessPepperInstanceCallback callback) { … }
void PepperHostProxy::DidDeleteOutOfProcessPepperInstance(
int32_t in_plugin_child_id, int32_t in_pp_instance, bool in_is_external) { … }
bool PepperHostProxy::OpenChannelToPepperPlugin(
const ::url::Origin& param_embedder_origin, const ::base::FilePath& param_path, const std::optional<::url::Origin>& param_origin_lock, ::mojo::ScopedMessagePipeHandle* out_param_handle_to_channel, ::base::ProcessId* out_param_plugin_pid, int32_t* out_param_plugin_child_id) { … }
void PepperHostProxy::OpenChannelToPepperPlugin(
const ::url::Origin& in_embedder_origin, const ::base::FilePath& in_path, const std::optional<::url::Origin>& in_origin_lock, OpenChannelToPepperPluginCallback callback) { … }
class PepperHost_GetPluginInfo_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool PepperHost_GetPluginInfo_ForwardToCallback::Accept(
mojo::Message* message) { … }
void PepperHost_GetPluginInfo_ProxyToResponder::Run(
bool in_found, const ::content::WebPluginInfo& in_plugin_info, const std::string& in_actual_mime_type) { … }
bool PepperHost_GetPluginInfo_HandleSyncResponse::Accept(
mojo::Message* message) { … }
class PepperHost_DidCreateOutOfProcessPepperInstance_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool PepperHost_DidCreateOutOfProcessPepperInstance_ForwardToCallback::Accept(
mojo::Message* message) { … }
void PepperHost_DidCreateOutOfProcessPepperInstance_ProxyToResponder::Run(
) { … }
bool PepperHost_DidCreateOutOfProcessPepperInstance_HandleSyncResponse::Accept(
mojo::Message* message) { … }
class PepperHost_OpenChannelToPepperPlugin_ProxyToResponder : public ::mojo::internal::ProxyToResponder { … };
bool PepperHost_OpenChannelToPepperPlugin_ForwardToCallback::Accept(
mojo::Message* message) { … }
void PepperHost_OpenChannelToPepperPlugin_ProxyToResponder::Run(
::mojo::ScopedMessagePipeHandle in_handle_to_channel, ::base::ProcessId in_plugin_pid, int32_t in_plugin_child_id) { … }
bool PepperHost_OpenChannelToPepperPlugin_HandleSyncResponse::Accept(
mojo::Message* message) { … }
bool PepperHostStubDispatch::Accept(
PepperHost* impl,
mojo::Message* message) { … }
bool PepperHostStubDispatch::AcceptWithResponder(
PepperHost* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kPepperHostValidationInfo[] = …;
bool PepperHostRequestValidator::Accept(mojo::Message* message) { … }
bool PepperHostResponseValidator::Accept(mojo::Message* message) { … }
const char PepperHungDetectorHost::Name_[] = …;
PepperHungDetectorHost::IPCStableHashFunction PepperHungDetectorHost::MessageToMethodInfo_(mojo::Message& message) { … }
const char* PepperHungDetectorHost::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t PepperHungDetectorHost::PluginHung_Sym::IPCStableHash() { … }
# endif
PepperHungDetectorHostProxy::PepperHungDetectorHostProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void PepperHungDetectorHostProxy::PluginHung(
bool in_is_hung) { … }
bool PepperHungDetectorHostStubDispatch::Accept(
PepperHungDetectorHost* impl,
mojo::Message* message) { … }
bool PepperHungDetectorHostStubDispatch::AcceptWithResponder(
PepperHungDetectorHost* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kPepperHungDetectorHostValidationInfo[] = …;
bool PepperHungDetectorHostRequestValidator::Accept(mojo::Message* message) { … }
const char PepperPluginInstanceHost::Name_[] = …;
PepperPluginInstanceHost::IPCStableHashFunction PepperPluginInstanceHost::MessageToMethodInfo_(mojo::Message& message) { … }
const char* PepperPluginInstanceHost::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t PepperPluginInstanceHost::StartsPlayback_Sym::IPCStableHash() { … }
uint32_t PepperPluginInstanceHost::StopsPlayback_Sym::IPCStableHash() { … }
uint32_t PepperPluginInstanceHost::InstanceCrashed_Sym::IPCStableHash() { … }
# endif
PepperPluginInstanceHostProxy::PepperPluginInstanceHostProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void PepperPluginInstanceHostProxy::StartsPlayback(
) { … }
void PepperPluginInstanceHostProxy::StopsPlayback(
) { … }
void PepperPluginInstanceHostProxy::InstanceCrashed(
const ::base::FilePath& in_plugin_path, ::base::ProcessId in_plugin_pid) { … }
bool PepperPluginInstanceHostStubDispatch::Accept(
PepperPluginInstanceHost* impl,
mojo::Message* message) { … }
bool PepperPluginInstanceHostStubDispatch::AcceptWithResponder(
PepperPluginInstanceHost* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kPepperPluginInstanceHostValidationInfo[] = …;
bool PepperPluginInstanceHostRequestValidator::Accept(mojo::Message* message) { … }
const char PepperPluginInstance::Name_[] = …;
PepperPluginInstance::IPCStableHashFunction PepperPluginInstance::MessageToMethodInfo_(mojo::Message& message) { … }
const char* PepperPluginInstance::MessageToMethodName_(mojo::Message& message) { … }
#if !BUILDFLAG(IS_FUCHSIA)
uint32_t PepperPluginInstance::SetVolume_Sym::IPCStableHash() { … }
# endif
PepperPluginInstanceProxy::PepperPluginInstanceProxy(mojo::MessageReceiverWithResponder* receiver)
: … { … }
void PepperPluginInstanceProxy::SetVolume(
double in_volume) { … }
bool PepperPluginInstanceStubDispatch::Accept(
PepperPluginInstance* impl,
mojo::Message* message) { … }
bool PepperPluginInstanceStubDispatch::AcceptWithResponder(
PepperPluginInstance* impl,
mojo::Message* message,
std::unique_ptr<mojo::MessageReceiverWithStatus> responder) { … }
namespace {
}
static const mojo::internal::GenericValidationInfo kPepperPluginInstanceValidationInfo[] = …;
bool PepperPluginInstanceRequestValidator::Accept(mojo::Message* message) { … }
}
namespace mojo {
}
namespace content::mojom {
void PepperHostInterceptorForTesting::InstanceCreated(int32_t instance_id, ::mojo::PendingAssociatedRemote<PepperPluginInstance> instance, ::mojo::PendingAssociatedReceiver<PepperPluginInstanceHost> host) { … }
void PepperHostInterceptorForTesting::BindHungDetectorHost(::mojo::PendingReceiver<PepperHungDetectorHost> host, int32_t plugin_child_id, const ::base::FilePath& plugin_path) { … }
void PepperHostInterceptorForTesting::GetPluginInfo(const ::GURL& url, const std::string& mime_type, GetPluginInfoCallback callback) { … }
void PepperHostInterceptorForTesting::DidCreateInProcessInstance(int32_t instance_id, int32_t frame_routing_id, const ::GURL& document_url, const ::GURL& plugin_url) { … }
void PepperHostInterceptorForTesting::DidDeleteInProcessInstance(int32_t instance_id) { … }
void PepperHostInterceptorForTesting::DidCreateOutOfProcessPepperInstance(int32_t plugin_child_id, int32_t pp_instance, bool is_external, int32_t frame_routing_id, const ::GURL& document_url, const ::GURL& plugin_url, bool is_privileged_context, DidCreateOutOfProcessPepperInstanceCallback callback) { … }
void PepperHostInterceptorForTesting::DidDeleteOutOfProcessPepperInstance(int32_t plugin_child_id, int32_t pp_instance, bool is_external) { … }
void PepperHostInterceptorForTesting::OpenChannelToPepperPlugin(const ::url::Origin& embedder_origin, const ::base::FilePath& path, const std::optional<::url::Origin>& origin_lock, OpenChannelToPepperPluginCallback callback) { … }
PepperHostAsyncWaiter::PepperHostAsyncWaiter(
PepperHost* proxy) : … { … }
PepperHostAsyncWaiter::~PepperHostAsyncWaiter() = default;
void PepperHostAsyncWaiter::GetPluginInfo(
const ::GURL& url, const std::string& mime_type, bool* out_found, ::content::WebPluginInfo* out_plugin_info, std::string* out_actual_mime_type) { … }
void PepperHostAsyncWaiter::DidCreateOutOfProcessPepperInstance(
int32_t plugin_child_id, int32_t pp_instance, bool is_external, int32_t frame_routing_id, const ::GURL& document_url, const ::GURL& plugin_url, bool is_privileged_context) { … }
void PepperHostAsyncWaiter::OpenChannelToPepperPlugin(
const ::url::Origin& embedder_origin, const ::base::FilePath& path, const std::optional<::url::Origin>& origin_lock, ::mojo::ScopedMessagePipeHandle* out_handle_to_channel, ::base::ProcessId* out_plugin_pid, int32_t* out_plugin_child_id) { … }
void PepperHungDetectorHostInterceptorForTesting::PluginHung(bool is_hung) { … }
PepperHungDetectorHostAsyncWaiter::PepperHungDetectorHostAsyncWaiter(
PepperHungDetectorHost* proxy) : … { … }
PepperHungDetectorHostAsyncWaiter::~PepperHungDetectorHostAsyncWaiter() = default;
void PepperPluginInstanceHostInterceptorForTesting::StartsPlayback() { … }
void PepperPluginInstanceHostInterceptorForTesting::StopsPlayback() { … }
void PepperPluginInstanceHostInterceptorForTesting::InstanceCrashed(const ::base::FilePath& plugin_path, ::base::ProcessId plugin_pid) { … }
PepperPluginInstanceHostAsyncWaiter::PepperPluginInstanceHostAsyncWaiter(
PepperPluginInstanceHost* proxy) : … { … }
PepperPluginInstanceHostAsyncWaiter::~PepperPluginInstanceHostAsyncWaiter() = default;
void PepperPluginInstanceInterceptorForTesting::SetVolume(double volume) { … }
PepperPluginInstanceAsyncWaiter::PepperPluginInstanceAsyncWaiter(
PepperPluginInstance* proxy) : … { … }
PepperPluginInstanceAsyncWaiter::~PepperPluginInstanceAsyncWaiter() = default;
}
#if defined(__clang__)
#pragma clang diagnostic pop
#endif