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 #include "modules/media_capabilities/MediaDecodingAbility.h" | 5 #include "modules/media_capabilities/MediaDecodingAbility.h" |
6 | 6 |
7 namespace blink { | 7 namespace blink { |
8 | 8 |
9 MediaDecodingAbility::MediaDecodingAbility() = default; | 9 // static |
10 MediaDecodingAbility* MediaDecodingAbility::take( | |
11 ScriptPromiseResolver*, | |
12 std::unique_ptr<WebMediaDecodingAbility> webMediaDecodingAbility) { | |
13 DCHECK(webMediaDecodingAbility); | |
14 return new MediaDecodingAbility(std::move(webMediaDecodingAbility)); | |
chcunningham
2017/03/08 02:43:10
I notice this class breaks the pattern of the *Con
mlamouri (slow - plz ping)
2017/03/10 11:26:42
That's following the pattern of CallbackPromiseAda
| |
15 } | |
10 | 16 |
11 bool MediaDecodingAbility::supported() const { | 17 bool MediaDecodingAbility::supported() const { |
12 return true; | 18 return m_webMediaDecodingAbility->supported; |
13 } | 19 } |
14 | 20 |
15 bool MediaDecodingAbility::smooth() const { | 21 bool MediaDecodingAbility::smooth() const { |
16 return true; | 22 return m_webMediaDecodingAbility->smooth; |
17 } | 23 } |
18 | 24 |
19 bool MediaDecodingAbility::powerEfficient() const { | 25 bool MediaDecodingAbility::powerEfficient() const { |
20 return true; | 26 return m_webMediaDecodingAbility->powerEfficient; |
21 } | 27 } |
22 | 28 |
23 DEFINE_TRACE(MediaDecodingAbility) {} | 29 DEFINE_TRACE(MediaDecodingAbility) {} |
24 | 30 |
31 MediaDecodingAbility::MediaDecodingAbility( | |
32 std::unique_ptr<WebMediaDecodingAbility> webMediaDecodingAbility) | |
33 : m_webMediaDecodingAbility(std::move(webMediaDecodingAbility)) {} | |
34 | |
25 } // namespace blink | 35 } // namespace blink |
OLD | NEW |