| 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/Timer.h" | 10 #include "platform/Timer.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 : public GarbageCollectedFinalized<MediaMetadata>, | 28 : public GarbageCollectedFinalized<MediaMetadata>, |
| 29 public ScriptWrappable { | 29 public ScriptWrappable { |
| 30 DEFINE_WRAPPERTYPEINFO(); | 30 DEFINE_WRAPPERTYPEINFO(); |
| 31 | 31 |
| 32 public: | 32 public: |
| 33 static MediaMetadata* create(ExecutionContext*, const MediaMetadataInit&); | 33 static MediaMetadata* create(ExecutionContext*, const MediaMetadataInit&); |
| 34 | 34 |
| 35 String title() const; | 35 String title() const; |
| 36 String artist() const; | 36 String artist() const; |
| 37 String album() const; | 37 String album() const; |
| 38 const HeapVector<Member<MediaImage>>& artwork() const; | 38 const HeapVector<MediaImage>& artwork() const; |
| 39 | 39 |
| 40 void setTitle(const String&); | 40 void setTitle(const String&); |
| 41 void setArtist(const String&); | 41 void setArtist(const String&); |
| 42 void setAlbum(const String&); | 42 void setAlbum(const String&); |
| 43 void setArtwork(const HeapVector<Member<MediaImage>>&); | 43 void setArtwork(const HeapVector<MediaImage>&); |
| 44 | 44 |
| 45 // Called by MediaSession to associate or de-associate itself. | 45 // Called by MediaSession to associate or de-associate itself. |
| 46 void setSession(MediaSession*); | 46 void setSession(MediaSession*); |
| 47 | 47 |
| 48 DECLARE_VIRTUAL_TRACE(); | 48 DECLARE_VIRTUAL_TRACE(); |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 MediaMetadata(ExecutionContext*, const MediaMetadataInit&); | 51 MediaMetadata(ExecutionContext*, const MediaMetadataInit&); |
| 52 | 52 |
| 53 // Called when one of the metadata fields is updated from script. It will | 53 // Called when one of the metadata fields is updated from script. It will |
| 54 // notify the session asynchronously in order to bundle multiple call in one | 54 // notify the session asynchronously in order to bundle multiple call in one |
| 55 // notification. | 55 // notification. |
| 56 void notifySessionAsync(); | 56 void notifySessionAsync(); |
| 57 | 57 |
| 58 // Called asynchronously after at least one field of MediaMetadata has been | 58 // Called asynchronously after at least one field of MediaMetadata has been |
| 59 // modified. | 59 // modified. |
| 60 void notifySessionTimerFired(TimerBase*); | 60 void notifySessionTimerFired(TimerBase*); |
| 61 | 61 |
| 62 String m_title; | 62 String m_title; |
| 63 String m_artist; | 63 String m_artist; |
| 64 String m_album; | 64 String m_album; |
| 65 HeapVector<Member<MediaImage>> m_artwork; | 65 HeapVector<MediaImage> m_artwork; |
| 66 | 66 |
| 67 Member<MediaSession> m_session; | 67 Member<MediaSession> m_session; |
| 68 Timer<MediaMetadata> m_notifySessionTimer; | 68 Timer<MediaMetadata> m_notifySessionTimer; |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 } // namespace blink | 71 } // namespace blink |
| 72 | 72 |
| 73 #endif // MediaMetadata_h | 73 #endif // MediaMetadata_h |
| OLD | NEW |