Index: content/common/host_shared_bitmap_manager.cc |
diff --git a/content/common/host_shared_bitmap_manager.cc b/content/common/host_shared_bitmap_manager.cc |
index 1f412e42eef04f38f1c5acae05d55b8c90636d8e..ac1478fe5ea07dc244ff178382418e611bfcd95d 100644 |
--- a/content/common/host_shared_bitmap_manager.cc |
+++ b/content/common/host_shared_bitmap_manager.cc |
@@ -63,7 +63,10 @@ scoped_ptr<cc::SharedBitmap> HostSharedBitmapManager::AllocateSharedBitmap( |
cc::SharedBitmapId id = cc::SharedBitmap::GenerateId(); |
handle_map_[id] = data; |
return make_scoped_ptr(new cc::SharedBitmap( |
- data->pixels.get(), id, base::Bind(&FreeSharedMemory, data))); |
+ data->pixels.get(), |
+ id, |
+ base::Bind(&HostSharedBitmapManager::FreeSharedMemoryFromMap, |
+ base::Unretained(this)))); |
} |
scoped_ptr<cc::SharedBitmap> HostSharedBitmapManager::GetSharedBitmapFromId( |
@@ -184,4 +187,10 @@ void HostSharedBitmapManager::ProcessRemoved( |
process_map_.erase(proc_it); |
} |
+void HostSharedBitmapManager::FreeSharedMemoryFromMap( |
+ cc::SharedBitmap* bitmap) { |
+ base::AutoLock lock(lock_); |
+ handle_map_.erase(bitmap->id()); |
+} |
+ |
} // namespace content |