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

Unified Diff: base/metrics/histogram_persistence.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: cleanup on RenderProcessHostDestroyed instead of RenderProcessExited; use existing ScopedObserver c… 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
Index: base/metrics/histogram_persistence.h
diff --git a/base/metrics/histogram_persistence.h b/base/metrics/histogram_persistence.h
index 95f48784c9859a3a0003092ca37f258ee047a1b9..0bd8033f53c9b1f4bc55118fb1eec9915bace90f 100644
--- a/base/metrics/histogram_persistence.h
+++ b/base/metrics/histogram_persistence.h
@@ -8,11 +8,15 @@
#include "base/base_export.h"
#include "base/feature_list.h"
#include "base/memory/scoped_ptr.h"
+#include "base/memory/shared_memory.h"
#include "base/metrics/histogram_base.h"
#include "base/metrics/persistent_memory_allocator.h"
+#include "base/strings/string_piece.h"
namespace base {
+class SharedPersistentMemoryAllocator;
+
// Feature definition for enabling histogram persistence.
BASE_EXPORT extern const Feature kPersistentHistogramsFeature;
@@ -39,6 +43,21 @@ BASE_EXPORT PersistentMemoryAllocator* GetPersistentHistogramMemoryAllocator();
BASE_EXPORT PersistentMemoryAllocator*
ReleasePersistentHistogramMemoryAllocatorForTesting();
+// Create a sharable memory segment with an attached persistent memory
+// allocator suitable for storing histograms. This segment can be shared
+// with other processes via an IPC message and used to create the same
+// on the other side.
Alexei Svitkine (slow) 2016/03/24 17:29:53 Please document the params better. What's id? What
+BASE_EXPORT SharedPersistentMemoryAllocator*
+CreateSharedPersistentHistogramMemoryAllocator(
+ size_t size,
+ StringPiece name,
+ uint64_t id);
+BASE_EXPORT SharedPersistentMemoryAllocator*
+CreateSharedPersistentHistogramMemoryAllocator(
Alexei Svitkine (slow) 2016/03/24 17:29:52 Overloads are generally discouraged. Please use di
+ size_t size,
+ const SharedMemoryHandle& handle,
+ bool readonly);
+
// Recreate a Histogram from data held in persistent memory. Though this
// object will be local to the current process, the sample data will be
// shared with all other threads referencing it. This method takes a |ref|
« no previous file with comments | « no previous file | base/metrics/histogram_persistence.cc » ('j') | chrome/browser/metrics/subprocess_metrics_provider.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698