OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 MediaMetadata_h | 5 #ifndef MediaMetadata_h |
6 #define MediaMetadata_h | 6 #define MediaMetadata_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
9 #include "modules/ModulesExport.h" | 9 #include "modules/ModulesExport.h" |
10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
11 #include "public/platform/modules/mediasession/WebMediaMetadata.h" | |
12 #include "wtf/text/WTFString.h" | 11 #include "wtf/text/WTFString.h" |
13 | 12 |
14 namespace blink { | 13 namespace blink { |
15 | 14 |
16 class ExecutionContext; | 15 class ExecutionContext; |
17 class MediaArtwork; | 16 class MediaArtwork; |
18 class MediaMetadataInit; | 17 class MediaMetadataInit; |
19 | 18 |
20 // Implementation of MediaMetadata interface from the Media Session API. | 19 // Implementation of MediaMetadata interface from the Media Session API. |
21 class MODULES_EXPORT MediaMetadata final | 20 class MODULES_EXPORT MediaMetadata final |
22 : public GarbageCollectedFinalized<MediaMetadata> | 21 : public GarbageCollectedFinalized<MediaMetadata> |
23 , public ScriptWrappable { | 22 , public ScriptWrappable { |
24 DEFINE_WRAPPERTYPEINFO(); | 23 DEFINE_WRAPPERTYPEINFO(); |
25 public: | 24 public: |
26 static MediaMetadata* create(ExecutionContext*, const MediaMetadataInit&); | 25 static MediaMetadata* create(ExecutionContext*, const MediaMetadataInit&); |
27 | 26 |
28 String title() const; | 27 String title() const; |
29 String artist() const; | 28 String artist() const; |
30 String album() const; | 29 String album() const; |
31 const HeapVector<Member<MediaArtwork>>& artwork() const; | 30 const HeapVector<Member<MediaArtwork>>& artwork() const; |
32 | 31 |
33 explicit operator WebMediaMetadata() const; | |
34 | |
35 DECLARE_VIRTUAL_TRACE(); | 32 DECLARE_VIRTUAL_TRACE(); |
36 | 33 |
37 private: | 34 private: |
38 MediaMetadata(ExecutionContext*, const MediaMetadataInit&); | 35 MediaMetadata(ExecutionContext*, const MediaMetadataInit&); |
39 | 36 |
40 String m_title; | 37 String m_title; |
41 String m_artist; | 38 String m_artist; |
42 String m_album; | 39 String m_album; |
43 HeapVector<Member<MediaArtwork>> m_artwork; | 40 HeapVector<Member<MediaArtwork>> m_artwork; |
44 }; | 41 }; |
45 | 42 |
46 } // namespace blink | 43 } // namespace blink |
47 | 44 |
48 #endif // MediaMetadata_h | 45 #endif // MediaMetadata_h |
OLD | NEW |