Switch HTMLMediaElement to release logging
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Sep 2017 20:40:11 +0000 (20:40 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Sep 2017 20:40:11 +0000 (20:40 +0000)
commit21771346c7810f7a8f0bee32ed383d0bd3c3adf1
tree3f9207b960fd5798295162ddc0bcf4199ba2e915
parent9e8ab02b97fae4ef7851318ac469b2628781935e
Switch HTMLMediaElement to release logging
https://bugs.webkit.org/show_bug.cgi?id=176065

Reviewed by Jer Noble.

Source/WebCore:

* dom/Document.cpp:
(WebCore::Document::privateBrowsingStateDidChange): Disable the logger when private browsing
mode is enabled.
(WebCore::Document::logger const):
* dom/Document.h:

Convert debug-only logging to configurable release logging.
* html/HTMLMediaElement.cpp:
(PAL::LogArgument<WebCore::URL>::toString): Logger template for URL that returns the url as a
String when only when the LOG_DISABLED build flag is not defined. Returns "[url]" when it is.
* html/HTMLMediaElement.h:

Source/WTF:

* wtf/MediaTime.cpp:
(WTF::MediaTime::dump const): Use toString.
(WTF::MediaTime::toString const): New.
* wtf/MediaTime.h:
(PAL::LogArgument<WTF::MediaTime>::toString): Logger template.

Tools:

* TestWebKitAPI/Tests/WebCore/Logging.cpp:
(TestWebKitAPI::LogObserver::level const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@221494 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
Source/WTF/ChangeLog
Source/WTF/wtf/MediaTime.cpp
Source/WTF/wtf/MediaTime.h
Source/WebCore/ChangeLog
Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj
Source/WebCore/PAL/pal/Logger.h
Source/WebCore/PAL/pal/LoggerHelper.h [new file with mode: 0644]
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebCore/Logging.cpp