| Index: base/metrics/histogram_snapshot_manager.h
|
| diff --git a/base/metrics/histogram_snapshot_manager.h b/base/metrics/histogram_snapshot_manager.h
|
| index 97bd693966fd6b1ed8ef2c84bcaaafee9eb8a0bc..1b64a9f9d5b362c97a97135092a8b5a97e720d74 100644
|
| --- a/base/metrics/histogram_snapshot_manager.h
|
| +++ b/base/metrics/histogram_snapshot_manager.h
|
| @@ -9,6 +9,7 @@
|
|
|
| #include <map>
|
| #include <string>
|
| +#include <vector>
|
|
|
| #include "base/gtest_prod_util.h"
|
| #include "base/macros.h"
|
| @@ -83,9 +84,13 @@ class BASE_EXPORT HistogramSnapshotManager {
|
| // until FinishDeltas() completes. PrepareOnce() works the same
|
| // but assumes there were no previous logged values and no future deltas
|
| // will be created (and thus can work on read-only histograms).
|
| + // Use Prepare*TakingOwnership() if it is desireable to have this class
|
| + // automatically delete the histogram once it is "finished".
|
| void StartDeltas();
|
| void PrepareDelta(HistogramBase* histogram);
|
| + void PrepareDeltaTakingOwnership(scoped_ptr<HistogramBase> histogram);
|
| void PrepareOnce(const HistogramBase* histogram);
|
| + void PrepareOnceTakingOwnership(scoped_ptr<const HistogramBase> histogram);
|
| void FinishDeltas();
|
|
|
| private:
|
| @@ -94,7 +99,8 @@ class BASE_EXPORT HistogramSnapshotManager {
|
| // Capture and hold samples from a histogram. This does all the heavy
|
| // lifting for PrepareDelta() and PrepareOnce().
|
| void PrepareSamples(const HistogramBase* histogram,
|
| - scoped_ptr<HistogramSamples> samples);
|
| + scoped_ptr<HistogramSamples> samples,
|
| + bool take_ownership);
|
|
|
| // Try to detect and fix count inconsistency of logged samples.
|
| void InspectLoggedSamplesInconsistency(
|
| @@ -105,6 +111,10 @@ class BASE_EXPORT HistogramSnapshotManager {
|
| // by the hash of the histogram name.
|
| HashInfoMap known_histograms_;
|
|
|
| + // Collection of histograms of which ownership has been passed to this
|
| + // object. They will be deleted by FinishDeltas().
|
| + std::vector<scoped_ptr<const HistogramBase>> owned_histograms_;
|
| +
|
| // Indicates if deltas are currently being prepared.
|
| bool preparing_deltas_;
|
|
|
|
|