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

Unified Diff: base/metrics/persistent_memory_allocator.h

Issue 1891913002: Support saving browser metrics to disk and reading them during next run. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed some unnecessary includes Created 4 years, 7 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/persistent_histogram_allocator.cc ('k') | base/metrics/persistent_memory_allocator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/persistent_memory_allocator.h
diff --git a/base/metrics/persistent_memory_allocator.h b/base/metrics/persistent_memory_allocator.h
index 4c0db5264a8f810721653d130c6428437ef5f9aa..56edd2ca24e0131d633b7aea805bd80e3681cb66 100644
--- a/base/metrics/persistent_memory_allocator.h
+++ b/base/metrics/persistent_memory_allocator.h
@@ -12,6 +12,7 @@
#include "base/atomicops.h"
#include "base/base_export.h"
+#include "base/files/file_path.h"
#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "base/strings/string_piece.h"
@@ -126,6 +127,10 @@ class BASE_EXPORT PersistentMemoryAllocator {
kTypeIdAny = 0 // Match any type-id inside GetAsObject().
};
+ // This is the standard file extension (suitable for being passed to the
+ // AddExtension() method of base::FilePath) for dumps of persistent memory.
+ static const base::FilePath::CharType kFileExtension[];
+
// The allocator operates on any arbitrary block of memory. Creation and
// persisting or sharing of that block with another process is the
// responsibility of the caller. The allocator needs to know only the
@@ -191,6 +196,7 @@ class BASE_EXPORT PersistentMemoryAllocator {
// not guarantee consistency. Use with care. Do not write.
const void* data() const { return const_cast<const char*>(mem_base_); }
size_t length() const { return mem_size_; }
+ size_t size() const { return mem_size_; }
size_t used() const;
// Get an object referenced by a |ref|. For safety reasons, the |type_id|
« no previous file with comments | « base/metrics/persistent_histogram_allocator.cc ('k') | base/metrics/persistent_memory_allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698