#include "components/no_state_prefetch/browser/no_state_prefetch_link_manager.h"
#include <functional>
#include <limits>
#include <memory>
#include <set>
#include <string>
#include <utility>
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram_macros.h"
#include "base/ranges/algorithm.h"
#include "build/build_config.h"
#include "components/no_state_prefetch/browser/no_state_prefetch_contents.h"
#include "components/no_state_prefetch/browser/no_state_prefetch_handle.h"
#include "components/no_state_prefetch/browser/no_state_prefetch_manager.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/session_storage_namespace.h"
#include "content/public/common/referrer.h"
#include "mojo/public/cpp/bindings/associated_remote.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
#include "ui/gfx/geometry/size.h"
#include "url/gurl.h"
#include "url/origin.h"
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS) && !BUILDFLAG(IS_FUCHSIA)
#include "components/guest_view/browser/guest_view_base.h"
#endif
TimeTicks;
RenderViewHost;
SessionStorageNamespace;
namespace prerender {
namespace {
int GetNextLinkTriggerId() { … }
}
NoStatePrefetchLinkManager::LinkTrigger::LinkTrigger(
int launcher_render_process_id,
int launcher_render_view_id,
blink::mojom::PrerenderAttributesPtr attributes,
const url::Origin& initiator_origin,
base::TimeTicks creation_time,
NoStatePrefetchContents* deferred_launcher)
: … { … }
NoStatePrefetchLinkManager::LinkTrigger::~LinkTrigger() { … }
NoStatePrefetchLinkManager::NoStatePrefetchLinkManager(
NoStatePrefetchManager* manager)
: … { … }
NoStatePrefetchLinkManager::~NoStatePrefetchLinkManager() { … }
std::optional<int> NoStatePrefetchLinkManager::OnStartLinkTrigger(
int launcher_render_process_id,
int launcher_render_view_id,
int launcher_render_frame_id,
blink::mojom::PrerenderAttributesPtr attributes,
const url::Origin& initiator_origin) { … }
void NoStatePrefetchLinkManager::OnCancelLinkTrigger(int link_trigger_id) { … }
void NoStatePrefetchLinkManager::OnAbandonLinkTrigger(int link_trigger_id) { … }
bool NoStatePrefetchLinkManager::IsEmpty() const { … }
bool NoStatePrefetchLinkManager::TriggerIsRunningForTesting(
LinkTrigger* trigger) const { … }
size_t NoStatePrefetchLinkManager::CountRunningTriggers() const { … }
void NoStatePrefetchLinkManager::StartLinkTriggers() { … }
NoStatePrefetchLinkManager::LinkTrigger*
NoStatePrefetchLinkManager::FindByNoStatePrefetchHandle(
NoStatePrefetchHandle* no_state_prefetch_handle) { … }
NoStatePrefetchLinkManager::LinkTrigger*
NoStatePrefetchLinkManager::FindByLinkTriggerId(int link_trigger_id) { … }
void NoStatePrefetchLinkManager::RemoveLinkTrigger(LinkTrigger* trigger) { … }
void NoStatePrefetchLinkManager::CancelLinkTrigger(LinkTrigger* trigger) { … }
void NoStatePrefetchLinkManager::Shutdown() { … }
void NoStatePrefetchLinkManager::OnPrefetchStop(
NoStatePrefetchHandle* no_state_prefetch_handle) { … }
}