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

Unified Diff: components/dom_distiller/core/fake_distiller.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
« no previous file with comments | « components/dom_distiller/core/fake_distiller.h ('k') | components/dom_distiller/core/fake_distiller_page.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/dom_distiller/core/fake_distiller.cc
diff --git a/components/dom_distiller/core/fake_distiller.cc b/components/dom_distiller/core/fake_distiller.cc
index 315490a49f2d6fd22f997b3bb321c639e825a3b7..077d08f7bab6bb0c12fbd09da060056347c5a2dc 100644
--- a/components/dom_distiller/core/fake_distiller.cc
+++ b/components/dom_distiller/core/fake_distiller.cc
@@ -42,7 +42,7 @@ FakeDistiller::~FakeDistiller() {
void FakeDistiller::DistillPage(
const GURL& url,
- scoped_ptr<DistillerPage> distiller_page,
+ std::unique_ptr<DistillerPage> distiller_page,
const DistillationFinishedCallback& article_callback,
const DistillationUpdateCallback& page_callback) {
url_ = url;
@@ -52,14 +52,14 @@ void FakeDistiller::DistillPage(
base::ResetAndReturn(&distillation_initiated_callback_).Run();
}
if (execute_callback_) {
- scoped_ptr<DistilledArticleProto> proto(new DistilledArticleProto);
+ std::unique_ptr<DistilledArticleProto> proto(new DistilledArticleProto);
proto->add_pages()->set_url(url_.spec());
PostDistillerCallback(std::move(proto));
}
}
void FakeDistiller::RunDistillerCallback(
- scoped_ptr<DistilledArticleProto> proto) {
+ std::unique_ptr<DistilledArticleProto> proto) {
ASSERT_FALSE(execute_callback_) << "Cannot explicitly run the distiller "
"callback for a fake distiller created "
"with automatic callback execution.";
@@ -71,16 +71,15 @@ void FakeDistiller::RunDistillerUpdateCallback(
page_callback_.Run(update);
}
-
void FakeDistiller::PostDistillerCallback(
- scoped_ptr<DistilledArticleProto> proto) {
+ std::unique_ptr<DistilledArticleProto> proto) {
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::Bind(&FakeDistiller::RunDistillerCallbackInternal,
base::Unretained(this), base::Passed(&proto)));
}
void FakeDistiller::RunDistillerCallbackInternal(
- scoped_ptr<DistilledArticleProto> proto) {
+ std::unique_ptr<DistilledArticleProto> proto) {
EXPECT_FALSE(article_callback_.is_null());
base::AutoReset<bool> dont_delete_this_in_callback(&destruction_allowed_,
« no previous file with comments | « components/dom_distiller/core/fake_distiller.h ('k') | components/dom_distiller/core/fake_distiller_page.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698