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

Unified Diff: components/ntp_snippets/ntp_snippets_service_unittest.cc

Issue 1918083002: Convert //components/[f-n]* from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: … 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/ntp_snippets/ntp_snippets_service_unittest.cc
diff --git a/components/ntp_snippets/ntp_snippets_service_unittest.cc b/components/ntp_snippets/ntp_snippets_service_unittest.cc
index a2c6d7a8370d9589776bfc4a3d5f9265e7ed9a3f..b8f4e7161472b1adbccfbfe46d54e92b7a199f5e 100644
--- a/components/ntp_snippets/ntp_snippets_service_unittest.cc
+++ b/components/ntp_snippets/ntp_snippets_service_unittest.cc
@@ -4,8 +4,11 @@
#include "components/ntp_snippets/ntp_snippets_service.h"
+#include <memory>
+
#include "base/json/json_reader.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
@@ -95,7 +98,7 @@ void ParseJson(
const ntp_snippets::NTPSnippetsService::SuccessCallback& success_callback,
const ntp_snippets::NTPSnippetsService::ErrorCallback& error_callback) {
base::JSONReader json_reader;
- scoped_ptr<base::Value> value = json_reader.ReadToValue(json);
+ std::unique_ptr<base::Value> value = json_reader.ReadToValue(json);
bool success = !!value;
EXPECT_EQ(expect_success, success);
if (value) {
@@ -143,7 +146,7 @@ class NTPSnippetsServiceTest : public testing::Test {
service_.reset(new NTPSnippetsService(
pref_service_.get(), nullptr, task_runner, std::string("fr"),
scheduler_.get(),
- make_scoped_ptr(new NTPSnippetsFetcher(
+ base::WrapUnique(new NTPSnippetsFetcher(
task_runner, std::move(request_context_getter), true)),
base::Bind(&ParseJson, true)));
if (enabled)
@@ -166,9 +169,9 @@ class NTPSnippetsServiceTest : public testing::Test {
private:
base::MessageLoop message_loop_;
- scoped_ptr<TestingPrefServiceSimple> pref_service_;
- scoped_ptr<NTPSnippetsService> service_;
- scoped_ptr<MockScheduler> scheduler_;
+ std::unique_ptr<TestingPrefServiceSimple> pref_service_;
+ std::unique_ptr<NTPSnippetsService> service_;
+ std::unique_ptr<MockScheduler> scheduler_;
DISALLOW_COPY_AND_ASSIGN(NTPSnippetsServiceTest);
};
« no previous file with comments | « components/ntp_snippets/ntp_snippets_service.cc ('k') | components/sync_bookmarks/bookmark_change_processor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698