#include "third_party/blink/renderer/core/html/media/autoplay_uma_helper.h"
#include "base/metrics/histogram_functions.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "services/metrics/public/cpp/ukm_recorder.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/events/event.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/settings.h"
#include "third_party/blink/renderer/core/html/media/autoplay_policy.h"
#include "third_party/blink/renderer/core/html/media/html_media_element.h"
#include "third_party/blink/renderer/core/html/media/html_video_element.h"
#include "third_party/blink/renderer/core/intersection_observer/intersection_observer.h"
#include "third_party/blink/renderer/core/intersection_observer/intersection_observer_entry.h"
#include "third_party/blink/renderer/core/page/page.h"
#include "third_party/blink/renderer/platform/instrumentation/histogram.h"
#include "third_party/blink/renderer/platform/instrumentation/use_counter.h"
#include "third_party/blink/renderer/platform/network/network_state_notifier.h"
namespace blink {
namespace {
constexpr base::TimeDelta kMaxOffscreenDurationUma = …;
constexpr int32_t kOffscreenDurationUmaBucketCount = …;
int64_t GetUserGestureStatusForUkmMetric(LocalFrame* frame) { … }
}
AutoplayUmaHelper::AutoplayUmaHelper(HTMLMediaElement* element)
: … { … }
AutoplayUmaHelper::~AutoplayUmaHelper() = default;
static void RecordAutoplaySourceMetrics(HTMLMediaElement* element,
AutoplaySource source) { … }
void AutoplayUmaHelper::OnAutoplayInitiated(AutoplaySource source) { … }
void AutoplayUmaHelper::RecordAutoplayUnmuteStatus(
AutoplayUnmuteActionStatus status) { … }
void AutoplayUmaHelper::VideoWillBeDrawnToCanvas() { … }
void AutoplayUmaHelper::DidMoveToNewDocument(Document& old_document) { … }
void AutoplayUmaHelper::
OnIntersectionChangedForMutedVideoPlayMethodBecomeVisible(
const HeapVector<Member<IntersectionObserverEntry>>& entries) { … }
void AutoplayUmaHelper::OnIntersectionChangedForMutedVideoOffscreenDuration(
const HeapVector<Member<IntersectionObserverEntry>>& entries) { … }
void AutoplayUmaHelper::Invoke(ExecutionContext* execution_context,
Event* event) { … }
void AutoplayUmaHelper::HandlePlayingEvent() { … }
void AutoplayUmaHelper::HandlePauseEvent() { … }
void AutoplayUmaHelper::ContextDestroyed() { … }
void AutoplayUmaHelper::HandleContextDestroyed() { … }
void AutoplayUmaHelper::MaybeStartRecordingMutedVideoPlayMethodBecomeVisible() { … }
void AutoplayUmaHelper::MaybeStopRecordingMutedVideoPlayMethodBecomeVisible(
bool visible) { … }
void AutoplayUmaHelper::MaybeStartRecordingMutedVideoOffscreenDuration() { … }
void AutoplayUmaHelper::MaybeStopRecordingMutedVideoOffscreenDuration() { … }
void AutoplayUmaHelper::MaybeUnregisterContextDestroyedObserver() { … }
void AutoplayUmaHelper::MaybeUnregisterMediaElementPauseListener() { … }
bool AutoplayUmaHelper::ShouldListenToContextDestroyed() const { … }
void AutoplayUmaHelper::Trace(Visitor* visitor) const { … }
}