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

Unified Diff: ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc

Issue 1861593005: Convert //ios 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: ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc
diff --git a/ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc b/ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc
index 1a7eb1e73c93c14fa9fa1e75e014a3b1ad48db48..e101c6aca8b54275c8d408f37ed05243b334a23f 100644
--- a/ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc
+++ b/ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc
@@ -8,6 +8,7 @@
#include "base/files/file_path.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/memory/singleton.h"
#include "base/threading/sequenced_worker_pool.h"
#include "components/dom_distiller/core/article_entry.h"
@@ -32,10 +33,11 @@ class DomDistillerKeyedService
public dom_distiller::DomDistillerService {
public:
DomDistillerKeyedService(
- scoped_ptr<dom_distiller::DomDistillerStoreInterface> store,
- scoped_ptr<dom_distiller::DistillerFactory> distiller_factory,
- scoped_ptr<dom_distiller::DistillerPageFactory> distiller_page_factory,
- scoped_ptr<dom_distiller::DistilledPagePrefs> distilled_page_prefs)
+ std::unique_ptr<dom_distiller::DomDistillerStoreInterface> store,
+ std::unique_ptr<dom_distiller::DistillerFactory> distiller_factory,
+ std::unique_ptr<dom_distiller::DistillerPageFactory>
+ distiller_page_factory,
+ std::unique_ptr<dom_distiller::DistilledPagePrefs> distilled_page_prefs)
: DomDistillerService(std::move(store),
std::move(distiller_factory),
std::move(distiller_page_factory),
@@ -71,34 +73,36 @@ DomDistillerServiceFactory::DomDistillerServiceFactory()
DomDistillerServiceFactory::~DomDistillerServiceFactory() {
}
-scoped_ptr<KeyedService> DomDistillerServiceFactory::BuildServiceInstanceFor(
+std::unique_ptr<KeyedService>
+DomDistillerServiceFactory::BuildServiceInstanceFor(
web::BrowserState* context) const {
scoped_refptr<base::SequencedTaskRunner> background_task_runner =
web::WebThread::GetBlockingPool()->GetSequencedTaskRunner(
web::WebThread::GetBlockingPool()->GetSequenceToken());
- scoped_ptr<leveldb_proto::ProtoDatabaseImpl<ArticleEntry>> db(
+ std::unique_ptr<leveldb_proto::ProtoDatabaseImpl<ArticleEntry>> db(
new leveldb_proto::ProtoDatabaseImpl<ArticleEntry>(
background_task_runner));
base::FilePath database_dir(
context->GetStatePath().Append(FILE_PATH_LITERAL("Articles")));
- scoped_ptr<DomDistillerStore> dom_distiller_store(
+ std::unique_ptr<DomDistillerStore> dom_distiller_store(
new DomDistillerStore(std::move(db), database_dir));
- scoped_ptr<DistillerPageFactory> distiller_page_factory(
+ std::unique_ptr<DistillerPageFactory> distiller_page_factory(
new DistillerPageFactoryIOS(context));
- scoped_ptr<DistillerURLFetcherFactory> distiller_url_fetcher_factory(
+ std::unique_ptr<DistillerURLFetcherFactory> distiller_url_fetcher_factory(
new DistillerURLFetcherFactory(context->GetRequestContext()));
dom_distiller::proto::DomDistillerOptions options;
- scoped_ptr<DistillerFactory> distiller_factory(new DistillerFactoryImpl(
+ std::unique_ptr<DistillerFactory> distiller_factory(new DistillerFactoryImpl(
std::move(distiller_url_fetcher_factory), options));
- scoped_ptr<DistilledPagePrefs> distilled_page_prefs(new DistilledPagePrefs(
- ios::ChromeBrowserState::FromBrowserState(context)->GetPrefs()));
+ std::unique_ptr<DistilledPagePrefs> distilled_page_prefs(
+ new DistilledPagePrefs(
+ ios::ChromeBrowserState::FromBrowserState(context)->GetPrefs()));
- return make_scoped_ptr(new DomDistillerKeyedService(
+ return base::WrapUnique(new DomDistillerKeyedService(
std::move(dom_distiller_store), std::move(distiller_factory),
std::move(distiller_page_factory), std::move(distilled_page_prefs)));
}
« no previous file with comments | « ios/chrome/browser/dom_distiller/dom_distiller_service_factory.h ('k') | ios/chrome/browser/favicon/favicon_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698