| 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) {
|
|
|