| Index: components/metrics/serialization/serialization_utils.cc
|
| diff --git a/components/metrics/serialization/serialization_utils.cc b/components/metrics/serialization/serialization_utils.cc
|
| index 0038b4b2006223eac6d3aecf12bd73a0eef858a3..8aa16322685ba671be7d7fcfe1bc977ae0bd13a8 100644
|
| --- a/components/metrics/serialization/serialization_utils.cc
|
| +++ b/components/metrics/serialization/serialization_utils.cc
|
| @@ -7,6 +7,8 @@
|
| #include <errno.h>
|
| #include <stdint.h>
|
| #include <sys/file.h>
|
| +
|
| +#include <memory>
|
| #include <string>
|
| #include <utility>
|
| #include <vector>
|
| @@ -15,7 +17,6 @@
|
| #include "base/files/file_util.h"
|
| #include "base/files/scoped_file.h"
|
| #include "base/logging.h"
|
| -#include "base/memory/scoped_ptr.h"
|
| #include "base/memory/scoped_vector.h"
|
| #include "base/strings/string_split.h"
|
| #include "base/strings/string_util.h"
|
| @@ -88,10 +89,10 @@ bool ReadMessage(int fd, std::string* message) {
|
|
|
| } // namespace
|
|
|
| -scoped_ptr<MetricSample> SerializationUtils::ParseSample(
|
| +std::unique_ptr<MetricSample> SerializationUtils::ParseSample(
|
| const std::string& sample) {
|
| if (sample.empty())
|
| - return scoped_ptr<MetricSample>();
|
| + return std::unique_ptr<MetricSample>();
|
|
|
| std::vector<std::string> parts = base::SplitString(
|
| sample, std::string(1, '\0'),
|
| @@ -101,7 +102,7 @@ scoped_ptr<MetricSample> SerializationUtils::ParseSample(
|
| if (parts.size() != 3) {
|
| DLOG(ERROR) << "splitting message on \\0 produced " << parts.size()
|
| << " parts (expected 3)";
|
| - return scoped_ptr<MetricSample>();
|
| + return std::unique_ptr<MetricSample>();
|
| }
|
| const std::string& name = parts[0];
|
| const std::string& value = parts[1];
|
| @@ -119,7 +120,7 @@ scoped_ptr<MetricSample> SerializationUtils::ParseSample(
|
| } else {
|
| DLOG(ERROR) << "invalid event type: " << name << ", value: " << value;
|
| }
|
| - return scoped_ptr<MetricSample>();
|
| + return std::unique_ptr<MetricSample>();
|
| }
|
|
|
| void SerializationUtils::ReadAndTruncateMetricsFromFile(
|
| @@ -159,7 +160,7 @@ void SerializationUtils::ReadAndTruncateMetricsFromFile(
|
| if (!ReadMessage(fd.get(), &message))
|
| break;
|
|
|
| - scoped_ptr<MetricSample> sample = ParseSample(message);
|
| + std::unique_ptr<MetricSample> sample = ParseSample(message);
|
| if (sample)
|
| metrics->push_back(std::move(sample));
|
| }
|
|
|