OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 MOJO_SERVICES_HTML_VIEWER_DISCARDABLE_MEMORY_ALLOCATOR_H_ | 5 #ifndef COMPONENTS_HTML_VIEWER_DISCARDABLE_MEMORY_ALLOCATOR_H_ |
6 #define MOJO_SERVICES_HTML_VIEWER_DISCARDABLE_MEMORY_ALLOCATOR_H_ | 6 #define COMPONENTS_HTML_VIEWER_DISCARDABLE_MEMORY_ALLOCATOR_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 | 9 |
10 #include "base/memory/discardable_memory_allocator.h" | 10 #include "base/memory/discardable_memory_allocator.h" |
11 | 11 |
12 namespace html_viewer { | 12 namespace html_viewer { |
13 | 13 |
14 // A discarable memory allocator which will unallocate chunks on new | 14 // A discarable memory allocator which will unallocate chunks on new |
15 // allocations. | 15 // allocations. |
16 class DiscardableMemoryAllocator : public base::DiscardableMemoryAllocator { | 16 class DiscardableMemoryAllocator : public base::DiscardableMemoryAllocator { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 | 51 |
52 // A linked list of unlocked allocated chunks so that the tail is most | 52 // A linked list of unlocked allocated chunks so that the tail is most |
53 // recently accessed chunks. | 53 // recently accessed chunks. |
54 std::list<OwnedMemoryChunk*> live_unlocked_chunks_; | 54 std::list<OwnedMemoryChunk*> live_unlocked_chunks_; |
55 | 55 |
56 DISALLOW_COPY_AND_ASSIGN(DiscardableMemoryAllocator); | 56 DISALLOW_COPY_AND_ASSIGN(DiscardableMemoryAllocator); |
57 }; | 57 }; |
58 | 58 |
59 } // namespace html_viewer | 59 } // namespace html_viewer |
60 | 60 |
61 #endif // MOJO_SERVICES_HTML_VIEWER_DISCARDABLE_MEMORY_ALLOCATOR_H_ | 61 #endif // COMPONENTS_HTML_VIEWER_DISCARDABLE_MEMORY_ALLOCATOR_H_ |
OLD | NEW |