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 #include "mojo/services/html_viewer/discardable_memory_allocator.h" | 5 #include "components/html_viewer/discardable_memory_allocator.h" |
6 | 6 |
7 #include "base/memory/discardable_memory.h" | 7 #include "base/memory/discardable_memory.h" |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 | 10 |
11 namespace html_viewer { | 11 namespace html_viewer { |
12 | 12 |
13 // Represents an actual memory chunk. This is an object owned by | 13 // Represents an actual memory chunk. This is an object owned by |
14 // DiscardableMemoryAllocator. DiscardableMemoryChunkImpl are passed to the | 14 // DiscardableMemoryAllocator. DiscardableMemoryChunkImpl are passed to the |
15 // rest of the program, and access this memory through a weak ptr. | 15 // rest of the program, and access this memory through a weak ptr. |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 return live_unlocked_chunks_.insert(live_unlocked_chunks_.end(), chunk); | 142 return live_unlocked_chunks_.insert(live_unlocked_chunks_.end(), chunk); |
143 } | 143 } |
144 | 144 |
145 void DiscardableMemoryAllocator::NotifyLocked( | 145 void DiscardableMemoryAllocator::NotifyLocked( |
146 std::list<OwnedMemoryChunk*>::iterator it) { | 146 std::list<OwnedMemoryChunk*>::iterator it) { |
147 locked_chunks_++; | 147 locked_chunks_++; |
148 live_unlocked_chunks_.erase(it); | 148 live_unlocked_chunks_.erase(it); |
149 } | 149 } |
150 | 150 |
151 } // namespace html_viewer | 151 } // namespace html_viewer |
OLD | NEW |