Bug 179732 - Log media readyState and networkState as strings
Summary: Log media readyState and networkState as strings
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Eric Carlson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-11-15 10:15 PST by Eric Carlson
Modified: 2018-01-31 09:36 PST (History)
4 users (show)

See Also:


Attachments
Proposed patch (13.85 KB, patch)
2017-11-15 11:26 PST, Eric Carlson
no flags Details | Formatted Diff | Diff
Patch for landing. (13.85 KB, patch)
2017-11-15 14:22 PST, Eric Carlson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Carlson 2017-11-15 10:15:29 PST
Log states as readable strings instead of as integers.
Comment 1 Eric Carlson 2017-11-15 11:26:35 PST
Created attachment 327000 [details]
Proposed patch
Comment 2 Radar WebKit Bug Importer 2017-11-15 11:27:25 PST
<rdar://problem/35565687>
Comment 3 Build Bot 2017-11-15 13:30:53 PST
Attachment 327000 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/graphics/MediaPlayer.cpp:1525:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
ERROR: Source/WebCore/platform/graphics/MediaPlayer.cpp:1545:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
ERROR: Source/WebCore/html/HTMLMediaElement.cpp:266:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
ERROR: Source/WebCore/html/HTMLMediaElement.cpp:283:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
Total errors found: 4 in 6 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 youenn fablet 2017-11-15 13:33:16 PST
Comment on attachment 327000 [details]
Proposed patch

View in context: https://bugs.webkit.org/attachment.cgi?id=327000&action=review

> Source/WebCore/html/HTMLMediaElement.cpp:2555
> +            ALWAYS_LOG(LOGIDENTIFIER, "AUTOPLAY BLOCKED, USER GESTURE REQUIRED");

IIANM, we will have twice the same message here and above.
Would it be possible to disambiguate this with something like Autoplay blocked in future data state, User gesture required?
Also I am not sure we should uppercase the message, or is it to attract the eye?
Comment 5 Eric Carlson 2017-11-15 14:17:39 PST
(In reply to youenn fablet from comment #4)
> Comment on attachment 327000 [details]
> Proposed patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=327000&action=review
> 
> > Source/WebCore/html/HTMLMediaElement.cpp:2555
> > +            ALWAYS_LOG(LOGIDENTIFIER, "AUTOPLAY BLOCKED, USER GESTURE REQUIRED");
> 
> IIANM, we will have twice the same message here and above.

No, the first happens when readyState is HAVE_ENOUGH_DATA, the second when it is HAVE_FUTURE_DATA.

> Would it be possible to disambiguate this with something like Autoplay
> blocked in future data state, User gesture required?
> Also I am not sure we should uppercase the message, or is it to attract the
> eye?

Yes, I put it upper case to make it more visible in the log. I suppose it isn't necessary, I will change back before landing.
Comment 6 Eric Carlson 2017-11-15 14:22:03 PST
Created attachment 327025 [details]
Patch for landing.
Comment 7 WebKit Commit Bot 2017-11-15 15:25:38 PST
Comment on attachment 327025 [details]
Patch for landing.

Clearing flags on attachment: 327025

Committed r224904: <https://trac.webkit.org/changeset/224904>