chromium/components/safe_browsing/content/renderer/phishing_classifier/phishing_dom_feature_extractor.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/safe_browsing/content/renderer/phishing_classifier/phishing_dom_feature_extractor.h"

#include <memory>
#include <utility>

#include "base/compiler_specific.h"
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/string_util.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 "net/base/registry_controlled_domains/registry_controlled_domain.h"
#include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/public/web/web_element.h"
#include "third_party/blink/public/web/web_element_collection.h"
#include "third_party/blink/public/web/web_local_frame.h"
#include "third_party/blink/public/web/web_view.h"

namespace safe_browsing {

// This time should be short enough that it doesn't noticeably disrupt the
// user's interaction with the page.
const int PhishingDOMFeatureExtractor::kMaxTimePerChunkMs =;

// Experimenting shows that we get a reasonable gain in performance by
// increasing this up to around 10, but there's not much benefit in
// increasing it past that.
const int PhishingDOMFeatureExtractor::kClockCheckGranularity =;

// This should be longer than we expect feature extraction to take on any
// actual phishing page.
const int PhishingDOMFeatureExtractor::kMaxTotalTimeMs =;

// Intermediate state used for computing features.  See features.h for
// descriptions of the DOM features that are computed.
struct PhishingDOMFeatureExtractor::PageFeatureState {};

// Per-frame state
struct PhishingDOMFeatureExtractor::FrameData {};

PhishingDOMFeatureExtractor::PhishingDOMFeatureExtractor()
    :{}

PhishingDOMFeatureExtractor::~PhishingDOMFeatureExtractor() {}

void PhishingDOMFeatureExtractor::ExtractFeatures(blink::WebDocument document,
                                                  FeatureMap* features,
                                                  DoneCallback done_callback) {}

void PhishingDOMFeatureExtractor::CancelPendingExtraction() {}

void PhishingDOMFeatureExtractor::ExtractFeaturesWithTimeout() {}

void PhishingDOMFeatureExtractor::HandleLink(const blink::WebElement& element) {}

void PhishingDOMFeatureExtractor::HandleForm(const blink::WebElement& element) {}

void PhishingDOMFeatureExtractor::HandleImage(
    const blink::WebElement& element) {}

void PhishingDOMFeatureExtractor::HandleInput(
    const blink::WebElement& element) {}

void PhishingDOMFeatureExtractor::HandleScript(
    const blink::WebElement& element) {}

void PhishingDOMFeatureExtractor::RunCallback(bool success) {}

void PhishingDOMFeatureExtractor::Clear() {}

void PhishingDOMFeatureExtractor::ResetFrameData() {}

blink::WebDocument PhishingDOMFeatureExtractor::GetNextDocument() {}

bool PhishingDOMFeatureExtractor::IsExternalDomain(const GURL& url,
                                                   std::string* domain) const {}

blink::WebURL PhishingDOMFeatureExtractor::CompleteURL(
    const blink::WebElement& element,
    const blink::WebString& partial_url) {}

void PhishingDOMFeatureExtractor::InsertFeatures() {}

}  // namespace safe_browsing