#include "components/safe_browsing/content/renderer/phishing_classifier/phishing_term_feature_extractor.h"
#include <list>
#include <map>
#include <memory>
#include <string_view>
#include <unordered_set>
#include <utility>
#include "base/compiler_specific.h"
#include "base/functional/bind.h"
#include "base/i18n/break_iterator.h"
#include "base/i18n/case_conversion.h"
#include "base/location.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/single_thread_task_runner.h"
#include "base/time/default_tick_clock.h"
#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
#include "components/safe_browsing/content/renderer/phishing_classifier/features.h"
#include "components/safe_browsing/content/renderer/phishing_classifier/murmurhash3_util.h"
#include "crypto/sha2.h"
namespace safe_browsing {
const int PhishingTermFeatureExtractor::kMaxTimePerChunkMs = …;
const int PhishingTermFeatureExtractor::kClockCheckGranularity = …;
const int PhishingTermFeatureExtractor::kMaxTotalTimeMs = …;
struct PhishingTermFeatureExtractor::ExtractionState { … };
PhishingTermFeatureExtractor::PhishingTermFeatureExtractor(
base::RepeatingCallback<bool(const std::string&)> find_page_term_callback,
base::RepeatingCallback<bool(uint32_t)> find_page_word_callback,
size_t max_words_per_term,
uint32_t murmurhash3_seed,
size_t max_shingles_per_page,
size_t shingle_size)
: … { … }
PhishingTermFeatureExtractor::~PhishingTermFeatureExtractor() { … }
void PhishingTermFeatureExtractor::ExtractFeatures(
const std::u16string* page_text,
FeatureMap* features,
std::set<uint32_t>* shingle_hashes,
DoneCallback done_callback) { … }
void PhishingTermFeatureExtractor::CancelPendingExtraction() { … }
void PhishingTermFeatureExtractor::ExtractFeaturesWithTimeout() { … }
void PhishingTermFeatureExtractor::HandleWord(std::u16string_view word) { … }
void PhishingTermFeatureExtractor::RunCallback(bool success) { … }
void PhishingTermFeatureExtractor::Clear() { … }
}