Title: [200927] trunk/Source/WebCore
- Revision
- 200927
- Author
- [email protected]
- Date
- 2016-05-15 08:36:57 -0700 (Sun, 15 May 2016)
Log Message
Unreviewed, rolling out r200925.
https://bugs.webkit.org/show_bug.cgi?id=157725
Does not build if MEDIA_SESSION is enabled (Requested by
cdumez_ on #webkit).
Reverted changeset:
"Use new Web IDL dictionary support for
MediaSession.setMetadata()"
https://bugs.webkit.org/show_bug.cgi?id=157711
http://trac.webkit.org/changeset/200925
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (200926 => 200927)
--- trunk/Source/WebCore/ChangeLog 2016-05-15 10:34:51 UTC (rev 200926)
+++ trunk/Source/WebCore/ChangeLog 2016-05-15 15:36:57 UTC (rev 200927)
@@ -1,3 +1,18 @@
+2016-05-15 Commit Queue <[email protected]>
+
+ Unreviewed, rolling out r200925.
+ https://bugs.webkit.org/show_bug.cgi?id=157725
+
+ Does not build if MEDIA_SESSION is enabled (Requested by
+ cdumez_ on #webkit).
+
+ Reverted changeset:
+
+ "Use new Web IDL dictionary support for
+ MediaSession.setMetadata()"
+ https://bugs.webkit.org/show_bug.cgi?id=157711
+ http://trac.webkit.org/changeset/200925
+
2016-05-14 Chris Dumez <[email protected]>
Use new Web IDL dictionary support for MediaSession.setMetadata()
Modified: trunk/Source/WebCore/Modules/mediasession/MediaSession.cpp (200926 => 200927)
--- trunk/Source/WebCore/Modules/mediasession/MediaSession.cpp 2016-05-15 10:34:51 UTC (rev 200926)
+++ trunk/Source/WebCore/Modules/mediasession/MediaSession.cpp 2016-05-15 15:36:57 UTC (rev 200927)
@@ -30,6 +30,7 @@
#include "Chrome.h"
#include "ChromeClient.h"
+#include "Dictionary.h"
#include "Event.h"
#include "HTMLMediaElement.h"
#include "MediaSessionManager.h"
@@ -112,15 +113,31 @@
return !m_activeParticipatingElements.isEmpty();
}
-void MediaSession::setMetadata(const MediaMetadataInit& metadata)
+void MediaSession::setMetadata(const Dictionary& metadata)
{
- // If metadata's artwork is present, parse it using baseURL, and if that does not return failure, set media
- // session's artwork URL to the return value.
+ // 5.1.3
+ // 1. Let media session be the current media session.
+ // 2. Let baseURL be the API base URL specified by the entry settings object.
+ // 3. Set media session's title to metadata's title.
+ String title;
+ metadata.get("title", title);
+
+ // 4. Set media session's artist name to metadata's artist.
+ String artist;
+ metadata.get("artist", artist);
+
+ // 5. Set media session's album name to metadata's album.
+ String album;
+ metadata.get("album", album);
+
+ // 6. If metadata's artwork is present, parse it using baseURL, and if that does not return failure, set media
+ // session's artwork URL to the return value.
URL artworkURL;
- if (!metadata.artwork.isNull())
- artworkURL = m_document.completeURL(metadata.artwork);
+ String artworkPath;
+ if (metadata.get("artwork", artworkPath))
+ artworkURL = m_document.completeURL(artworkPath);
- m_metadata = MediaSessionMetadata(metadata.title, metadata.artist, metadata.album, artworkURL);
+ m_metadata = MediaSessionMetadata(title, artist, album, artworkURL);
if (Page *page = m_document.page())
page->chrome().client().mediaSessionMetadataDidChange(m_metadata);
Modified: trunk/Source/WebCore/Modules/mediasession/MediaSession.h (200926 => 200927)
--- trunk/Source/WebCore/Modules/mediasession/MediaSession.h 2016-05-15 10:34:51 UTC (rev 200926)
+++ trunk/Source/WebCore/Modules/mediasession/MediaSession.h 2016-05-15 15:36:57 UTC (rev 200927)
@@ -32,6 +32,7 @@
namespace WebCore {
+class Dictionary;
class Document;
class HTMLMediaElement;
@@ -53,15 +54,8 @@
WEBCORE_EXPORT State currentState() const { return m_currentState; }
bool hasActiveMediaElements() const;
- struct MediaMetadataInit {
- String title;
- String artist;
- String album;
- String artwork;
- };
+ void setMetadata(const Dictionary&);
- void setMetadata(const MediaMetadataInit&);
-
void deactivate();
// Runs the media session invocation algorithm and returns true on success.
Modified: trunk/Source/WebCore/Modules/mediasession/MediaSession.idl (200926 => 200927)
--- trunk/Source/WebCore/Modules/mediasession/MediaSession.idl 2016-05-15 10:34:51 UTC (rev 200926)
+++ trunk/Source/WebCore/Modules/mediasession/MediaSession.idl 2016-05-15 15:36:57 UTC (rev 200927)
@@ -33,9 +33,7 @@
readonly attribute MediaSessionKind kind;
readonly attribute MediaRemoteControls? controls;
- // FIXME: The latest specification says this should be:
- // attribute MediaMetadata? metadata;
- void setMetadata(MediaMetadataInit metadata);
+ void setMetadata(Dictionary metadata);
void deactivate();
};
@@ -46,10 +44,3 @@
"transient-solo",
"ambient"
};
-
-dictionary MediaMetadataInit {
- DOMString title;
- DOMString artist;
- DOMString album;
- DOMString artwork;
-};
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes