#include "content/browser/scheduler/responsiveness/jank_monitor_impl.h"
#include "base/compiler_specific.h"
#include "base/observer_list.h"
#include "base/task/thread_pool.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "ui/base/ui_base_features.h"
namespace content {
JankMonitor::~JankMonitor() = default;
JankMonitor::Observer::~Observer() = default;
scoped_refptr<JankMonitor> JankMonitor::Create() { … }
namespace responsiveness {
static constexpr int64_t kMonitorCheckIntervalMs = …;
static constexpr int64_t kJankThresholdMs = …;
static constexpr int64_t kInactivityThresholdUs = …;
JankMonitorImpl::JankMonitorImpl()
: … { … }
JankMonitorImpl::~JankMonitorImpl() = default;
void JankMonitorImpl::AddObserver(content::JankMonitor::Observer* observer) { … }
void JankMonitorImpl::RemoveObserver(content::JankMonitor::Observer* observer) { … }
void JankMonitorImpl::SetUp() { … }
void JankMonitorImpl::Destroy() { … }
void JankMonitorImpl::FinishDestroyMetricSource() { … }
void JankMonitorImpl::SetUpOnIOThread() { … }
void JankMonitorImpl::TearDownOnUIThread() { … }
void JankMonitorImpl::TearDownOnIOThread() { … }
void JankMonitorImpl::WillRunTaskOnUIThread(
const base::PendingTask* task,
bool ) { … }
void JankMonitorImpl::DidRunTaskOnUIThread(const base::PendingTask* task) { … }
void JankMonitorImpl::WillRunTaskOnIOThread(
const base::PendingTask* task,
bool ) { … }
void JankMonitorImpl::DidRunTaskOnIOThread(const base::PendingTask* task) { … }
void JankMonitorImpl::WillRunEventOnUIThread(const void* opaque_identifier) { … }
void JankMonitorImpl::DidRunEventOnUIThread(const void* opaque_identifier) { … }
void JankMonitorImpl::WillRunTaskOrEvent(
ThreadExecutionState* thread_exec_state,
const void* opaque_identifier) { … }
void JankMonitorImpl::DidRunTaskOrEvent(ThreadExecutionState* thread_exec_state,
const void* opaque_identifier) { … }
void JankMonitorImpl::StartTimerIfNecessary() { … }
void JankMonitorImpl::StopTimerIfIdle() { … }
std::unique_ptr<MetricSource> JankMonitorImpl::CreateMetricSource() { … }
void JankMonitorImpl::DestroyOnMonitorThread() { … }
bool JankMonitorImpl::timer_running() const { … }
void JankMonitorImpl::OnCheckJankiness() { … }
void JankMonitorImpl::OnJankStarted(const void* opaque_identifier) { … }
void JankMonitorImpl::OnJankStopped(
MayBeDangling<const void> opaque_identifier) { … }
void JankMonitorImpl::NotifyJankStopIfNecessary(const void* opaque_identifier) { … }
JankMonitorImpl::ThreadExecutionState::TaskMetadata::~TaskMetadata() = default;
JankMonitorImpl::ThreadExecutionState::ThreadExecutionState() { … }
JankMonitorImpl::ThreadExecutionState::~ThreadExecutionState() = default;
std::optional<const void*>
JankMonitorImpl::ThreadExecutionState::CheckJankiness() { … }
void JankMonitorImpl::ThreadExecutionState::WillRunTaskOrEvent(
const void* opaque_identifier) { … }
void JankMonitorImpl::ThreadExecutionState::DidRunTaskOrEvent(
const void* opaque_identifier) { … }
void JankMonitorImpl::ThreadExecutionState::AssertOnTargetThread() { … }
}
}