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

Unified Diff: base/metrics/histogram_persistence.h

Issue 1689833002: Add ownership-transfer to histogram management calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 10 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/histogram.cc ('k') | base/metrics/histogram_persistence.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/histogram_persistence.h
diff --git a/base/metrics/histogram_persistence.h b/base/metrics/histogram_persistence.h
index 95f48784c9859a3a0003092ca37f258ee047a1b9..bf572947aba43b55ff45d742890269304be9c571 100644
--- a/base/metrics/histogram_persistence.h
+++ b/base/metrics/histogram_persistence.h
@@ -49,14 +49,14 @@ ReleasePersistentHistogramMemoryAllocatorForTesting();
// from persistent memory segments other than the default place that this
// process is creating its own histograms. The caller must take ownership of
// the returned object and destroy it when no longer needed.
-BASE_EXPORT HistogramBase* GetPersistentHistogram(
+BASE_EXPORT scoped_ptr<HistogramBase> GetPersistentHistogram(
PersistentMemoryAllocator* allocator,
int32_t ref);
// Get the next histogram in persistent data based on iterator. The caller
// must take ownership of the returned object and destroy it when no longer
// needed.
-BASE_EXPORT HistogramBase* GetNextPersistentHistogram(
+BASE_EXPORT scoped_ptr<HistogramBase> GetNextPersistentHistogram(
PersistentMemoryAllocator* allocator,
PersistentMemoryAllocator::Iterator* iter);
@@ -68,7 +68,7 @@ void FinalizePersistentHistogram(PersistentMemoryAllocator::Reference ref,
// Allocate a new persistent histogram. This does *not* make the object
// iterable in the allocator; call MakeIterable(ref) directly if that is
// desired.
-BASE_EXPORT HistogramBase* AllocatePersistentHistogram(
+BASE_EXPORT scoped_ptr<HistogramBase> AllocatePersistentHistogram(
PersistentMemoryAllocator* allocator,
HistogramType histogram_type,
const std::string& name,
« no previous file with comments | « base/metrics/histogram.cc ('k') | base/metrics/histogram_persistence.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698