WebKit Bugzilla
Attachment 346774 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 for landing
bug-188314-20180808103031.patch (text/plain), 9.60 KB, created by
Eric Carlson
on 2018-08-08 10:30:32 PDT
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Eric Carlson
Created:
2018-08-08 10:30:32 PDT
Size:
9.60 KB
patch
obsolete
>Subversion Revision: 234561 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index eef5c6fb4c7d5127451d0c9274bd531b6967b326..81159a9f64aa2ffc4f2c88c028d2711b43b0a869 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 Alex Christensen. >+ >+ * 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-03 Zalan Bujtas <zalan@apple.com> > > [LFC][BFC] Special case the document renderer when computing the height and margin >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 fa99fee3cb90cc06b4c97938aa3e03d72c5c19b4..3e561febe4d2fc81de8fccddae6ee57ee5ffcc11 100644 >--- a/Source/WebCore/platform/audio/PlatformMediaSession.cpp >+++ b/Source/WebCore/platform/audio/PlatformMediaSession.cpp >@@ -54,10 +54,10 @@ String convertEnumerationToString(PlatformMediaSession::State state) > MAKE_STATIC_STRING_IMPL("Interrupted"), > }; > static_assert(!static_cast<size_t>(PlatformMediaSession::Idle), "PlatformMediaSession::Idle is not 0 as expected"); >- static_assert(static_cast<size_t>(PlatformMediaSession::Autoplaying == 1), "PlatformMediaSession::Autoplaying is not 1 as expected"); >- static_assert(static_cast<size_t>(PlatformMediaSession::Playing == 2), "PlatformMediaSession::Playing is not 2 as expected"); >- static_assert(static_cast<size_t>(PlatformMediaSession::Paused == 3), "PlatformMediaSession::Paused is not 3 as expected"); >- static_assert(static_cast<size_t>(PlatformMediaSession::Interrupted == 4), "PlatformMediaSession::Interrupted is not 4 as expected"); >+ static_assert(static_cast<size_t>(PlatformMediaSession::Autoplaying) == 1, "PlatformMediaSession::Autoplaying is not 1 as expected"); >+ static_assert(static_cast<size_t>(PlatformMediaSession::Playing) == 2, "PlatformMediaSession::Playing is not 2 as expected"); >+ static_assert(static_cast<size_t>(PlatformMediaSession::Paused) == 3, "PlatformMediaSession::Paused is not 3 as expected"); >+ static_assert(static_cast<size_t>(PlatformMediaSession::Interrupted) == 4, "PlatformMediaSession::Interrupted is not 4 as expected"); > ASSERT(static_cast<size_t>(state) < WTF_ARRAY_LENGTH(values)); > return values[static_cast<size_t>(state)]; > } >@@ -74,16 +74,44 @@ String convertEnumerationToString(PlatformMediaSession::InterruptionType type) > MAKE_STATIC_STRING_IMPL("ProcessInactive"), > }; > static_assert(!static_cast<size_t>(PlatformMediaSession::NoInterruption), "PlatformMediaSession::NoInterruption is not 0 as expected"); >- static_assert(static_cast<size_t>(PlatformMediaSession::SystemSleep == 1), "PlatformMediaSession::SystemSleep is not 1 as expected"); >- static_assert(static_cast<size_t>(PlatformMediaSession::EnteringBackground == 2), "PlatformMediaSession::EnteringBackground is not 2 as expected"); >- static_assert(static_cast<size_t>(PlatformMediaSession::SystemInterruption == 3), "PlatformMediaSession::SystemInterruption is not 3 as expected"); >- static_assert(static_cast<size_t>(PlatformMediaSession::SuspendedUnderLock == 4), "PlatformMediaSession::SuspendedUnderLock is not 4 as expected"); >- static_assert(static_cast<size_t>(PlatformMediaSession::InvisibleAutoplay == 5), "PlatformMediaSession::InvisibleAutoplay is not 5 as expected"); >- static_assert(static_cast<size_t>(PlatformMediaSession::ProcessInactive == 6), "PlatformMediaSession::ProcessInactive is not 6 as expected"); >+ static_assert(static_cast<size_t>(PlatformMediaSession::SystemSleep) == 1, "PlatformMediaSession::SystemSleep is not 1 as expected"); >+ static_assert(static_cast<size_t>(PlatformMediaSession::EnteringBackground) == 2, "PlatformMediaSession::EnteringBackground is not 2 as expected"); >+ static_assert(static_cast<size_t>(PlatformMediaSession::SystemInterruption) == 3, "PlatformMediaSession::SystemInterruption is not 3 as expected"); >+ static_assert(static_cast<size_t>(PlatformMediaSession::SuspendedUnderLock) == 4, "PlatformMediaSession::SuspendedUnderLock is not 4 as expected"); >+ static_assert(static_cast<size_t>(PlatformMediaSession::InvisibleAutoplay) == 5, "PlatformMediaSession::InvisibleAutoplay is not 5 as expected"); >+ static_assert(static_cast<size_t>(PlatformMediaSession::ProcessInactive) == 6, "PlatformMediaSession::ProcessInactive is not 6 as expected"); > ASSERT(static_cast<size_t>(type) < WTF_ARRAY_LENGTH(values)); > 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) >@@ -277,6 +305,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 d97679db94591af1210e007258b67c9da0fadc9f..11f7aac1a3eabbec64aaf1a42b0f355998ae8437 100644 >--- a/Source/WebCore/platform/audio/PlatformMediaSession.h >+++ b/Source/WebCore/platform/audio/PlatformMediaSession.h >@@ -255,7 +255,7 @@ protected: > > String convertEnumerationToString(PlatformMediaSession::State); > String convertEnumerationToString(PlatformMediaSession::InterruptionType); >- >+String convertEnumerationToString(PlatformMediaSession::RemoteControlCommandType); > } > > namespace WTF { >@@ -279,6 +279,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
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188314
:
346505
| 346774