| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 OffscreenCanvasFrameDispatcher_h | 5 #ifndef OffscreenCanvasFrameDispatcher_h |
| 6 #define OffscreenCanvasFrameDispatcher_h | 6 #define OffscreenCanvasFrameDispatcher_h |
| 7 | 7 |
| 8 #include "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
| 9 #include "wtf/RefPtr.h" | 9 #include "wtf/RefPtr.h" |
| 10 #include "wtf/WeakPtr.h" |
| 10 | 11 |
| 11 namespace blink { | 12 namespace blink { |
| 12 | 13 |
| 13 class StaticBitmapImage; | 14 class StaticBitmapImage; |
| 14 | 15 |
| 15 class PLATFORM_EXPORT OffscreenCanvasFrameDispatcher { | 16 class PLATFORM_EXPORT OffscreenCanvasFrameDispatcher { |
| 16 public: | 17 public: |
| 17 virtual ~OffscreenCanvasFrameDispatcher(){}; | 18 OffscreenCanvasFrameDispatcher() : m_weakPtrFactory(this) {} |
| 19 virtual ~OffscreenCanvasFrameDispatcher() {} |
| 18 virtual void dispatchFrame(RefPtr<StaticBitmapImage>, | 20 virtual void dispatchFrame(RefPtr<StaticBitmapImage>, |
| 19 double commitStartTime, | 21 double commitStartTime, |
| 20 bool isWebGLSoftwareRendering = false) = 0; | 22 bool isWebGLSoftwareRendering = false) = 0; |
| 23 virtual void reclaimResource(unsigned resourceId) = 0; |
| 24 |
| 25 WeakPtr<OffscreenCanvasFrameDispatcher> createWeakPtr() { |
| 26 return m_weakPtrFactory.createWeakPtr(); |
| 27 } |
| 28 |
| 29 private: |
| 30 WeakPtrFactory<OffscreenCanvasFrameDispatcher> m_weakPtrFactory; |
| 21 }; | 31 }; |
| 22 | 32 |
| 23 } // namespace blink | 33 } // namespace blink |
| 24 | 34 |
| 25 #endif // OffscreenCanvasFrameDispatcher_h | 35 #endif // OffscreenCanvasFrameDispatcher_h |
| OLD | NEW |