#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "chrome/browser/resource_coordinator/tab_memory_metrics_reporter.h"
#include <cstdint>
#include <memory>
#include "base/process/process.h"
#include "base/time/time.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/metrics/process_memory_metrics_emitter.h"
#include "chrome/browser/resource_coordinator/tab_load_tracker.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
namespace resource_coordinator {
TabMemoryMetricsReporter::TabMemoryMetricsReporter() = default;
TabMemoryMetricsReporter::~TabMemoryMetricsReporter() = default;
TabMemoryMetricsReporter::TabMemoryMetricsReporter(
const base::TickClock* tick_clock)
: … { … }
void TabMemoryMetricsReporter::StartReporting(TabLoadTracker* tracker) { … }
void TabMemoryMetricsReporter::OnStartTracking(
content::WebContents* web_contents,
TabLoadTracker::LoadingState loading_state) { … }
void TabMemoryMetricsReporter::OnLoadingStateChange(
content::WebContents* web_contents,
TabLoadTracker::LoadingState old_loading_state,
LoadingState new_loading_state) { … }
void TabMemoryMetricsReporter::RemoveWebContentsDataFromMonitoredListIfExists(
content::WebContents* web_contents) { … }
void TabMemoryMetricsReporter::MonitorWebContents(
content::WebContents* web_contents) { … }
void TabMemoryMetricsReporter::OnStopTracking(
content::WebContents* web_contents,
TabLoadTracker::LoadingState loading_state) { … }
void TabMemoryMetricsReporter::UpdateTimerCallback() { … }
void TabMemoryMetricsReporter::RestartTimerIfNeeded(
base::TimeTicks current_time) { … }
bool TabMemoryMetricsReporter::EmitMemoryMetricsAfterPageLoaded(
const TabMemoryMetricsReporter::WebContentsData& content_data) { … }
base::TimeDelta TabMemoryMetricsReporter::NextEmitTimeAfterPageLoaded(
TabMemoryMetricsReporter::ReportState state) { … }
TabMemoryMetricsReporter::ReportState
TabMemoryMetricsReporter::NextStateOfEmitMemoryDumpAfterPageLoaded(
base::TimeDelta time_passed) { … }
bool TabMemoryMetricsReporter::WebContentsDataComparator::operator()(
const WebContentsData& a,
const WebContentsData& b) const { … }
}