chromium/chrome/browser/sessions/tab_loader.cc

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

#include "chrome/browser/sessions/tab_loader.h"

#include <algorithm>

#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/memory/memory_pressure_monitor.h"
#include "base/memory/raw_ptr.h"
#include "base/no_destructor.h"
#include "base/not_fatal_until.h"
#include "base/system/sys_info.h"
#include "base/time/default_tick_clock.h"
#include "base/trace_event/memory_pressure_level_proto.h"
#include "base/trace_event/named_trigger.h"
#include "base/trace_event/typed_macros.h"
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/sessions/session_restore.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_list.h"
#include "components/favicon/content/content_favicon_driver.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_features.h"

WebContents;
TabLoadTracker;

namespace {

void BackgroundTracingTrigger() {}

const base::TickClock* GetDefaultTickClock() {}

// An implementation of operator< for scored tabs.
struct ScoredTabComparator {};

// Testing seams.
size_t g_max_loaded_tab_count_for_testing =;
base::RepeatingCallback<void(TabLoader*)>* g_construction_callback =;

// Determines if the given browser (can be null) is closing.
bool IsBrowserClosing(Browser* browser) {}

}  // namespace

// Used for performing lifetime management of the tab loader. Maintains entry
// point counts and also initiates self-destruction of a finished TabLoader.
class TabLoader::ReentrancyHelper {};

// static
TabLoader* TabLoader::shared_tab_loader_ =;

// static
void TabLoader::RestoreTabs(const std::vector<RestoredTab>& tabs,
                            const base::TimeTicks& restore_started) {}

// static
void TabLoader::SetMaxLoadedTabCountForTesting(size_t value) {}

// static
void TabLoader::SetConstructionCallbackForTesting(
    base::RepeatingCallback<void(TabLoader*)>* callback) {}

void TabLoader::SetMaxSimultaneousLoadsForTesting(size_t loading_slots) {}

void TabLoader::SetTickClockForTesting(base::TickClock* tick_clock) {}

void TabLoader::MaybeLoadSomeTabsForTesting() {}

void TabLoader::SetTabLoadingEnabledCallbackForTesting(
    base::RepeatingCallback<void(bool)>* callback) {}

bool TabLoader::IsLoadingEnabled() const {}

void TabLoader::OnIsLoadingEnabledChanged() {}

void TabLoader::SetAllTabsScored(bool all_tabs_scored) {}

TabLoader::TabLoader()
    :{}

TabLoader::~TabLoader() {}

void TabLoader::SetTabLoadingEnabled(bool loading_enabled) {}

void TabLoader::NotifyTabScoreChanged(content::WebContents* contents,
                                      float score) {}

void TabLoader::StartLoading(const std::vector<RestoredTab>& tabs) {}

void TabLoader::OnLoadingStateChange(WebContents* contents,
                                     LoadingState old_loading_state,
                                     LoadingState new_loading_state) {}

void TabLoader::OnStopTracking(WebContents* web_contents,
                               LoadingState loading_state) {}

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

bool TabLoader::ShouldStopLoadingTabs() const {}

size_t TabLoader::GetMaxNewTabLoads() const {}

void TabLoader::AddTab(WebContents* contents) {}

void TabLoader::RemoveTab(WebContents* contents) {}

void TabLoader::MarkTabAsLoadInitiated(WebContents* contents) {}

void TabLoader::MarkTabAsLoading(WebContents* contents) {}

void TabLoader::MarkTabAsDeferred(content::WebContents* contents) {}

void TabLoader::MaybeLoadSomeTabs() {}

void TabLoader::ForceLoadTimerFired() {}

void TabLoader::StopLoadingTabs() {}

content::WebContents* TabLoader::GetNextTabToLoad() {}

void TabLoader::LoadNextTab(bool due_to_timeout) {}

base::TimeDelta TabLoader::GetLoadTimeoutPeriod() const {}

void TabLoader::StartTimerIfNeeded() {}

TabLoader::TabVector::iterator TabLoader::FindTabToLoad(
    content::WebContents* contents) {}

TabLoader::TabVector::const_iterator TabLoader::FindTabToLoad(
    content::WebContents* contents) const {}

void TabLoader::MoveToSortedPosition(TabVector::iterator it) {}

size_t TabLoader::MaxSimultaneousLoads() const {}