| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 BLIMP_CLIENT_APP_BLIMP_DISCARDABLE_MEMORY_ALLOCATOR_H_ | 5 #ifndef BLIMP_CLIENT_APP_BLIMP_DISCARDABLE_MEMORY_ALLOCATOR_H_ |
| 6 #define BLIMP_CLIENT_APP_BLIMP_DISCARDABLE_MEMORY_ALLOCATOR_H_ | 6 #define BLIMP_CLIENT_APP_BLIMP_DISCARDABLE_MEMORY_ALLOCATOR_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/discardable_memory_allocator.h" | 11 #include "base/memory/discardable_memory_allocator.h" |
| 12 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/synchronization/lock.h" | 13 #include "base/synchronization/lock.h" |
| 13 | 14 |
| 14 namespace blimp { | 15 namespace blimp { |
| 15 namespace client { | 16 namespace client { |
| 16 | 17 |
| 17 // TODO(khushalsagar): See if we can share this implementation with html_viewer. | 18 // TODO(khushalsagar): See if we can share this implementation with html_viewer. |
| 18 // A discardable memory allocator which will unallocate chunks on new | 19 // A discardable memory allocator which will unallocate chunks on new |
| 19 // allocations or as old chunks are unlocked. | 20 // allocations or as old chunks are unlocked. |
| 20 class BlimpDiscardableMemoryAllocator : | 21 class BlimpDiscardableMemoryAllocator : |
| 21 public base::DiscardableMemoryAllocator { | 22 public base::DiscardableMemoryAllocator { |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 // recently accessed chunks. | 73 // recently accessed chunks. |
| 73 MemoryChunkList live_unlocked_chunks_; | 74 MemoryChunkList live_unlocked_chunks_; |
| 74 | 75 |
| 75 DISALLOW_COPY_AND_ASSIGN(BlimpDiscardableMemoryAllocator); | 76 DISALLOW_COPY_AND_ASSIGN(BlimpDiscardableMemoryAllocator); |
| 76 }; | 77 }; |
| 77 | 78 |
| 78 } // namespace client | 79 } // namespace client |
| 79 } // namespace blimp | 80 } // namespace blimp |
| 80 | 81 |
| 81 #endif // BLIMP_CLIENT_APP_BLIMP_DISCARDABLE_MEMORY_ALLOCATOR_H_ | 82 #endif // BLIMP_CLIENT_APP_BLIMP_DISCARDABLE_MEMORY_ALLOCATOR_H_ |
| OLD | NEW |