#include "content/public/renderer/render_thread.h"
#include "base/no_destructor.h"
#include "base/threading/thread_checker_impl.h"
#include "third_party/blink/public/mojom/cpu_performance.mojom.h"
namespace content {
namespace {
constinit thread_local RenderThread* render_thread = nullptr;
static const base::ThreadCheckerImpl& GetThreadChecker() {
static base::NoDestructor<base::ThreadCheckerImpl> checker;
return *checker;
}
}
RenderThread* RenderThread::Get() {
return render_thread;
}
bool RenderThread::IsMainThread() {
return GetThreadChecker().CalledOnValidThread();
}
RenderThread::RenderThread() : resetter_(&render_thread, this) {}
RenderThread::~RenderThread() = default;
blink::mojom::PerformanceTier RenderThread::GetCpuPerformanceTier() {
return blink::mojom::PerformanceTier::kUnknown;
}
}