OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef WebGraphicsContext3DProviderWrapper_h |
| 6 #define WebGraphicsContext3DProviderWrapper_h |
| 7 |
| 8 #include "public/platform/WebGraphicsContext3DProvider.h" |
| 9 #include "wtf/WeakPtr.h" |
| 10 |
| 11 namespace blink { |
| 12 |
| 13 class PLATFORM_EXPORT WebGraphicsContext3DProviderWrapper { |
| 14 public: |
| 15 WebGraphicsContext3DProviderWrapper( |
| 16 std::unique_ptr<WebGraphicsContext3DProvider> provider) |
| 17 : m_contextProvider(std::move(provider)), m_weakPtrFactory(this) {} |
| 18 WeakPtr<WebGraphicsContext3DProviderWrapper> createWeakPtr() { |
| 19 return m_weakPtrFactory.createWeakPtr(); |
| 20 } |
| 21 WebGraphicsContext3DProvider* contextProvider() { |
| 22 return m_contextProvider.get(); |
| 23 } |
| 24 |
| 25 private: |
| 26 std::unique_ptr<WebGraphicsContext3DProvider> m_contextProvider; |
| 27 WeakPtrFactory<WebGraphicsContext3DProviderWrapper> m_weakPtrFactory; |
| 28 }; |
| 29 |
| 30 } // namespace blink |
| 31 |
| 32 #endif // WebGraphicsContext3DProviderWrapper_h |
OLD | NEW |