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

Unified Diff: components/rappor/sampler_unittest.cc

Issue 1921923002: Convert //components/[o-t]* 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
« no previous file with comments | « components/rappor/sampler.cc ('k') | components/rappor/test_rappor_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/rappor/sampler_unittest.cc
diff --git a/components/rappor/sampler_unittest.cc b/components/rappor/sampler_unittest.cc
index 5458d169493d78e186f920e8b0f3a36871570780..9953c190a8613789a40f86c09d8ca4933b77fa46 100644
--- a/components/rappor/sampler_unittest.cc
+++ b/components/rappor/sampler_unittest.cc
@@ -4,6 +4,7 @@
#include "components/rappor/sampler.h"
+#include <memory>
#include <utility>
#include "base/metrics/metrics_hashes.h"
@@ -22,8 +23,8 @@ const RapporParameters kTestRapporParameters = {
class TestSamplerFactory {
public:
- static scoped_ptr<Sample> CreateSample() {
- return scoped_ptr<Sample>(new Sample(0, kTestRapporParameters));
+ static std::unique_ptr<Sample> CreateSample() {
+ return std::unique_ptr<Sample>(new Sample(0, kTestRapporParameters));
}
};
@@ -33,11 +34,11 @@ namespace internal {
TEST(RapporSamplerTest, TestExport) {
Sampler sampler;
- scoped_ptr<Sample> sample1 = TestSamplerFactory::CreateSample();
+ std::unique_ptr<Sample> sample1 = TestSamplerFactory::CreateSample();
sample1->SetStringField("Foo", "Junk");
sampler.AddSample("Metric1", std::move(sample1));
- scoped_ptr<Sample> sample2 = TestSamplerFactory::CreateSample();
+ std::unique_ptr<Sample> sample2 = TestSamplerFactory::CreateSample();
sample2->SetStringField("Foo", "Junk2");
sampler.AddSample("Metric1", std::move(sample2));
@@ -59,7 +60,7 @@ TEST(RapporSamplerTest, TestExport) {
TEST(RapporSamplerTest, TestNoNoise) {
Sampler sampler;
- scoped_ptr<Sample> sample1 = TestSamplerFactory::CreateSample();
+ std::unique_ptr<Sample> sample1 = TestSamplerFactory::CreateSample();
sample1->SetFlagsField("Foo", 0xde, 8, NO_NOISE);
sample1->SetUInt64Field("Bar", 0x0011223344aabbccdd, NO_NOISE);
sampler.AddSample("Metric1", std::move(sample1));
« no previous file with comments | « components/rappor/sampler.cc ('k') | components/rappor/test_rappor_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698