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

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

Issue 2367393002: Migrating MediaSession messages to mojo (Closed)
Patch Set: fixed layout tests Created 4 years, 2 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 #include "modules/mediasession/MediaMetadata.h" 5 #include "modules/mediasession/MediaMetadata.h"
6 6
7 #include "core/dom/ExecutionContext.h" 7 #include "core/dom/ExecutionContext.h"
8 #include "modules/mediasession/MediaArtwork.h" 8 #include "modules/mediasession/MediaArtwork.h"
9 #include "modules/mediasession/MediaMetadataInit.h" 9 #include "modules/mediasession/MediaMetadataInit.h"
10 10
(...skipping 23 matching lines...) Expand all
34 } 34 }
35 35
36 String MediaMetadata::album() const { 36 String MediaMetadata::album() const {
37 return m_album; 37 return m_album;
38 } 38 }
39 39
40 const HeapVector<Member<MediaArtwork>>& MediaMetadata::artwork() const { 40 const HeapVector<Member<MediaArtwork>>& MediaMetadata::artwork() const {
41 return m_artwork; 41 return m_artwork;
42 } 42 }
43 43
44 MediaMetadata::operator WebMediaMetadata() const {
45 WebMediaMetadata webMetadata;
46 webMetadata.title = m_title;
47 webMetadata.artist = m_artist;
48 webMetadata.album = m_album;
49 WebVector<WebMediaArtwork> webArtwork(m_artwork.size());
50 for (size_t i = 0; i < m_artwork.size(); ++i) {
51 webArtwork[i] = *m_artwork[i]->data();
52 }
53 webMetadata.artwork.swap(webArtwork);
54 return webMetadata;
55 }
56
57 DEFINE_TRACE(MediaMetadata) { 44 DEFINE_TRACE(MediaMetadata) {
58 visitor->trace(m_artwork); 45 visitor->trace(m_artwork);
59 } 46 }
60 47
61 } // namespace blink 48 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698