⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 220058 in webkit


Ignore:
Timestamp:
Jul 31, 2017, 2:14:58 AM (9 years ago)
Author:
calvaris@igalia.com
Message:

Created a bool pretty printer at WTF for debugging purposes
​https://bugs.webkit.org/show_bug.cgi?id=174893

Reviewed by Darin Adler.

Source/WebCore:

Use WTF::boolPrettyPrinter in debugging messages.

  • platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:

(WebCore::MediaPlayerPrivateGStreamerBase::supportsKeySystem):

  • platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:

(WebCore::MediaPlayerPrivateGStreamerMSE::seek):

Source/WTF:

  • wtf/PrintStream.cpp:

(WTF::printInternal): The overload taking bool uses boolForPrinting

  • wtf/PrintStream.h:

(WTF::boolForPrinting): Converts a bool in "true" or "false".

Location:
trunk/Source
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r220053 r220058  
     12017-07-31  Xabier Rodriguez Calvar  <calvaris@igalia.com>
     2
     3        Created a bool pretty printer at WTF for debugging purposes
     4        https://bugs.webkit.org/show_bug.cgi?id=174893
     5
     6        Reviewed by Darin Adler.
     7
     8        * wtf/PrintStream.cpp:
     9        (WTF::printInternal): The overload taking bool uses boolForPrinting
     10        * wtf/PrintStream.h:
     11        (WTF::boolForPrinting): Converts a bool in "true" or "false".
     12
    1132017-07-30  Yusuke Suzuki  <utatane.tea@gmail.com>
    214
  • trunk/Source/WTF/wtf/PrintStream.cpp

    r209808 r220058  
    109109void printInternal(PrintStream& out, bool value)
    110110{
    111     if (value)
    112         out.print("true");
    113     else
    114         out.print("false");
     111    out.print(boolForPrinting(value));
    115112}
    116113
  • trunk/Source/WTF/wtf/PrintStream.h

    r209808 r220058  
    4444class StringView;
    4545class UniquedStringImpl;
     46
     47inline const char* boolForPrinting(bool value)
     48{
     49    return value ? "true" : "false";
     50}
    4651
    4752class PrintStream {
    … …  
    338343} // namespace WTF
    339344
     345using WTF::boolForPrinting;
    340346using WTF::CharacterDump;
    341347using WTF::PointerDump;
  • trunk/Source/WebCore/ChangeLog

    r220054 r220058  
     12017-07-31  Xabier Rodriguez Calvar  <calvaris@igalia.com>
     2
     3        Created a bool pretty printer at WTF for debugging purposes
     4        https://bugs.webkit.org/show_bug.cgi?id=174893
     5
     6        Reviewed by Darin Adler.
     7
     8        Use WTF::boolPrettyPrinter in debugging messages.
     9
     10        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
     11        (WebCore::MediaPlayerPrivateGStreamerBase::supportsKeySystem):
     12        * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
     13        (WebCore::MediaPlayerPrivateGStreamerMSE::seek):
     14
    1152017-07-30  Zan Dobersek  <zdobersek@igalia.com>
    216
  • trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp

    r219979 r220058  
    10411041#endif
    10421042
    1043     GST_DEBUG("checking for KeySystem support with %s and type %s: %s", keySystem.utf8().data(), mimeType.utf8().data(), result ? "true" : "false");
     1043    GST_DEBUG("checking for KeySystem support with %s and type %s: %s", keySystem.utf8().data(), mimeType.utf8().data(), boolForPrinting(result));
    10441044    return result;
    10451045}
  • trunk/Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp

    r217966 r220058  
    198198
    199199    m_isEndReached = false;
    200     GST_DEBUG("m_seeking=%s, m_seekTime=%f", m_seeking ? "true" : "false", m_seekTime);
     200    GST_DEBUG("m_seeking=%s, m_seekTime=%f", boolForPrinting(m_seeking), m_seekTime);
    201201}
    202202
Note: See TracChangeset for help on using the changeset viewer.