| 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 #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 Loading... |
| 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 |
| OLD | NEW |