Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(769)

Unified Diff: components/dom_distiller/core/distillable_page_detector.cc

Issue 1405233009: Add a new distillability model for the new set of page features (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address mdjones' comments Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/dom_distiller/core/distillable_page_detector.cc
diff --git a/components/dom_distiller/core/distillable_page_detector.cc b/components/dom_distiller/core/distillable_page_detector.cc
index aa7ddcf302e0fa516611e7f600fb69acd63ba9a9..43499a7052275393ac2fece661cdd80f3b7faa5a 100644
--- a/components/dom_distiller/core/distillable_page_detector.cc
+++ b/components/dom_distiller/core/distillable_page_detector.cc
@@ -24,6 +24,20 @@ const DistillablePageDetector* DistillablePageDetector::GetDefault() {
return detector;
}
+const DistillablePageDetector* DistillablePageDetector::GetNewModel() {
+ static DistillablePageDetector* detector = nullptr;
+ if (!detector) {
+ std::string serialized_proto =
+ ResourceBundle::GetSharedInstance()
+ .GetRawDataResource(IDR_DISTILLABLE_PAGE_SERIALIZED_MODEL_NEW)
+ .as_string();
+ scoped_ptr<AdaBoostProto> proto(new AdaBoostProto);
+ CHECK(proto->ParseFromString(serialized_proto));
+ detector = new DistillablePageDetector(proto.Pass());
+ }
+ return detector;
+}
+
DistillablePageDetector::DistillablePageDetector(
scoped_ptr<AdaBoostProto> proto)
: proto_(proto.Pass()), threshold_(0.0) {
« no previous file with comments | « components/dom_distiller/core/distillable_page_detector.h ('k') | components/resources/dom_distiller_resources.grdp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698