Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(412)

Side by Side Diff: third_party/WebKit/Source/modules/mediasession/MediaMetadata.h

Issue 2612003002: Media Session: use dictionary instead of an interface for MediaImage. (Closed)
Patch Set: rebase and remove one more file Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698