Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Side by Side Diff: components/html_viewer/discardable_memory_allocator.cc

Issue 1099303002: Move html_viewer from mojo/services to components. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « components/html_viewer/discardable_memory_allocator.h ('k') | components/html_viewer/discardable_memory_allocator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698