Chromium Code Reviews| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 111 const base::Closure& deleted_callback); | 111 const base::Closure& deleted_callback); |
| 112 ~ScopedMemorySegment(); | 112 ~ScopedMemorySegment(); |
| 113 | 113 |
| 114 bool IsUsed() const; | 114 bool IsUsed() const; |
| 115 bool IsResident() const; | 115 bool IsResident() const; |
| 116 | 116 |
| 117 bool ContainsSpan(Span* span) const; | 117 bool ContainsSpan(Span* span) const; |
| 118 | 118 |
| 119 base::trace_event::MemoryAllocatorDump* CreateMemoryAllocatorDump( | 119 base::trace_event::MemoryAllocatorDump* CreateMemoryAllocatorDump( |
| 120 Span* span, | 120 Span* span, |
| 121 size_t block_size, | |
|
reveman
2015/08/26 16:04:59
Maybe remove |span| and |block_size| args and just
| |
| 121 const char* name, | 122 const char* name, |
| 122 base::trace_event::ProcessMemoryDump* pmd) const; | 123 base::trace_event::ProcessMemoryDump* pmd) const; |
| 123 | 124 |
| 124 // Used for dumping memory statistics from the segment to chrome://tracing. | 125 // Used for dumping memory statistics from the segment to chrome://tracing. |
| 125 void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd) const; | 126 void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd) const; |
| 126 | 127 |
| 127 private: | 128 private: |
| 128 DiscardableSharedMemoryHeap* const heap_; | 129 DiscardableSharedMemoryHeap* const heap_; |
| 129 scoped_ptr<base::DiscardableSharedMemory> shared_memory_; | 130 scoped_ptr<base::DiscardableSharedMemory> shared_memory_; |
| 130 const size_t size_; | 131 const size_t size_; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 167 // is a free list of runs that consist of k blocks. The 256th entry is a | 168 // is a free list of runs that consist of k blocks. The 256th entry is a |
| 168 // free list of runs that have length >= 256 blocks. | 169 // free list of runs that have length >= 256 blocks. |
| 169 base::LinkedList<Span> free_spans_[256]; | 170 base::LinkedList<Span> free_spans_[256]; |
| 170 | 171 |
| 171 DISALLOW_COPY_AND_ASSIGN(DiscardableSharedMemoryHeap); | 172 DISALLOW_COPY_AND_ASSIGN(DiscardableSharedMemoryHeap); |
| 172 }; | 173 }; |
| 173 | 174 |
| 174 } // namespace content | 175 } // namespace content |
| 175 | 176 |
| 176 #endif // CONTENT_COMMON_DISCARDABLE_SHARED_MEMORY_HEAP_H_ | 177 #endif // CONTENT_COMMON_DISCARDABLE_SHARED_MEMORY_HEAP_H_ |
| OLD | NEW |