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

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

Issue 1879613003: Convert //components/dom_distiller from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 months 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 5c2a7ee0125178ee53b7d6f8c547a1e38fb94c26..f116546ff5e6bbd992793ca20fc11c5452cfbc09 100644
--- a/components/dom_distiller/core/distillable_page_detector.cc
+++ b/components/dom_distiller/core/distillable_page_detector.cc
@@ -20,7 +20,7 @@ const DistillablePageDetector* DistillablePageDetector::GetDefault() {
ResourceBundle::GetSharedInstance()
.GetRawDataResource(IDR_DISTILLABLE_PAGE_SERIALIZED_MODEL)
.as_string();
- scoped_ptr<AdaBoostProto> proto(new AdaBoostProto);
+ std::unique_ptr<AdaBoostProto> proto(new AdaBoostProto);
CHECK(proto->ParseFromString(serialized_proto));
detector = new DistillablePageDetector(std::move(proto));
}
@@ -34,7 +34,7 @@ const DistillablePageDetector* DistillablePageDetector::GetNewModel() {
ResourceBundle::GetSharedInstance()
.GetRawDataResource(IDR_DISTILLABLE_PAGE_SERIALIZED_MODEL_NEW)
.as_string();
- scoped_ptr<AdaBoostProto> proto(new AdaBoostProto);
+ std::unique_ptr<AdaBoostProto> proto(new AdaBoostProto);
CHECK(proto->ParseFromString(serialized_proto));
detector = new DistillablePageDetector(std::move(proto));
}
@@ -48,7 +48,7 @@ const DistillablePageDetector* DistillablePageDetector::GetLongPageModel() {
ResourceBundle::GetSharedInstance()
.GetRawDataResource(IDR_LONG_PAGE_SERIALIZED_MODEL)
.as_string();
- scoped_ptr<AdaBoostProto> proto(new AdaBoostProto);
+ std::unique_ptr<AdaBoostProto> proto(new AdaBoostProto);
CHECK(proto->ParseFromString(serialized_proto));
detector = new DistillablePageDetector(std::move(proto));
}
@@ -56,7 +56,7 @@ const DistillablePageDetector* DistillablePageDetector::GetLongPageModel() {
}
DistillablePageDetector::DistillablePageDetector(
- scoped_ptr<AdaBoostProto> proto)
+ std::unique_ptr<AdaBoostProto> proto)
: proto_(std::move(proto)), threshold_(0.0) {
CHECK(proto_->num_stumps() == proto_->stump_size());
for (int i = 0; i < proto_->num_stumps(); ++i) {

Powered by Google App Engine
This is Rietveld 408576698