#include "components/safe_browsing/core/browser/hash_realtime_mechanism.h"
#include "base/metrics/histogram_functions.h"
#include "base/task/sequenced_task_runner.h"
#include "components/safe_browsing/core/browser/db/database_manager.h"
#include "components/safe_browsing/core/browser/db/util.h"
#include "components/safe_browsing/core/browser/db/v4_protocol_manager_util.h"
#include "components/safe_browsing/core/browser/safe_browsing_lookup_mechanism.h"
#include "components/safe_browsing/core/common/utils.h"
namespace safe_browsing {
HashRealTimeMechanism::HashRealTimeMechanism(
const GURL& url,
const SBThreatTypeSet& threat_types,
scoped_refptr<SafeBrowsingDatabaseManager> database_manager,
scoped_refptr<base::SequencedTaskRunner> ui_task_runner,
base::WeakPtr<HashRealTimeService> lookup_service_on_ui)
: … { … }
HashRealTimeMechanism::~HashRealTimeMechanism() { … }
SafeBrowsingLookupMechanism::StartCheckResult
HashRealTimeMechanism::StartCheckInternal() { … }
void HashRealTimeMechanism::OnCheckUrlForHighConfidenceAllowlist(
bool did_match_allowlist) { … }
void HashRealTimeMechanism::StartLookupOnUIThread(
base::WeakPtr<HashRealTimeMechanism> weak_ptr_on_io,
const GURL& url,
base::WeakPtr<HashRealTimeService> lookup_service_on_ui,
scoped_refptr<base::SequencedTaskRunner> io_task_runner) { … }
void HashRealTimeMechanism::OnLookupResponse(
bool is_lookup_successful,
std::optional<SBThreatType> threat_type) { … }
void HashRealTimeMechanism::PerformHashBasedCheck(
const GURL& url,
HashDatabaseFallbackTrigger fallback_trigger) { … }
void HashRealTimeMechanism::OnHashDatabaseCompleteCheckResult(
HashDatabaseFallbackTrigger fallback_trigger,
std::unique_ptr<SafeBrowsingLookupMechanism::CompleteCheckResult> result) { … }
void HashRealTimeMechanism::OnHashDatabaseCompleteCheckResultInternal(
SBThreatType threat_type,
const ThreatMetadata& metadata,
std::optional<ThreatSource> threat_source,
HashDatabaseFallbackTrigger fallback_trigger) { … }
}