Switch HTMLMediaElement to release logging
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 Aug 2017 21:41:01 +0000 (21:41 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 Aug 2017 21:41:01 +0000 (21:41 +0000)
commitd9040aed8f14158e60e9a1718e4ac7f4317e5275
tree23520992ca6814752a86c20776760d69cbb369c2
parent629e783b6de89c7fa3b1103a3de51a1f8c9547ce
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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@221445 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 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/TestWebKitAPI/Tests/WebCore/Logging.cpp