OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_COMMON_DISCARDABLE_SHARED_MEMORY_HEAP_H_ | 5 #ifndef CONTENT_COMMON_DISCARDABLE_SHARED_MEMORY_HEAP_H_ |
6 #define CONTENT_COMMON_DISCARDABLE_SHARED_MEMORY_HEAP_H_ | 6 #define CONTENT_COMMON_DISCARDABLE_SHARED_MEMORY_HEAP_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
10 #include "base/containers/linked_list.h" | 10 #include "base/containers/linked_list.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
81 | 81 |
82 // Returns total bytes of memory in heap. | 82 // Returns total bytes of memory in heap. |
83 size_t GetSize() const; | 83 size_t GetSize() const; |
84 | 84 |
85 // Returns bytes of memory currently in the free lists. | 85 // Returns bytes of memory currently in the free lists. |
86 size_t GetSizeOfFreeLists() const; | 86 size_t GetSizeOfFreeLists() const; |
87 | 87 |
88 // Dumps memory statistics for chrome://tracing. | 88 // Dumps memory statistics for chrome://tracing. |
89 bool OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd); | 89 bool OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd); |
90 | 90 |
91 // Creates a common dump for all the sub-allocated objects from discardable | |
petrcermak
2015/07/29 17:04:07
nit: I don't think there should be "the" here
ssid
2015/07/29 17:08:37
Done.
| |
92 // memory. | |
93 static void CreateAllocatedObjectsDump( | |
94 base::trace_event::ProcessMemoryDump* pmd); | |
95 | |
91 // Returns a unique identifier for a given tuple of (process id, segment id) | 96 // Returns a unique identifier for a given tuple of (process id, segment id) |
92 // that can be used to match memory dumps across different processes. | 97 // that can be used to match memory dumps across different processes. |
93 static base::trace_event::MemoryAllocatorDumpGuid GetSegmentGUIDForTracing( | 98 static base::trace_event::MemoryAllocatorDumpGuid GetSegmentGUIDForTracing( |
94 uint64 tracing_process_id, | 99 uint64 tracing_process_id, |
95 int32 segment_id); | 100 int32 segment_id); |
96 | 101 |
97 private: | 102 private: |
98 class ScopedMemorySegment { | 103 class ScopedMemorySegment { |
99 public: | 104 public: |
100 ScopedMemorySegment(DiscardableSharedMemoryHeap* heap, | 105 ScopedMemorySegment(DiscardableSharedMemoryHeap* heap, |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
153 // is a free list of runs that consist of k blocks. The 256th entry is a | 158 // is a free list of runs that consist of k blocks. The 256th entry is a |
154 // free list of runs that have length >= 256 blocks. | 159 // free list of runs that have length >= 256 blocks. |
155 base::LinkedList<Span> free_spans_[256]; | 160 base::LinkedList<Span> free_spans_[256]; |
156 | 161 |
157 DISALLOW_COPY_AND_ASSIGN(DiscardableSharedMemoryHeap); | 162 DISALLOW_COPY_AND_ASSIGN(DiscardableSharedMemoryHeap); |
158 }; | 163 }; |
159 | 164 |
160 } // namespace content | 165 } // namespace content |
161 | 166 |
162 #endif // CONTENT_COMMON_DISCARDABLE_SHARED_MEMORY_HEAP_H_ | 167 #endif // CONTENT_COMMON_DISCARDABLE_SHARED_MEMORY_HEAP_H_ |
OLD | NEW |