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 <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 manager_->FreeSharedMemoryFromMap(id()); | 50 manager_->FreeSharedMemoryFromMap(id()); |
51 } | 51 } |
52 | 52 |
53 private: | 53 private: |
54 scoped_refptr<BitmapData> bitmap_data_; | 54 scoped_refptr<BitmapData> bitmap_data_; |
55 HostSharedBitmapManager* manager_; | 55 HostSharedBitmapManager* manager_; |
56 }; | 56 }; |
57 | 57 |
58 } // namespace | 58 } // namespace |
59 | 59 |
60 base::LazyInstance<HostSharedBitmapManager> g_shared_memory_manager = | 60 base::LazyInstance<HostSharedBitmapManager>::DestructorAtExit |
61 LAZY_INSTANCE_INITIALIZER; | 61 g_shared_memory_manager = LAZY_INSTANCE_INITIALIZER; |
62 | 62 |
63 HostSharedBitmapManagerClient::HostSharedBitmapManagerClient( | 63 HostSharedBitmapManagerClient::HostSharedBitmapManagerClient( |
64 HostSharedBitmapManager* manager) | 64 HostSharedBitmapManager* manager) |
65 : manager_(manager) { | 65 : manager_(manager) { |
66 } | 66 } |
67 | 67 |
68 HostSharedBitmapManagerClient::~HostSharedBitmapManagerClient() { | 68 HostSharedBitmapManagerClient::~HostSharedBitmapManagerClient() { |
69 for (const auto& id : owned_bitmaps_) | 69 for (const auto& id : owned_bitmaps_) |
70 manager_->ChildDeletedSharedBitmap(id); | 70 manager_->ChildDeletedSharedBitmap(id); |
71 } | 71 } |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 return handle_map_.size(); | 239 return handle_map_.size(); |
240 } | 240 } |
241 | 241 |
242 void HostSharedBitmapManager::FreeSharedMemoryFromMap( | 242 void HostSharedBitmapManager::FreeSharedMemoryFromMap( |
243 const cc::SharedBitmapId& id) { | 243 const cc::SharedBitmapId& id) { |
244 base::AutoLock lock(lock_); | 244 base::AutoLock lock(lock_); |
245 handle_map_.erase(id); | 245 handle_map_.erase(id); |
246 } | 246 } |
247 | 247 |
248 } // namespace content | 248 } // namespace content |
OLD | NEW |