| 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 27 matching lines...) Expand all Loading... |
| 38 String MediaMetadata::album() const | 38 String MediaMetadata::album() const |
| 39 { | 39 { |
| 40 return m_album; | 40 return m_album; |
| 41 } | 41 } |
| 42 | 42 |
| 43 const HeapVector<Member<MediaArtwork>>& MediaMetadata::artwork() const | 43 const HeapVector<Member<MediaArtwork>>& MediaMetadata::artwork() const |
| 44 { | 44 { |
| 45 return m_artwork; | 45 return m_artwork; |
| 46 } | 46 } |
| 47 | 47 |
| 48 MediaMetadata::operator WebMediaMetadata() const | |
| 49 { | |
| 50 WebMediaMetadata webMetadata; | |
| 51 webMetadata.title = m_title; | |
| 52 webMetadata.artist = m_artist; | |
| 53 webMetadata.album = m_album; | |
| 54 WebVector<WebMediaArtwork> webArtwork(m_artwork.size()); | |
| 55 for (size_t i = 0; i < m_artwork.size(); ++i) { | |
| 56 webArtwork[i] = *m_artwork[i]->data(); | |
| 57 } | |
| 58 webMetadata.artwork.swap(webArtwork); | |
| 59 return webMetadata; | |
| 60 } | |
| 61 | |
| 62 DEFINE_TRACE(MediaMetadata) | 48 DEFINE_TRACE(MediaMetadata) |
| 63 { | 49 { |
| 64 visitor->trace(m_artwork); | 50 visitor->trace(m_artwork); |
| 65 } | 51 } |
| 66 | 52 |
| 67 } // namespace blink | 53 } // namespace blink |
| OLD | NEW |