#include "sandbox/win/src/sandbox.h"
#endif
+#if defined(TIZEN_PEPPER_EXTENSIONS)
+#include <sys/prctl.h>
+#include "base/files/file_path.h"
+#include "content/common/set_process_title_linux.h"
+#endif
+
#if BUILDFLAG(IS_MAC)
#include "sandbox/mac/seatbelt_exec.h"
#endif
namespace content {
+#if defined(TIZEN_PEPPER_EXTENSIONS)
+namespace {
+
+void UpdateProcessTitle(const std::u16string& plugin_name) {
+ constexpr char kPepperPluginProcessName[] = "efl_pluginprocess";
+ constexpr char kLibPrefix[] = "lib";
+ constexpr int kLibPrefixLength = sizeof(kLibPrefix) - 1;
+
+ auto command_line = base::CommandLine::ForCurrentProcess();
+ auto program_dir = command_line->GetProgram().DirName();
+ auto updated_program_path = program_dir.Append(kPepperPluginProcessName);
+
+ auto plugin_name_utf8 = base::UTF16ToUTF8(plugin_name);
+ if (plugin_name_utf8.length() > kLibPrefixLength &&
+ plugin_name_utf8.compare(0, kLibPrefixLength, kLibPrefix) == 0) {
+ plugin_name_utf8 = plugin_name_utf8.substr(kLibPrefixLength);
+ }
+
+ prctl(PR_SET_NAME, plugin_name_utf8.c_str());
+ setproctitle("-%s %s %s", updated_program_path.value().c_str(),
+ plugin_name_utf8.c_str(),
+ command_line->GetArgumentsString().c_str());
+}
+
+} // namespace
+#endif
+
PpapiThread::PpapiThread(base::RepeatingClosure quit_closure,
const base::CommandLine& command_line)
: ChildThreadImpl(std::move(quit_closure)),
void PpapiThread::SavePluginName(const base::FilePath& path) {
ppapi::proxy::PluginGlobals::Get()->set_plugin_name(
path.BaseName().AsUTF8Unsafe());
+
+#if defined(TIZEN_PEPPER_EXTENSIONS)
+ UpdateProcessTitle(path.BaseName().RemoveExtension().LossyDisplayName());
+#endif
}
} // namespace content