Changeset 224030 in webkit
- Timestamp:
- Oct 26, 2017 11:38:54 AM (6 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r224027 r224030 1 2017-10-26 Youenn Fablet <youenn@apple.com> 2 3 Add inspector logging for MediaElementSession autoplay 4 https://bugs.webkit.org/show_bug.cgi?id=178846 5 6 Reviewed by Eric Carlson. 7 8 No change of behavior. 9 Making use of pal Logger in MediaElementSession. 10 This new logging is limited to autoplay/playback for now. 11 12 * html/MediaElementSession.cpp: 13 (WebCore::MediaElementSession::MediaElementSession): 14 (WebCore::MediaElementSession::playbackPermitted const): 15 (WebCore::MediaElementSession::autoplayPermitted const): 16 (WebCore::MediaElementSession::willLog const): 17 (WebCore::MediaElementSession::logChannel const): 18 * html/MediaElementSession.h: 19 1 20 2017-10-26 Keith Miller <keith_miller@apple.com> 2 21 -
trunk/Source/WebCore/html/HTMLMediaElement.h
r223960 r224030 542 542 const PAL::Logger& logger() const final { return *m_logger.get(); } 543 543 const void* logIdentifier() const final { return reinterpret_cast<const void*>(m_logIdentifier); } 544 #endif 544 WTFLogChannel& logChannel() const final; 545 #endif 546 547 bool willLog(WTFLogLevel) const; 545 548 546 549 protected: … … 903 906 #if !RELEASE_LOG_DISABLED 904 907 const char* logClassName() const final { return "HTMLMediaElement"; } 905 WTFLogChannel& logChannel() const final;906 908 907 909 const void* mediaPlayerLogIdentifier() final { return logIdentifier(); } 908 910 const PAL::Logger& mediaPlayerLogger() final { return logger(); } 909 911 #endif 910 911 bool willLog(WTFLogLevel) const;912 912 913 913 WeakPtrFactory<HTMLMediaElement> m_weakFactory; -
trunk/Source/WebCore/html/MediaElementSession.cpp
r223644 r224030 170 170 171 171 if (requiresFullscreenForVideoPlayback(element) && !fullscreenPermitted(element)) { 172 RELEASE_LOG(Media, "MediaElementSession::playbackPermitted - returning FALSE because of fullscreen restriction");172 ALWAYS_LOG(LOGIDENTIFIER, "Returning FALSE because of fullscreen restriction"); 173 173 return MediaPlaybackDenialReason::FullscreenRequired; 174 174 } … … 197 197 198 198 if (m_restrictions & RequireUserGestureForVideoRateChange && element.isVideo() && !element.document().processingUserGestureForMedia()) { 199 RELEASE_LOG(Media, "MediaElementSession::playbackPermitted - returning FALSE because ofvideo rate change restriction");199 ALWAYS_LOG(LOGIDENTIFIER, "Returning FALSE because a user gesture is required for video rate change restriction"); 200 200 return MediaPlaybackDenialReason::UserGestureRequired; 201 201 } 202 202 203 203 if (m_restrictions & RequireUserGestureForAudioRateChange && (!element.isVideo() || element.hasAudio()) && !element.muted() && element.volume() && !element.document().processingUserGestureForMedia()) { 204 RELEASE_LOG(Media, "MediaElementSession::playbackPermitted - returning FALSE because ofaudio rate change restriction");204 ALWAYS_LOG(LOGIDENTIFIER, "Returning FALSE because a user gesture is required for audio rate change restriction"); 205 205 return MediaPlaybackDenialReason::UserGestureRequired; 206 206 } 207 207 208 208 if (m_restrictions & RequireUserGestureForVideoDueToLowPowerMode && element.isVideo() && !element.document().processingUserGestureForMedia()) { 209 RELEASE_LOG(Media, "MediaElementSession::playbackPermitted - returning FALSE because of video low power mode restriction");209 ALWAYS_LOG(LOGIDENTIFIER, "Returning FALSE because of video low power mode restriction"); 210 210 return MediaPlaybackDenialReason::UserGestureRequired; 211 211 } … … 230 230 231 231 auto* renderer = m_element.renderer(); 232 if (!renderer) 233 return false; 234 if (renderer->style().visibility() != VISIBLE) 235 return false; 236 if (renderer->view().frameView().isOffscreen()) 237 return false; 238 if (renderer->visibleInViewportState() != VisibleInViewportState::Yes) 239 return false; 232 if (!renderer) { 233 ALWAYS_LOG(LOGIDENTIFIER, "Returning FALSE because element has no renderer"); 234 return false; 235 } 236 if (renderer->style().visibility() != VISIBLE) { 237 ALWAYS_LOG(LOGIDENTIFIER, "Returning FALSE because element is not visible"); 238 return false; 239 } 240 if (renderer->view().frameView().isOffscreen()) { 241 ALWAYS_LOG(LOGIDENTIFIER, "Returning FALSE because frame is offscreen"); 242 return false; 243 } 244 if (renderer->visibleInViewportState() != VisibleInViewportState::Yes) { 245 ALWAYS_LOG(LOGIDENTIFIER, "Returning FALSE because element is not visible in the viewport"); 246 return false; 247 } 240 248 return true; 241 249 } … … 832 840 } 833 841 842 bool MediaElementSession::willLog(WTFLogLevel level) const 843 { 844 return m_element.willLog(level); 845 } 846 847 #if !RELEASE_LOG_DISABLED 848 const PAL::Logger& MediaElementSession::logger() const 849 { 850 return m_element.logger(); 851 } 852 853 const void* MediaElementSession::logIdentifier() const 854 { 855 return m_element.logIdentifier(); 856 } 857 858 WTFLogChannel& MediaElementSession::logChannel() const 859 { 860 return m_element.logChannel(); 861 } 862 #endif 863 834 864 } 835 865 -
trunk/Source/WebCore/html/MediaElementSession.h
r223728 r224030 33 33 #include "SuccessOr.h" 34 34 #include "Timer.h" 35 #include <pal/LoggerHelper.h> 35 36 #include <wtf/TypeCasts.h> 36 37 … … 52 53 class SourceBuffer; 53 54 54 class MediaElementSession final : public PlatformMediaSession { 55 class MediaElementSession final : public PlatformMediaSession 56 #if !RELEASE_LOG_DISABLED 57 , public PAL::LoggerHelper 58 #endif 59 { 55 60 WTF_MAKE_FAST_ALLOCATED; 56 61 public: … … 144 149 } 145 150 151 #if !RELEASE_LOG_DISABLED 152 const PAL::Logger& logger() const final; 153 const void* logIdentifier() const final; 154 const char* logClassName() const final { return "MediaElementSession"; } 155 WTFLogChannel& logChannel() const final; 156 #endif 157 bool willLog(WTFLogLevel) const; 158 146 159 private: 147 160
Note: See TracChangeset
for help on using the changeset viewer.