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

// Copyright 2018 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/video_wake_lock.h"

#include "base/task/single_thread_task_runner.h"
#include "third_party/blink/public/mojom/wake_lock/wake_lock.mojom-blink.h"
#include "third_party/blink/public/platform/browser_interface_broker_proxy.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/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/picture_in_picture_controller.h"
#include "third_party/blink/renderer/core/geometry/dom_rect_read_only.h"
#include "third_party/blink/renderer/core/html/media/html_video_element.h"
#include "third_party/blink/renderer/core/html/media/remote_playback_controller.h"
#include "third_party/blink/renderer/core/intersection_observer/intersection_observer_entry.h"
#include "third_party/blink/renderer/core/page/page.h"

namespace blink {

namespace {

// Require most of the video to be onscreen. For simplicity this is the same
// threshold we use for rotate-for-fullscreen.
constexpr float kStrictVisibilityThreshold =;

// A YouTube embed works out to ~24% of the root window, so round down to 20% to
// ensure we aren't taking the wake lock for videos that are too small.
constexpr float kSizeThreshold =;

Page* GetContainingPage(HTMLVideoElement& video) {}

}  // namespace

VideoWakeLock::VideoWakeLock(HTMLVideoElement& video)
    :{}

void VideoWakeLock::ElementDidMoveToNewDocument() {}

void VideoWakeLock::PageVisibilityChanged() {}

void VideoWakeLock::OnVisibilityChanged(
    const HeapVector<Member<IntersectionObserverEntry>>& entries) {}

void VideoWakeLock::OnSizeChanged(
    const HeapVector<Member<IntersectionObserverEntry>>& entries) {}

void VideoWakeLock::Trace(Visitor* visitor) const {}

void VideoWakeLock::Invoke(ExecutionContext*, Event* event) {}

void VideoWakeLock::OnRemotePlaybackStateChanged(
    mojom::blink::PresentationConnectionState state) {}

void VideoWakeLock::ContextLifecycleStateChanged(mojom::FrameLifecycleState) {}

void VideoWakeLock::ContextDestroyed() {}

float VideoWakeLock::GetSizeThresholdForTests() const {}

void VideoWakeLock::Update() {}

bool VideoWakeLock::ShouldBeActive() const {}

void VideoWakeLock::EnsureWakeLockService() {}

void VideoWakeLock::OnConnectionError() {}

void VideoWakeLock::UpdateWakeLockService() {}

void VideoWakeLock::StartIntersectionObserver() {}

}  // namespace blink