#ifndef CONTENT_GPU_IN_PROCESS_GPU_THREAD_H_
#define CONTENT_GPU_IN_PROCESS_GPU_THREAD_H_
#include "base/memory/raw_ptr.h"
#include "base/threading/thread.h"
#include "content/common/content_export.h"
#include "content/common/in_process_child_thread_params.h"
#include "gpu/config/gpu_preferences.h"
namespace content {
class ChildProcess;
#if BUILDFLAG(IS_OHOS)
void TryForReportThread();
int32_t GetGpuThreadId(int32_t pid);
int32_t GetTidListByName(int32_t pid, const std::string& thread_name);
bool LoadStringFromFile(const std::string& file_path, std::string& content);
#endif
class InProcessGpuThread : public base::Thread {
public:
explicit InProcessGpuThread(const InProcessChildThreadParams& params,
const gpu::GpuPreferences& gpu_preferences);
InProcessGpuThread(const InProcessGpuThread&) = delete;
InProcessGpuThread& operator=(const InProcessGpuThread&) = delete;
~InProcessGpuThread() override;
protected:
void Init() override;
void CleanUp() override;
private:
InProcessChildThreadParams params_;
std::unique_ptr<ChildProcess> gpu_process_;
gpu::GpuPreferences gpu_preferences_;
};
CONTENT_EXPORT base::Thread* CreateInProcessGpuThread(
const InProcessChildThreadParams& params,
const gpu::GpuPreferences& gpu_preferences);
}
#endif