| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 MediaDecodingAbility_h | 5 #ifndef MediaDecodingAbility_h |
| 6 #define MediaDecodingAbility_h | 6 #define MediaDecodingAbility_h |
| 7 | 7 |
| 8 #include <memory> |
| 9 |
| 8 #include "bindings/core/v8/ScriptWrappable.h" | 10 #include "bindings/core/v8/ScriptWrappable.h" |
| 11 #include "public/platform/modules/media_capabilities/WebMediaDecodingAbility.h" |
| 9 | 12 |
| 10 namespace blink { | 13 namespace blink { |
| 11 | 14 |
| 15 class ScriptPromiseResolver; |
| 16 |
| 12 // Implementation of the MediaDecodingAbility interface. | 17 // Implementation of the MediaDecodingAbility interface. |
| 13 class MediaDecodingAbility final | 18 class MediaDecodingAbility final |
| 14 : public GarbageCollected<MediaDecodingAbility>, | 19 : public GarbageCollectedFinalized<MediaDecodingAbility>, |
| 15 public ScriptWrappable { | 20 public ScriptWrappable { |
| 16 DEFINE_WRAPPERTYPEINFO(); | 21 DEFINE_WRAPPERTYPEINFO(); |
| 17 | 22 |
| 18 public: | 23 public: |
| 19 MediaDecodingAbility(); | 24 using WebType = std::unique_ptr<WebMediaDecodingAbility>; |
| 25 static MediaDecodingAbility* take(ScriptPromiseResolver*, |
| 26 std::unique_ptr<WebMediaDecodingAbility>); |
| 20 | 27 |
| 21 bool supported() const; | 28 bool supported() const; |
| 22 bool smooth() const; | 29 bool smooth() const; |
| 23 bool powerEfficient() const; | 30 bool powerEfficient() const; |
| 24 | 31 |
| 25 DECLARE_VIRTUAL_TRACE(); | 32 DECLARE_VIRTUAL_TRACE(); |
| 33 |
| 34 private: |
| 35 MediaDecodingAbility() = delete; |
| 36 explicit MediaDecodingAbility(std::unique_ptr<WebMediaDecodingAbility>); |
| 37 |
| 38 std::unique_ptr<WebMediaDecodingAbility> m_webMediaDecodingAbility; |
| 26 }; | 39 }; |
| 27 | 40 |
| 28 } // namespace blink | 41 } // namespace blink |
| 29 | 42 |
| 30 #endif // MediaDecodingAbility_h | 43 #endif // MediaDecodingAbility_h |
| OLD | NEW |