| 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 COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SERVER_SHARED_BITMAP_MANAGER_H_ | 5 #ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SERVER_SHARED_BITMAP_MANAGER_H_ |
| 6 #define COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SERVER_SHARED_BITMAP_MANAGER_H_ | 6 #define COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SERVER_SHARED_BITMAP_MANAGER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <unordered_map> | 9 #include <unordered_map> |
| 10 | 10 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 const cc::SharedBitmapId&) override; | 41 const cc::SharedBitmapId&) override; |
| 42 | 42 |
| 43 // base::trace_event::MemoryDumpProvider implementation. | 43 // base::trace_event::MemoryDumpProvider implementation. |
| 44 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, | 44 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, |
| 45 base::trace_event::ProcessMemoryDump* pmd) override; | 45 base::trace_event::ProcessMemoryDump* pmd) override; |
| 46 | 46 |
| 47 size_t AllocatedBitmapCount() const; | 47 size_t AllocatedBitmapCount() const; |
| 48 | 48 |
| 49 void FreeSharedMemoryFromMap(const cc::SharedBitmapId& id); | 49 void FreeSharedMemoryFromMap(const cc::SharedBitmapId& id); |
| 50 | 50 |
| 51 private: | |
| 52 friend class SharedBitmapAllocationNotifierImpl; | |
| 53 | |
| 54 bool ChildAllocatedSharedBitmap(size_t buffer_size, | 51 bool ChildAllocatedSharedBitmap(size_t buffer_size, |
| 55 const base::SharedMemoryHandle& handle, | 52 const base::SharedMemoryHandle& handle, |
| 56 const cc::SharedBitmapId& id); | 53 const cc::SharedBitmapId& id); |
| 54 private: |
| 55 friend class SharedBitmapAllocationNotifierImpl; |
| 56 |
| 57 void ChildDeletedSharedBitmap(const cc::SharedBitmapId& id); | 57 void ChildDeletedSharedBitmap(const cc::SharedBitmapId& id); |
| 58 | 58 |
| 59 mutable base::Lock lock_; | 59 mutable base::Lock lock_; |
| 60 | 60 |
| 61 std::unordered_map<cc::SharedBitmapId, | 61 std::unordered_map<cc::SharedBitmapId, |
| 62 scoped_refptr<BitmapData>, | 62 scoped_refptr<BitmapData>, |
| 63 cc::SharedBitmapIdHash> | 63 cc::SharedBitmapIdHash> |
| 64 handle_map_; | 64 handle_map_; |
| 65 | 65 |
| 66 DISALLOW_COPY_AND_ASSIGN(ServerSharedBitmapManager); | 66 DISALLOW_COPY_AND_ASSIGN(ServerSharedBitmapManager); |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 } // namespace viz | 69 } // namespace viz |
| 70 | 70 |
| 71 #endif // COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SERVER_SHARED_BITMAP_MANAGER_
H_ | 71 #endif // COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SERVER_SHARED_BITMAP_MANAGER_
H_ |
| OLD | NEW |