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..ee96f7608d18865bf47ceb5d58b72acc36342e64 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::GetNewDefault() { |
+ 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) { |