chromium/third_party/blink/renderer/core/html/media/autoplay_uma_helper.cc

// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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 =;

// Returns a int64_t with the following structure:
// 0b0001 set if there is a user gesture on the stack.
// 0b0010 set if there was a user gesture on the page.
// 0b0100 set if there was a user gesture propagated after navigation.
int64_t GetUserGestureStatusForUkmMetric(LocalFrame* frame) {}

}  // namespace

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 {}

}  // namespace blink