chromium/components/visitedlink/browser/visitedlink_event_listener.cc

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

#include "components/visitedlink/browser/visitedlink_event_listener.h"

#include <memory>

#include "base/functional/bind.h"
#include "base/metrics/histogram_functions.h"
#include "base/time/time.h"
#include "components/visitedlink/browser/visitedlink_delegate.h"
#include "components/visitedlink/common/visitedlink.mojom.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_widget_host.h"
#include "content/public/browser/render_widget_host_iterator.h"
#include "mojo/public/cpp/bindings/remote.h"

Time;
RenderWidgetHost;

namespace {

// The amount of time we wait to accumulate visited link additions.
constexpr int kCommitIntervalMs =;

// Size of the buffer after which individual link updates deemed not warranted
// and the overall update should be used instead.
const unsigned kVisitedLinkBufferThreshold =;

// A helper function to obtain the relevant origin salt from the
// PartitionedVisitedLinkWriter while checking for null values as necessary.
uint64_t OriginSaltHelper(
    raw_ptr<visitedlink::PartitionedVisitedLinkWriter> partitioned_writer,
    const url::Origin& origin) {}

}  // namespace

namespace visitedlink {

// This class manages buffering and sending visited link hashes (fingerprints)
// to renderer based on widget visibility.
// As opposed to the VisitedLinkEventListener, which coalesces to
// reduce the rate of messages being sent to render processes, this class
// ensures that the updates occur only when explicitly requested. This is
// used for RenderProcessHostImpl to only send Add/Reset link events to the
// renderers when their tabs are visible and the corresponding RenderViews are
// created.
class VisitedLinkUpdater {};

VisitedLinkEventListener::VisitedLinkEventListener(
    content::BrowserContext* browser_context)
    :{}

VisitedLinkEventListener::VisitedLinkEventListener(
    content::BrowserContext* browser_context,
    PartitionedVisitedLinkWriter* partitioned_writer)
    :{}

VisitedLinkEventListener::~VisitedLinkEventListener() {}

void VisitedLinkEventListener::NewTable(
    base::ReadOnlySharedMemoryRegion* table_region) {}

void VisitedLinkEventListener::Add(VisitedLinkWriter::Fingerprint fingerprint) {}

void VisitedLinkEventListener::Reset(bool invalidate_hashes) {}

// TODO(crbug.com/349610460): Consider the performance of this
// function when a restore is performed on a large number of tabs. We are most
// interested in considering this when the profile has a large number of
// :visited links it must pull from the VisitedLinkDatabase to build the
// PartitionedVisitedLink hashtable on the DB thread.
//
// TODO(crbug.com/349618663): consider BFCache restores for redirect chains
// that took place during table build and how they recover their salts.
void VisitedLinkEventListener::UpdateOriginSalts() {}

void VisitedLinkEventListener::SetCoalesceTimerForTest(
    base::OneShotTimer* coalesce_timer_override) {}

void VisitedLinkEventListener::CommitVisitedLinks() {}

void VisitedLinkEventListener::OnRenderProcessHostCreated(
    content::RenderProcessHost* rph) {}

void VisitedLinkEventListener::RenderProcessHostDestroyed(
    content::RenderProcessHost* host) {}

void VisitedLinkEventListener::RenderWidgetHostVisibilityChanged(
    content::RenderWidgetHost* rwh,
    bool became_visible) {}

void VisitedLinkEventListener::RenderWidgetHostDestroyed(
    content::RenderWidgetHost* rwh) {}

}  // namespace visitedlink