Index: base/metrics/persistent_histogram_allocator.h |
diff --git a/base/metrics/persistent_histogram_allocator.h b/base/metrics/persistent_histogram_allocator.h |
index cc8d0233d3d337456651fe9ae9cdadca82d22f0f..6411b959b5c29eee788ad77ae695bce01865e5ad 100644 |
--- a/base/metrics/persistent_histogram_allocator.h |
+++ b/base/metrics/persistent_histogram_allocator.h |
@@ -116,21 +116,39 @@ class BASE_EXPORT PersistentHistogramAllocator { |
static scoped_ptr<PersistentHistogramAllocator> |
ReleaseGlobalAllocatorForTesting(); |
- // These helper methods perform SetGlobalAllocator() calls with allocators |
- // of the specified type and parameters. |
+ // Create a global allocator using the passed-in memory |base|, |size|, and |
+ // other parameters. Ownership of the memory segment remains with the caller. |
static void CreateGlobalAllocatorOnPersistentMemory( |
void* base, |
size_t size, |
size_t page_size, |
uint64_t id, |
StringPiece name); |
+ |
+ // Create a global allocator using an internal block of memory of the |
+ // specified |size| taken from the heap. |
static void CreateGlobalAllocatorOnLocalMemory( |
size_t size, |
uint64_t id, |
StringPiece name); |
+ |
+ // Create a global allocator using a block of shared |memory| of the |
+ // specified |size|. The allocator takes ownership of the shared memory |
+ // and releases it upon destruction, though the memory will continue to |
+ // live if other processes have access to it. |
static void CreateGlobalAllocatorOnSharedMemory( |
+ scoped_ptr<SharedMemory> memory, |
size_t size, |
- const SharedMemoryHandle& handle); |
+ uint64_t id, |
+ StringPiece name); |
+ |
+ // Create a global allocator using a block of shared memory accessed |
+ // through the given |handle| and |size|. The allocator takes ownership |
+ // of the handle and closes it upon destruction, though the memory will |
+ // continue to live if other processes have access to it. |
+ static void CreateGlobalAllocatorOnSharedMemoryHandle( |
+ const SharedMemoryHandle& handle, |
+ size_t size); |
// Import new histograms from the global PersistentHistogramAllocator. It's |
// possible for other processes to create histograms in the active memory |