| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/common/host_shared_bitmap_manager.h" | 5 #include "content/common/host_shared_bitmap_manager.h" |
| 6 | 6 |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "content/common/view_messages.h" | 9 #include "content/common/view_messages.h" |
| 10 #include "ui/gfx/size.h" | 10 #include "ui/gfx/size.h" |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 base::hash_set<cc::SharedBitmapId>& res = proc_it->second; | 180 base::hash_set<cc::SharedBitmapId>& res = proc_it->second; |
| 181 | 181 |
| 182 for (base::hash_set<cc::SharedBitmapId>::iterator it = res.begin(); | 182 for (base::hash_set<cc::SharedBitmapId>::iterator it = res.begin(); |
| 183 it != res.end(); | 183 it != res.end(); |
| 184 ++it) { | 184 ++it) { |
| 185 handle_map_.erase(*it); | 185 handle_map_.erase(*it); |
| 186 } | 186 } |
| 187 process_map_.erase(proc_it); | 187 process_map_.erase(proc_it); |
| 188 } | 188 } |
| 189 | 189 |
| 190 size_t HostSharedBitmapManager::AllocatedBitmapCount() const { |
| 191 base::AutoLock lock(lock_); |
| 192 return handle_map_.size(); |
| 193 } |
| 194 |
| 190 void HostSharedBitmapManager::FreeSharedMemoryFromMap( | 195 void HostSharedBitmapManager::FreeSharedMemoryFromMap( |
| 191 cc::SharedBitmap* bitmap) { | 196 cc::SharedBitmap* bitmap) { |
| 192 base::AutoLock lock(lock_); | 197 base::AutoLock lock(lock_); |
| 193 handle_map_.erase(bitmap->id()); | 198 handle_map_.erase(bitmap->id()); |
| 194 } | 199 } |
| 195 | 200 |
| 196 } // namespace content | 201 } // namespace content |
| OLD | NEW |