| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_CHILD_CHILD_SHARED_BITMAP_MANAGER_H_ | |
| 6 #define CONTENT_CHILD_CHILD_SHARED_BITMAP_MANAGER_H_ | |
| 7 | |
| 8 #include <stdint.h> | |
| 9 | |
| 10 #include <memory> | |
| 11 | |
| 12 #include "base/macros.h" | |
| 13 #include "base/memory/ref_counted.h" | |
| 14 #include "base/memory/shared_memory.h" | |
| 15 #include "cc/resources/shared_bitmap_manager.h" | |
| 16 #include "content/common/render_message_filter.mojom.h" | |
| 17 #include "mojo/public/cpp/bindings/thread_safe_interface_ptr.h" | |
| 18 | |
| 19 namespace content { | |
| 20 | |
| 21 class ChildSharedBitmapManager : public cc::SharedBitmapManager { | |
| 22 public: | |
| 23 explicit ChildSharedBitmapManager( | |
| 24 const scoped_refptr<mojom::ThreadSafeRenderMessageFilterAssociatedPtr>& | |
| 25 render_message_filter_ptr); | |
| 26 ~ChildSharedBitmapManager() override; | |
| 27 | |
| 28 // cc::SharedBitmapManager implementation. | |
| 29 std::unique_ptr<cc::SharedBitmap> AllocateSharedBitmap( | |
| 30 const gfx::Size& size) override; | |
| 31 std::unique_ptr<cc::SharedBitmap> GetSharedBitmapFromId( | |
| 32 const gfx::Size&, | |
| 33 const cc::SharedBitmapId&) override; | |
| 34 | |
| 35 std::unique_ptr<cc::SharedBitmap> GetBitmapForSharedMemory( | |
| 36 base::SharedMemory* mem); | |
| 37 | |
| 38 private: | |
| 39 void NotifyAllocatedSharedBitmap(base::SharedMemory* memory, | |
| 40 const cc::SharedBitmapId& id); | |
| 41 | |
| 42 scoped_refptr<mojom::ThreadSafeRenderMessageFilterAssociatedPtr> | |
| 43 render_message_filter_ptr_; | |
| 44 | |
| 45 DISALLOW_COPY_AND_ASSIGN(ChildSharedBitmapManager); | |
| 46 }; | |
| 47 | |
| 48 } // namespace content | |
| 49 | |
| 50 #endif // CONTENT_CHILD_CHILD_SHARED_BITMAP_MANAGER_H_ | |
| OLD | NEW |