WebKit Bugzilla
Attachment 346505 Details for
Bug 188314
: Add LogArgument template for PlatformMediaSession::RemoteControlCommandType
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188314-20180803105826.patch (text/plain), 6.14 KB, created by
Eric Carlson
on 2018-08-03 10:58:27 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Eric Carlson
Created:
2018-08-03 10:58:27 PDT
Size:
6.14 KB
patch
obsolete
>Subversion Revision: 234500 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 0786b04ccc25130daf8c6eadd3016dd7954c2aef..2deb6b9230c9f9b669e3a2e6061a7a4a1e3d3f2f 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,19 @@ >+2018-08-03 Eric Carlson <eric.carlson@apple.com> >+ >+ Add LogArgument template for PlatformMediaSession::RemoteControlCommandType >+ https://bugs.webkit.org/show_bug.cgi?id=188314 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * html/HTMLMediaElement.cpp: >+ (WebCore::HTMLMediaElement::didReceiveRemoteControlCommand): Don't coerce to int for logging. >+ >+ * platform/audio/PlatformMediaSession.cpp: >+ (WebCore::convertEnumerationToString): New. >+ (WebCore::PlatformMediaSession::didReceiveRemoteControlCommand): Log command. >+ * platform/audio/PlatformMediaSession.h: >+ (WTF::LogArgument<WebCore::PlatformMediaSession::RemoteControlCommandType>::toString): >+ > 2018-08-02 Zalan Bujtas <zalan@apple.com> > > [LFC][Floating] Do not pass formatting root to FloatingContext >diff --git a/Source/WebCore/html/HTMLMediaElement.cpp b/Source/WebCore/html/HTMLMediaElement.cpp >index 8fbcb82eb22a473adb2dabddd7ce5a7ee9e8d6ef..90d34d0eb4a1f57ae8d43db249a2f913bc3c8223 100644 >--- a/Source/WebCore/html/HTMLMediaElement.cpp >+++ b/Source/WebCore/html/HTMLMediaElement.cpp >@@ -7521,7 +7521,7 @@ uint64_t HTMLMediaElement::mediaSessionUniqueIdentifier() const > > void HTMLMediaElement::didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType command, const PlatformMediaSession::RemoteCommandArgument* argument) > { >- INFO_LOG(LOGIDENTIFIER, static_cast<int>(command)); >+ INFO_LOG(LOGIDENTIFIER, command); > > UserGestureIndicator remoteControlUserGesture(ProcessingUserGesture, &document()); > switch (command) { >diff --git a/Source/WebCore/platform/audio/PlatformMediaSession.cpp b/Source/WebCore/platform/audio/PlatformMediaSession.cpp >index ee19b67530ecc1cbc742d5ce9435b71499a0eb88..a139a67f6a27740f1afad767bb44de81d96582bb 100644 >--- a/Source/WebCore/platform/audio/PlatformMediaSession.cpp >+++ b/Source/WebCore/platform/audio/PlatformMediaSession.cpp >@@ -84,6 +84,34 @@ String convertEnumerationToString(PlatformMediaSession::InterruptionType type) > return values[static_cast<size_t>(type)]; > } > >+String convertEnumerationToString(PlatformMediaSession::RemoteControlCommandType command) >+{ >+ static const NeverDestroyed<String> values[] = { >+ MAKE_STATIC_STRING_IMPL("NoCommand"), >+ MAKE_STATIC_STRING_IMPL("PlayCommand"), >+ MAKE_STATIC_STRING_IMPL("PauseCommand"), >+ MAKE_STATIC_STRING_IMPL("StopCommand"), >+ MAKE_STATIC_STRING_IMPL("TogglePlayPauseCommand"), >+ MAKE_STATIC_STRING_IMPL("BeginSeekingBackwardCommand"), >+ MAKE_STATIC_STRING_IMPL("EndSeekingBackwardCommand"), >+ MAKE_STATIC_STRING_IMPL("BeginSeekingForwardCommand"), >+ MAKE_STATIC_STRING_IMPL("EndSeekingForwardCommand"), >+ MAKE_STATIC_STRING_IMPL("SeekToPlaybackPositionCommand"), >+ }; >+ static_assert(!static_cast<size_t>(PlatformMediaSession::NoCommand), "PlatformMediaSession::NoCommand is not 0 as expected"); >+ static_assert(static_cast<size_t>(PlatformMediaSession::PlayCommand == 1), "PlatformMediaSession::PlayCommand is not 1 as expected"); >+ static_assert(static_cast<size_t>(PlatformMediaSession::PauseCommand == 2), "PlatformMediaSession::PauseCommand is not 2 as expected"); >+ static_assert(static_cast<size_t>(PlatformMediaSession::StopCommand == 3), "PlatformMediaSession::StopCommand is not 3 as expected"); >+ static_assert(static_cast<size_t>(PlatformMediaSession::TogglePlayPauseCommand == 4), "PlatformMediaSession::TogglePlayPauseCommand is not 4 as expected"); >+ static_assert(static_cast<size_t>(PlatformMediaSession::BeginSeekingBackwardCommand == 5), "PlatformMediaSession::BeginSeekingBackwardCommand is not 5 as expected"); >+ static_assert(static_cast<size_t>(PlatformMediaSession::EndSeekingBackwardCommand == 6), "PlatformMediaSession::EndSeekingBackwardCommand is not 6 as expected"); >+ static_assert(static_cast<size_t>(PlatformMediaSession::BeginSeekingForwardCommand == 7), "PlatformMediaSession::BeginSeekingForwardCommand is not 7 as expected"); >+ static_assert(static_cast<size_t>(PlatformMediaSession::EndSeekingForwardCommand == 8), "PlatformMediaSession::EndSeekingForwardCommand is not 8 as expected"); >+ static_assert(static_cast<size_t>(PlatformMediaSession::SeekToPlaybackPositionCommand == 9), "PlatformMediaSession::SeekToPlaybackPositionCommand is not 9 as expected"); >+ ASSERT(static_cast<size_t>(command) < WTF_ARRAY_LENGTH(values)); >+ return values[static_cast<size_t>(command)]; >+} >+ > #endif > > std::unique_ptr<PlatformMediaSession> PlatformMediaSession::create(PlatformMediaSessionClient& client) >@@ -275,6 +303,8 @@ bool PlatformMediaSession::canReceiveRemoteControlCommands() const > > void PlatformMediaSession::didReceiveRemoteControlCommand(RemoteControlCommandType command, const PlatformMediaSession::RemoteCommandArgument* argument) > { >+ INFO_LOG(LOGIDENTIFIER, command); >+ > m_client.didReceiveRemoteControlCommand(command, argument); > } > >diff --git a/Source/WebCore/platform/audio/PlatformMediaSession.h b/Source/WebCore/platform/audio/PlatformMediaSession.h >index fd6f08cdfbd9ea78991d5966634c08732e8808ca..4f22bd2fb3edf0601c95221d56b08cafa0fdd91a 100644 >--- a/Source/WebCore/platform/audio/PlatformMediaSession.h >+++ b/Source/WebCore/platform/audio/PlatformMediaSession.h >@@ -251,7 +251,7 @@ protected: > > String convertEnumerationToString(PlatformMediaSession::State); > String convertEnumerationToString(PlatformMediaSession::InterruptionType); >- >+String convertEnumerationToString(PlatformMediaSession::RemoteControlCommandType); > } > > namespace WTF { >@@ -275,6 +275,14 @@ struct LogArgument<WebCore::PlatformMediaSession::InterruptionType> { > } > }; > >+template <> >+struct LogArgument<WebCore::PlatformMediaSession::RemoteControlCommandType> { >+ static String toString(const WebCore::PlatformMediaSession::RemoteControlCommandType command) >+ { >+ return convertEnumerationToString(command); >+ } >+}; >+ > } // namespace WTF > > #endif // PlatformMediaSession_h
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
achristensen
:
review-
achristensen
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188314
:
346505
|
346774