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

Unified Diff: base/memory/shared_memory.h

Issue 2535213002: [WIP] Add SharedMemoryTracker to dump base::SharedMemory usage
Patch Set: (rebase) Created 3 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/memory/discardable_shared_memory.h ('k') | base/memory/shared_memory_handle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/shared_memory.h
diff --git a/base/memory/shared_memory.h b/base/memory/shared_memory.h
index c4b4cdb64430d6fd4869711b3a000c8b8dcf7e8f..07bd44ea7a438f00c01e3badfe08b1513bbe755c 100644
--- a/base/memory/shared_memory.h
+++ b/base/memory/shared_memory.h
@@ -127,6 +127,9 @@ class BASE_EXPORT SharedMemory {
static int GetFdFromSharedMemoryHandle(const SharedMemoryHandle& handle);
#endif
+ int importance() const { return importance_; }
+ void set_importance(int importance) { importance_ = importance; }
+
// Creates a shared memory object as described by the options struct.
// Returns true on success and false on failure.
bool Create(const SharedMemoryCreateOptions& options);
@@ -226,21 +229,6 @@ class BASE_EXPORT SharedMemory {
// failure.
SharedMemoryHandle GetReadOnlyHandle();
-#if defined(OS_POSIX) && (!defined(OS_MACOSX) || defined(OS_IOS)) && \
- !defined(OS_NACL)
- using UniqueId = std::pair<dev_t, ino_t>;
-
- struct UniqueIdHash {
- size_t operator()(const UniqueId& id) const {
- return HashInts(id.first, id.second);
- }
- };
-
- // Returns a unique ID for this shared memory's handle. Note this function may
- // access file system and be slow.
- bool GetUniqueId(UniqueId* id) const;
-#endif
-
// Returns the last error encountered as a result of a call to Create() or
// Map(). Note: Currently only errors from Mac POSIX shared memory
// implementation are fully instrumented.
@@ -279,6 +267,7 @@ class BASE_EXPORT SharedMemory {
bool read_only_ = false;
size_t requested_size_ = 0;
SharedMemoryError last_error_ = SharedMemoryError::NO_ERRORS;
+ int importance_ = 0;
DISALLOW_COPY_AND_ASSIGN(SharedMemory);
};
« no previous file with comments | « base/memory/discardable_shared_memory.h ('k') | base/memory/shared_memory_handle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698