This bug is created to add runtime logging to the implementation.
<rdar://problem/56266937>
Created attachment 381333 [details] Patch
Created attachment 381335 [details] Patch
Comment on attachment 381335 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=381335&action=review > Source/WebCore/Modules/pictureinpicture/HTMLVideoElementPictureInPicture.cpp:73 > + LOG(Media, "HTMLVideoElementPictureInPicture::requestPictureInPicture"); ALWAYS_LOG(LOGIDENTIFIER) > Source/WebCore/Modules/pictureinpicture/HTMLVideoElementPictureInPicture.cpp:80 > + promise->reject(InvalidStateError, "The video element is not ready to enter the Picture-in-Picture mode."); You should add logging for each of these rejections, eg: ERROR_LOG(LOGIDENTIFIER, "The video element is not ready to enter the Picture-in-Picture mode") The string in the Promise rejection is available to script, but the runtime logging will show up in the console log so we can diagnose failures later. > Source/WebCore/Modules/pictureinpicture/HTMLVideoElementPictureInPicture.h:84 > + RefPtr<Logger> m_logger; This should be a Ref<const Logger>
Comment on attachment 381335 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=381335&action=review >> Source/WebCore/Modules/pictureinpicture/HTMLVideoElementPictureInPicture.cpp:73 >> + LOG(Media, "HTMLVideoElementPictureInPicture::requestPictureInPicture"); > > ALWAYS_LOG(LOGIDENTIFIER) Cannot use ALWAYS_LOG() here because this function is static. >> Source/WebCore/Modules/pictureinpicture/HTMLVideoElementPictureInPicture.cpp:80 >> + promise->reject(InvalidStateError, "The video element is not ready to enter the Picture-in-Picture mode."); > > You should add logging for each of these rejections, eg: > > ERROR_LOG(LOGIDENTIFIER, "The video element is not ready to enter the Picture-in-Picture mode") > > The string in the Promise rejection is available to script, but the runtime logging will show up in the console log so we can diagnose failures later. Right, will fix it. >> Source/WebCore/Modules/pictureinpicture/HTMLVideoElementPictureInPicture.h:84 >> + RefPtr<Logger> m_logger; > > This should be a Ref<const Logger> Right, will fix it.
Created attachment 381349 [details] A revised patch
Created attachment 381584 [details] Patch Updated the patch after discussion with Eric offline
Comment on attachment 381584 [details] Patch Clearing flags on attachment: 381584 Committed r251458: <https://trac.webkit.org/changeset/251458>
All reviewed patches have been landed. Closing bug.
(In reply to Peng Liu from comment #5) > Comment on attachment 381335 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=381335&action=review > > >> Source/WebCore/Modules/pictureinpicture/HTMLVideoElementPictureInPicture.cpp:80 > >> + promise->reject(InvalidStateError, "The video element is not ready to enter the Picture-in-Picture mode."); > > > > You should add logging for each of these rejections, eg: > > > > ERROR_LOG(LOGIDENTIFIER, "The video element is not ready to enter the Picture-in-Picture mode") > > > > The string in the Promise rejection is available to script, but the runtime logging will show up in the console log so we can diagnose failures later. > > Right, will fix it. > This was not changed in the final patch.
Right. We cannot use macros like ERROR_LOG because the function is static.