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

Unified Diff: content/common/discardable_shared_memory_heap.h

Issue 1374213002: [tracing] Display the locked size of discardable memory segment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Storing locked state in spans. Created 5 years, 3 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: content/common/discardable_shared_memory_heap.h
diff --git a/content/common/discardable_shared_memory_heap.h b/content/common/discardable_shared_memory_heap.h
index 100b03f169611388e16d601276913d119cca3f64..80bbccfb1a7ec660f796574463d7b8aaed542394 100644
--- a/content/common/discardable_shared_memory_heap.h
+++ b/content/common/discardable_shared_memory_heap.h
@@ -8,6 +8,7 @@
#include "base/callback.h"
#include "base/containers/hash_tables.h"
#include "base/containers/linked_list.h"
+#include "base/memory/discardable_shared_memory.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/scoped_vector.h"
#include "base/trace_event/process_memory_dump.h"
@@ -27,20 +28,31 @@ class CONTENT_EXPORT DiscardableSharedMemoryHeap {
public:
~Span();
- base::DiscardableSharedMemory* shared_memory() { return shared_memory_; }
+ bool shared_memory() { return shared_memory_; }
ssid 2015/09/29 16:03:55 I have also removed the getter here since it is no
size_t start() const { return start_; }
size_t length() const { return length_; }
+ base::DiscardableSharedMemory::LockResult Lock(size_t page_size);
+ void Unlock(size_t page_size);
reveman 2015/09/29 22:58:31 I'd like to keep Span class as a simple container
+
+ // Returns true if shared_memory segment is resident.
+ bool IsMemoryResident() const;
+
+ // Returns true if the span is locked by the client.
+ bool is_locked() { return is_locked_; }
+
private:
friend class DiscardableSharedMemoryHeap;
Span(base::DiscardableSharedMemory* shared_memory,
size_t start,
- size_t length);
+ size_t length,
+ bool is_locked);
base::DiscardableSharedMemory* shared_memory_;
size_t start_;
size_t length_;
+ bool is_locked_;
DISALLOW_COPY_AND_ASSIGN(Span);
};

Powered by Google App Engine
This is Rietveld 408576698