chromium/content/browser/renderer_host/navigation_transitions/navigation_entry_screenshot_manager.cc

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

#include "content/browser/renderer_host/navigation_transitions/navigation_entry_screenshot_manager.h"

#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_functions.h"
#include "base/system/sys_info.h"
#include "base/task/thread_pool.h"
#include "base/time/default_tick_clock.h"
#include "content/browser/renderer_host/navigation_transitions/navigation_entry_screenshot.h"
#include "content/browser/renderer_host/navigation_transitions/navigation_entry_screenshot_cache.h"
#include "content/browser/renderer_host/navigation_transitions/navigation_transition_config.h"
#include "content/browser/renderer_host/navigation_transitions/navigation_transition_utils.h"
#include "services/resource_coordinator/public/cpp/memory_instrumentation/browser_metrics.h"
#include "ui/display/screen.h"

namespace content {

NavigationEntryScreenshotManager::NavigationEntryScreenshotManager()
    :{}

NavigationEntryScreenshotManager::~NavigationEntryScreenshotManager() = default;

void NavigationEntryScreenshotManager::OnScreenshotCached(
    NavigationEntryScreenshotCacheEvictor* cache,
    size_t size) {}

void NavigationEntryScreenshotManager::OnScreenshotRemoved(
    NavigationEntryScreenshotCacheEvictor* cache,
    size_t size) {}

void NavigationEntryScreenshotManager::OnScreenshotCompressed(
    NavigationEntryScreenshotCacheEvictor* cache,
    size_t old_size,
    size_t new_size) {}

void NavigationEntryScreenshotManager::OnVisibilityChanged(
    NavigationEntryScreenshotCacheEvictor* cache) {}

bool NavigationEntryScreenshotManager::IsEmpty() const {}

void NavigationEntryScreenshotManager::Register(
    NavigationEntryScreenshotCacheEvictor* cache) {}

void NavigationEntryScreenshotManager::Unregister(
    NavigationEntryScreenshotCacheEvictor* cache) {}

base::TimeTicks NavigationEntryScreenshotManager::Now() const {}

void NavigationEntryScreenshotManager::ScheduleCleanup(
    base::TimeTicks last_visible_time) {}

void NavigationEntryScreenshotManager::RunCleanup() {}

// The current implementation iterates through the tabs in the LRU order and
// evict screenshots from each tab, until either the global size satisfies the
// budget, or the cache of the current tab is empty.
//
// One alternative is to always evict the navigation entries in LRU order,
// regardless of which tab the entry is from. The pro of this alternative is to
// have all the eviction logic inside the global manager.
void NavigationEntryScreenshotManager::EvictIfOutOfMemoryBudget() {}

void NavigationEntryScreenshotManager::OnMemoryPressure(
    base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level) {}

void NavigationEntryScreenshotManager::RecordScreenshotCacheSizeAfterDelay() {}

void NavigationEntryScreenshotManager::RecordScreenshotCacheSize() {}

}  // namespace content