Bug 202774 - [Picture-in-Picture Web API] The implementation needs runtime logging
Summary: [Picture-in-Picture Web API] The implementation needs runtime logging
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Peng Liu
URL:
Keywords: InRadar
Depends on: 201024
Blocks: 182688
  Show dependency treegraph
 
Reported: 2019-10-09 16:35 PDT by Peng Liu
Modified: 2019-10-25 07:17 PDT (History)
9 users (show)

See Also:


Attachments
Patch (8.12 KB, patch)
2019-10-18 14:44 PDT, Peng Liu
no flags Details | Formatted Diff | Diff
Patch (8.12 KB, patch)
2019-10-18 14:54 PDT, Peng Liu
eric.carlson: review+
Details | Formatted Diff | Diff
A revised patch (8.87 KB, patch)
2019-10-18 17:06 PDT, Peng Liu
no flags Details | Formatted Diff | Diff
Patch (8.31 KB, patch)
2019-10-22 12:41 PDT, Peng Liu
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peng Liu 2019-10-09 16:35:06 PDT
This bug is created to add runtime logging to the implementation.
Comment 1 Radar WebKit Bug Importer 2019-10-14 15:35:30 PDT
<rdar://problem/56266937>
Comment 2 Peng Liu 2019-10-18 14:44:49 PDT
Created attachment 381333 [details]
Patch
Comment 3 Peng Liu 2019-10-18 14:54:51 PDT
Created attachment 381335 [details]
Patch
Comment 4 Eric Carlson 2019-10-18 16:29:57 PDT
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 5 Peng Liu 2019-10-18 16:49:46 PDT
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.
Comment 6 Peng Liu 2019-10-18 17:06:26 PDT
Created attachment 381349 [details]
A revised patch
Comment 7 Peng Liu 2019-10-22 12:41:05 PDT
Created attachment 381584 [details]
Patch

Updated the patch after discussion with Eric offline
Comment 8 WebKit Commit Bot 2019-10-22 14:28:43 PDT
Comment on attachment 381584 [details]
Patch

Clearing flags on attachment: 381584

Committed r251458: <https://trac.webkit.org/changeset/251458>
Comment 9 WebKit Commit Bot 2019-10-22 14:28:44 PDT
All reviewed patches have been landed.  Closing bug.
Comment 10 Eric Carlson 2019-10-25 06:58:22 PDT
(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.
Comment 11 Peng Liu 2019-10-25 07:17:54 PDT
Right. We cannot use macros like ERROR_LOG because the function is static.