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

Unified Diff: base/metrics/histogram.h

Issue 1852433005: Convert //base to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after r384946 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 | « base/metrics/field_trial.h ('k') | base/metrics/histogram.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/histogram.h
diff --git a/base/metrics/histogram.h b/base/metrics/histogram.h
index 5111b8fd55f4703b33c00b6ae1bf8a0b2583b6ef..d4d009c6ae01c1fa246c5e3a364969899a39aa4d 100644
--- a/base/metrics/histogram.h
+++ b/base/metrics/histogram.h
@@ -70,6 +70,7 @@
#include <stdint.h>
#include <map>
+#include <memory>
#include <string>
#include <vector>
@@ -78,7 +79,6 @@
#include "base/gtest_prod_util.h"
#include "base/logging.h"
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
#include "base/metrics/bucket_ranges.h"
#include "base/metrics/histogram_base.h"
// TODO(asvitkine): Migrate callers to to include this directly and remove this.
@@ -142,7 +142,7 @@ class BASE_EXPORT Histogram : public HistogramBase {
int32_t flags);
// Create a histogram using data in persistent storage.
- static scoped_ptr<HistogramBase> PersistentCreate(
+ static std::unique_ptr<HistogramBase> PersistentCreate(
const std::string& name,
Sample minimum,
Sample maximum,
@@ -202,8 +202,8 @@ class BASE_EXPORT Histogram : public HistogramBase {
uint32_t expected_bucket_count) const override;
void Add(Sample value) override;
void AddCount(Sample value, int count) override;
- scoped_ptr<HistogramSamples> SnapshotSamples() const override;
- scoped_ptr<HistogramSamples> SnapshotDelta() override;
+ std::unique_ptr<HistogramSamples> SnapshotSamples() const override;
+ std::unique_ptr<HistogramSamples> SnapshotDelta() override;
void AddSamples(const HistogramSamples& samples) override;
bool AddSamplesFromPickle(base::PickleIterator* iter) override;
void WriteHTMLGraph(std::string* output) const override;
@@ -268,7 +268,7 @@ class BASE_EXPORT Histogram : public HistogramBase {
static HistogramBase* DeserializeInfoImpl(base::PickleIterator* iter);
// Implementation of SnapshotSamples function.
- scoped_ptr<SampleVector> SnapshotSampleVector() const;
+ std::unique_ptr<SampleVector> SnapshotSampleVector() const;
//----------------------------------------------------------------------------
// Helpers for emitting Ascii graphic. Each method appends data to output.
@@ -308,10 +308,10 @@ class BASE_EXPORT Histogram : public HistogramBase {
// Finally, provide the state that changes with the addition of each new
// sample.
- scoped_ptr<SampleVector> samples_;
+ std::unique_ptr<SampleVector> samples_;
// Also keep a previous uploaded state for calculating deltas.
- scoped_ptr<HistogramSamples> logged_samples_;
+ std::unique_ptr<HistogramSamples> logged_samples_;
DISALLOW_COPY_AND_ASSIGN(Histogram);
};
@@ -352,7 +352,7 @@ class BASE_EXPORT LinearHistogram : public Histogram {
int32_t flags);
// Create a histogram using data in persistent storage.
- static scoped_ptr<HistogramBase> PersistentCreate(
+ static std::unique_ptr<HistogramBase> PersistentCreate(
const std::string& name,
Sample minimum,
Sample maximum,
@@ -443,7 +443,7 @@ class BASE_EXPORT BooleanHistogram : public LinearHistogram {
static HistogramBase* FactoryGet(const char* name, int32_t flags);
// Create a histogram using data in persistent storage.
- static scoped_ptr<HistogramBase> PersistentCreate(
+ static std::unique_ptr<HistogramBase> PersistentCreate(
const std::string& name,
const BucketRanges* ranges,
HistogramBase::AtomicCount* counts,
@@ -493,7 +493,7 @@ class BASE_EXPORT CustomHistogram : public Histogram {
int32_t flags);
// Create a histogram using data in persistent storage.
- static scoped_ptr<HistogramBase> PersistentCreate(
+ static std::unique_ptr<HistogramBase> PersistentCreate(
const std::string& name,
const BucketRanges* ranges,
HistogramBase::AtomicCount* counts,
« no previous file with comments | « base/metrics/field_trial.h ('k') | base/metrics/histogram.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698