OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #ifndef CONTENT_COMMON_HOST_SHARED_BITMAP_MANAGER_H_ | 5 #ifndef CONTENT_COMMON_HOST_SHARED_BITMAP_MANAGER_H_ |
6 #define CONTENT_COMMON_HOST_SHARED_BITMAP_MANAGER_H_ | 6 #define CONTENT_COMMON_HOST_SHARED_BITMAP_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 size_t buffer_size, | 58 size_t buffer_size, |
59 const cc::SharedBitmapId& id, | 59 const cc::SharedBitmapId& id, |
60 base::SharedMemoryHandle* shared_memory_handle); | 60 base::SharedMemoryHandle* shared_memory_handle); |
61 void ChildAllocatedSharedBitmap(size_t buffer_size, | 61 void ChildAllocatedSharedBitmap(size_t buffer_size, |
62 const base::SharedMemoryHandle& handle, | 62 const base::SharedMemoryHandle& handle, |
63 base::ProcessHandle process_handle, | 63 base::ProcessHandle process_handle, |
64 const cc::SharedBitmapId& id); | 64 const cc::SharedBitmapId& id); |
65 void ChildDeletedSharedBitmap(const cc::SharedBitmapId& id); | 65 void ChildDeletedSharedBitmap(const cc::SharedBitmapId& id); |
66 void ProcessRemoved(base::ProcessHandle process_handle); | 66 void ProcessRemoved(base::ProcessHandle process_handle); |
67 | 67 |
68 size_t AllocatedBitmapCount() const { return handle_map_.size(); } | 68 size_t AllocatedBitmapCount() const; |
69 | 69 |
70 private: | 70 private: |
71 void FreeSharedMemoryFromMap(cc::SharedBitmap* bitmap); | 71 void FreeSharedMemoryFromMap(cc::SharedBitmap* bitmap); |
72 | 72 |
73 base::Lock lock_; | 73 mutable base::Lock lock_; |
74 | 74 |
75 typedef base::hash_map<cc::SharedBitmapId, scoped_refptr<BitmapData> > | 75 typedef base::hash_map<cc::SharedBitmapId, scoped_refptr<BitmapData> > |
76 BitmapMap; | 76 BitmapMap; |
77 BitmapMap handle_map_; | 77 BitmapMap handle_map_; |
78 | 78 |
79 typedef base::hash_map<base::ProcessHandle, | 79 typedef base::hash_map<base::ProcessHandle, |
80 base::hash_set<cc::SharedBitmapId> > ProcessMap; | 80 base::hash_set<cc::SharedBitmapId> > ProcessMap; |
81 ProcessMap process_map_; | 81 ProcessMap process_map_; |
82 }; | 82 }; |
83 | 83 |
84 } // namespace content | 84 } // namespace content |
85 | 85 |
86 #endif // CONTENT_COMMON_HOST_SHARED_BITMAP_MANAGER_H_ | 86 #endif // CONTENT_COMMON_HOST_SHARED_BITMAP_MANAGER_H_ |
OLD | NEW |