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

Unified Diff: base/metrics/persistent_histogram_allocator.h

Issue 1671933002: Create and pass shared-histogram-allocator from browser to renderer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@hsm-merge
Patch Set: addressed review comments by Greg Created 4 years, 9 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
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
« no previous file with comments | « no previous file | base/metrics/persistent_histogram_allocator.cc » ('j') | chrome/browser/metrics/subprocess_metrics_provider.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698