#include "components/dom_distiller/content/renderer/distillability_agent.h"
#include "base/json/json_writer.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/string_util.h"
#include "components/dom_distiller/content/common/mojom/distillability_service.mojom.h"
#include "components/dom_distiller/core/distillable_page_detector.h"
#include "components/dom_distiller/core/experiments.h"
#include "components/dom_distiller/core/page_features.h"
#include "components/dom_distiller/core/url_utils.h"
#include "content/public/renderer/render_frame.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "third_party/blink/public/platform/browser_interface_broker_proxy.h"
#include "third_party/blink/public/platform/web_distillability.h"
#include "third_party/blink/public/web/web_document.h"
#include "third_party/blink/public/web/web_element.h"
#include "third_party/blink/public/web/web_local_frame.h"
namespace dom_distiller {
namespace {
const char* const kFilterlist[] = …;
bool NeedToUpdate(bool is_loaded) { … }
bool IsLast(bool is_loaded) { … }
bool IsFiltered(const GURL& url) { … }
void DumpDistillability(content::RenderFrame* render_frame,
const blink::WebDistillabilityFeatures& features,
const std::vector<double>& derived,
double score,
bool distillable,
double long_score,
bool long_page,
bool filtered) { … }
bool IsDistillablePageAdaboost(blink::WebDocument& doc,
const DistillablePageDetector* detector,
const DistillablePageDetector* long_page,
bool is_last,
bool& is_long_article,
bool& is_mobile_friendly,
content::RenderFrame* render_frame,
bool dump_info) { … }
bool IsDistillablePage(blink::WebDocument& doc,
bool is_last,
bool& is_long_article,
bool& is_mobile_friendly,
content::RenderFrame* render_frame,
bool dump_info) { … }
}
DistillabilityAgent::DistillabilityAgent(content::RenderFrame* render_frame,
bool dump_info)
: … { … }
void DistillabilityAgent::DidMeaningfulLayout(
blink::WebMeaningfulLayout layout_type) { … }
DistillabilityAgent::~DistillabilityAgent() { … }
void DistillabilityAgent::OnDestruct() { … }
}