| Index: base/metrics/sparse_histogram.cc
|
| diff --git a/base/metrics/sparse_histogram.cc b/base/metrics/sparse_histogram.cc
|
| index 31fcfd93d63cc4d1ee14667433488510785da7ad..f1c1d6963e6ba7f12588b759286e952ffa2bbc6f 100644
|
| --- a/base/metrics/sparse_histogram.cc
|
| +++ b/base/metrics/sparse_histogram.cc
|
| @@ -136,6 +136,16 @@ std::unique_ptr<HistogramSamples> SparseHistogram::SnapshotDelta() {
|
| return std::move(snapshot);
|
| }
|
|
|
| +std::unique_ptr<HistogramSamples> SparseHistogram::SnapshotDifference() const {
|
| + std::unique_ptr<SampleMap> snapshot(new SampleMap(name_hash()));
|
| + base::AutoLock auto_lock(lock_);
|
| + snapshot->Add(*samples_);
|
| +
|
| + // Subtract what was previously logged and then return.
|
| + snapshot->Subtract(*logged_samples_);
|
| + return std::move(snapshot);
|
| +}
|
| +
|
| void SparseHistogram::AddSamples(const HistogramSamples& samples) {
|
| base::AutoLock auto_lock(lock_);
|
| samples_->Add(samples);
|
|
|