Title: [225696] trunk
Revision
225696
Author
[email protected]
Date
2017-12-08 12:33:53 -0800 (Fri, 08 Dec 2017)

Log Message

Move Logger from PAL to WTF so it can be used outside of WebCore
https://bugs.webkit.org/show_bug.cgi?id=180561

Reviewed by Alex Christensen.

Source/WebCore:

No new tests, existing API test updated.

* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
(PAL::LogArgument<webrtc::RTCStats>::toString): Deleted.
* dom/Document.cpp:
* dom/Document.h:
* html/HTMLMediaElement.cpp:
(PAL::LogArgument<WebCore::URL>::toString): Deleted.
* html/HTMLMediaElement.h:
* html/HTMLMediaElementEnums.h:
(PAL::LogArgument<WebCore::HTMLMediaElementEnums::ReadyState>::toString): Deleted.
(PAL::LogArgument<WebCore::HTMLMediaElementEnums::NetworkState>::toString): Deleted.
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::logger const):
* html/MediaElementSession.h:
* html/track/DataCue.h:
(PAL::LogArgument<WebCore::DataCue>::toString): Deleted.
* html/track/TextTrackCue.h:
(PAL::LogArgument<WebCore::TextTrackCue>::toString): Deleted.
* html/track/TextTrackCueGeneric.h:
(PAL::LogArgument<WebCore::TextTrackCueGeneric>::toString): Deleted.
* html/track/TrackBase.cpp:
(WebCore::nullLogger):
(WebCore::TrackBase::TrackBase):
* html/track/TrackBase.h:
* html/track/VTTCue.h:
(PAL::LogArgument<WebCore::VTTCue>::toString): Deleted.
* platform/graphics/InbandTextTrackPrivate.h:
* platform/graphics/InbandTextTrackPrivateClient.h:
(PAL::LogArgument<WebCore::GenericCueData>::toString): Deleted.
* platform/graphics/MediaPlayer.cpp:
(WebCore::nullLogger):
(WebCore::MediaPlayer::mediaPlayerLogger):
* platform/graphics/MediaPlayer.h:
(WTF::LogArgument<MediaTime>::toString):
(PAL::LogArgument<WTF::MediaTime>::toString): Deleted.
* platform/graphics/MediaPlayerEnums.h:
(PAL::LogArgument<WebCore::MediaPlayerEnums::ReadyState>::toString): Deleted.
(PAL::LogArgument<WebCore::MediaPlayerEnums::NetworkState>::toString): Deleted.
* platform/graphics/TrackPrivateBase.cpp:
(WebCore::TrackPrivateBase::setLogger):
* platform/graphics/TrackPrivateBase.h:
* platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
* platform/mediastream/RTCIceConnectionState.h:
(PAL::LogArgument<WebCore::RTCIceConnectionState>::toString): Deleted.
* platform/mediastream/RTCIceGatheringState.h:
(PAL::LogArgument<WebCore::RTCIceGatheringState>::toString): Deleted.
* platform/mediastream/RTCPeerConnectionState.h:
(PAL::LogArgument<WebCore::RTCPeerConnectionState>::toString): Deleted.
* platform/mediastream/RTCSignalingState.h:
(PAL::LogArgument<WebCore::RTCSignalingState>::toString): Deleted.
* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:

Source/WebCore/PAL:

* PAL.xcodeproj/project.pbxproj:
* pal/Logger.h: Removed.
* pal/LoggerHelper.h: Removed.

Source/WTF:

* WTF.xcodeproj/project.pbxproj:
* wtf/Logger.h: Copied from Source/WebCore/PAL/pal/Logger.h.
(PAL::LogArgument::toString): Deleted.
(PAL::Logger::create): Deleted.
(PAL::Logger::logAlways const): Deleted.
(PAL::Logger::error const): Deleted.
(PAL::Logger::warning const): Deleted.
(PAL::Logger::info const): Deleted.
(PAL::Logger::debug const): Deleted.
(PAL::Logger::willLog const): Deleted.
(PAL::Logger::enabled const): Deleted.
(PAL::Logger::setEnabled): Deleted.
(PAL::Logger::LogSiteIdentifier::LogSiteIdentifier): Deleted.
(PAL::Logger::addObserver): Deleted.
(PAL::Logger::removeObserver): Deleted.
(PAL::Logger::Logger): Deleted.
(PAL::Logger::log): Deleted.
(PAL::Logger::observers): Deleted.
(PAL::LogArgument<Logger::LogSiteIdentifier>::toString): Deleted.
* wtf/LoggerHelper.h: Copied from Source/WebCore/PAL/pal/LoggerHelper.h.

Tools:

* TestWebKitAPI/Tests/WebCore/Logging.cpp:
(TestWebKitAPI::TEST_F):

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (225695 => 225696)


--- trunk/Source/WTF/ChangeLog	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Source/WTF/ChangeLog	2017-12-08 20:33:53 UTC (rev 225696)
@@ -1,3 +1,31 @@
+2017-12-08  Eric Carlson  <[email protected]>
+
+        Move Logger from PAL to WTF so it can be used outside of WebCore
+        https://bugs.webkit.org/show_bug.cgi?id=180561
+
+        Reviewed by Alex Christensen.
+
+        * WTF.xcodeproj/project.pbxproj:
+        * wtf/Logger.h: Copied from Source/WebCore/PAL/pal/Logger.h.
+        (PAL::LogArgument::toString): Deleted.
+        (PAL::Logger::create): Deleted.
+        (PAL::Logger::logAlways const): Deleted.
+        (PAL::Logger::error const): Deleted.
+        (PAL::Logger::warning const): Deleted.
+        (PAL::Logger::info const): Deleted.
+        (PAL::Logger::debug const): Deleted.
+        (PAL::Logger::willLog const): Deleted.
+        (PAL::Logger::enabled const): Deleted.
+        (PAL::Logger::setEnabled): Deleted.
+        (PAL::Logger::LogSiteIdentifier::LogSiteIdentifier): Deleted.
+        (PAL::Logger::addObserver): Deleted.
+        (PAL::Logger::removeObserver): Deleted.
+        (PAL::Logger::Logger): Deleted.
+        (PAL::Logger::log): Deleted.
+        (PAL::Logger::observers): Deleted.
+        (PAL::LogArgument<Logger::LogSiteIdentifier>::toString): Deleted.
+        * wtf/LoggerHelper.h: Copied from Source/WebCore/PAL/pal/LoggerHelper.h.
+
 2017-12-08  Yusuke Suzuki  <[email protected]>
 
         Remove pthread_once in favor of dispatch_once

Modified: trunk/Source/WTF/WTF.xcodeproj/project.pbxproj (225695 => 225696)


--- trunk/Source/WTF/WTF.xcodeproj/project.pbxproj	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Source/WTF/WTF.xcodeproj/project.pbxproj	2017-12-08 20:33:53 UTC (rev 225696)
@@ -171,6 +171,8 @@
 /* End PBXContainerItemProxy section */
 
 /* Begin PBXFileReference section */
+		077CD86A1FD9CFD200828587 /* Logger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Logger.h; sourceTree = "<group>"; };
+		077CD86B1FD9CFD300828587 /* LoggerHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoggerHelper.h; sourceTree = "<group>"; };
 		0F0D85B317234CB100338210 /* NoLock.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NoLock.h; sourceTree = "<group>"; };
 		0F0F52691F421FF8004A452C /* StringMalloc.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = StringMalloc.cpp; sourceTree = "<group>"; };
 		0F0F526A1F421FF8004A452C /* StringMalloc.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = StringMalloc.h; sourceTree = "<group>"; };
@@ -908,6 +910,8 @@
 				0F60F32E1DFCBD1B00416D6C /* LockedPrintStream.h */,
 				A8A472C3151A825A004123FF /* Locker.h */,
 				5311BD551EA7E15A00525281 /* LocklessBag.h */,
+				077CD86A1FD9CFD200828587 /* Logger.h */,
+				077CD86B1FD9CFD300828587 /* LoggerHelper.h */,
 				513E170A1CD7D5BF00E3650B /* LoggingAccumulator.h */,
 				0F30BA8C1E78708E002CA847 /* LoggingHashID.h */,
 				0F30BA8D1E78708E002CA847 /* LoggingHashMap.h */,

Copied: trunk/Source/WTF/wtf/Logger.h (from rev 225695, trunk/Source/WebCore/PAL/pal/Logger.h) (0 => 225696)


--- trunk/Source/WTF/wtf/Logger.h	                        (rev 0)
+++ trunk/Source/WTF/wtf/Logger.h	2017-12-08 20:33:53 UTC (rev 225696)
@@ -0,0 +1,226 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include <wtf/Assertions.h>
+#include <wtf/HexNumber.h>
+#include <wtf/Noncopyable.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+#include <wtf/text/StringBuilder.h>
+#include <wtf/text/WTFString.h>
+
+namespace WTF {
+
+template<typename T>
+struct LogArgument {
+    template<typename U = T> static typename std::enable_if<std::is_same<U, bool>::value, String>::type toString(bool argument) { return argument ? ASCIILiteral("true") : ASCIILiteral("false"); }
+    template<typename U = T> static typename std::enable_if<std::is_same<U, int>::value, String>::type toString(int argument) { return String::number(argument); }
+    template<typename U = T> static typename std::enable_if<std::is_same<U, unsigned>::value, String>::type toString(unsigned argument) { return String::number(argument); }
+    template<typename U = T> static typename std::enable_if<std::is_same<U, unsigned long>::value, String>::type toString(unsigned long argument) { return String::number(argument); }
+    template<typename U = T> static typename std::enable_if<std::is_same<U, long>::value, String>::type toString(long argument) { return String::number(argument); }
+    template<typename U = T> static typename std::enable_if<std::is_same<U, float>::value, String>::type toString(float argument) { return String::number(argument); }
+    template<typename U = T> static typename std::enable_if<std::is_same<U, double>::value, String>::type toString(double argument) { return String::number(argument); }
+    template<typename U = T> static typename std::enable_if<std::is_same<typename std::remove_reference<U>::type, AtomicString>::value, String>::type toString(AtomicString argument) { return argument.string(); }
+    template<typename U = T> static typename std::enable_if<std::is_same<typename std::remove_reference<U>::type, String>::value, String>::type toString(String argument) { return argument; }
+    template<typename U = T> static typename std::enable_if<std::is_same<typename std::remove_reference<U>::type, StringBuilder*>::value, String>::type toString(StringBuilder* argument) { return argument->toString(); }
+    template<typename U = T> static typename std::enable_if<std::is_same<U, const char*>::value, String>::type toString(const char* argument) { return String(argument); }
+    template<size_t length> static String toString(const char (&argument)[length]) { return String(argument); }
+};
+
+class Logger : public RefCounted<Logger> {
+    WTF_MAKE_NONCOPYABLE(Logger);
+public:
+
+    class Observer {
+    public:
+        virtual ~Observer() = default;
+        virtual void didLogMessage(const WTFLogChannel&, WTFLogLevel, const String&) = 0;
+    };
+
+    static Ref<Logger> create(const void* owner)
+    {
+        return adoptRef(*new Logger(owner));
+    }
+
+    template<typename... Arguments>
+    inline void logAlways(WTFLogChannel& channel, UNUSED_FUNCTION const Arguments&... arguments) const
+    {
+#if RELEASE_LOG_DISABLED
+        // "Standard" WebCore logging goes to stderr, which is captured in layout test output and can generally be a problem
+        //  on some systems, so don't allow it.
+        UNUSED_PARAM(channel);
+#else
+        if (!willLog(channel, WTFLogLevelAlways))
+            return;
+
+        log(channel, WTFLogLevelAlways, arguments...);
+#endif
+    }
+
+    template<typename... Arguments>
+    inline void error(WTFLogChannel& channel, const Arguments&... arguments) const
+    {
+        if (!willLog(channel, WTFLogLevelError))
+            return;
+
+        log(channel, WTFLogLevelError, arguments...);
+    }
+
+    template<typename... Arguments>
+    inline void warning(WTFLogChannel& channel, const Arguments&... arguments) const
+    {
+        if (!willLog(channel, WTFLogLevelWarning))
+            return;
+
+        log(channel, WTFLogLevelWarning, arguments...);
+    }
+
+    template<typename... Arguments>
+    inline void info(WTFLogChannel& channel, const Arguments&... arguments) const
+    {
+        if (!willLog(channel, WTFLogLevelInfo))
+            return;
+
+        log(channel, WTFLogLevelInfo, arguments...);
+    }
+
+    template<typename... Arguments>
+    inline void debug(WTFLogChannel& channel, const Arguments&... arguments) const
+    {
+        if (!willLog(channel, WTFLogLevelDebug))
+            return;
+
+        log(channel, WTFLogLevelDebug, arguments...);
+    }
+
+    inline bool willLog(const WTFLogChannel& channel, WTFLogLevel level) const
+    {
+        if (!m_enabled)
+            return false;
+
+        if (level <= WTFLogLevelError)
+            return true;
+
+        if (channel.state == WTFLogChannelOff || level > channel.level)
+            return false;
+
+        return m_enabled;
+    }
+
+    bool enabled() const { return m_enabled; }
+    void setEnabled(const void* owner, bool enabled)
+    {
+        ASSERT(owner == m_owner);
+        if (owner == m_owner)
+            m_enabled = enabled;
+    }
+
+    struct LogSiteIdentifier {
+        LogSiteIdentifier(const char* methodName, const void* objectPtr)
+            : methodName { methodName }
+            , objectPtr { reinterpret_cast<uintptr_t>(objectPtr) }
+        {
+        }
+
+        LogSiteIdentifier(const char* className, const char* methodName, const void* objectPtr)
+            : className { className }
+            , methodName { methodName }
+            , objectPtr { reinterpret_cast<uintptr_t>(objectPtr) }
+        {
+        }
+
+        const char* className { nullptr };
+        const char* methodName { nullptr };
+        const uintptr_t objectPtr { 0 };
+    };
+
+    static inline void addObserver(Observer& observer)
+    {
+        observers().append(observer);
+    }
+    static inline void removeObserver(Observer& observer)
+    {
+        observers().removeFirstMatching([&observer](auto anObserver) {
+            return &anObserver.get() == &observer;
+        });
+    }
+
+private:
+    Logger(const void* owner)
+        : m_owner { owner }
+    {
+    }
+
+    template<typename... Argument>
+    static inline void log(WTFLogChannel& channel, WTFLogLevel level, const Argument&... arguments)
+    {
+        String logMessage = makeString(LogArgument<Argument>::toString(arguments)...);
+
+#if RELEASE_LOG_DISABLED
+        WTFLog(&channel, "%s", logMessage.utf8().data());
+#else
+        os_log(channel.osLogChannel, "%{public}s", logMessage.utf8().data());
+#endif
+
+        if (channel.state == WTFLogChannelOff || level > channel.level)
+            return;
+
+        for (Observer& observer : observers())
+            observer.didLogMessage(channel, level, logMessage);
+    }
+
+    static Vector<std::reference_wrapper<Observer>>& observers()
+    {
+        static NeverDestroyed<Vector<std::reference_wrapper<Observer>>> observers;
+        return observers;
+    }
+
+    const void* m_owner;
+    bool m_enabled { true };
+};
+
+template <>
+struct LogArgument<Logger::LogSiteIdentifier> {
+    static String toString(const Logger::LogSiteIdentifier& value)
+    {
+        StringBuilder builder;
+
+        if (value.className) {
+            builder.append(value.className);
+            builder.appendLiteral("::");
+        }
+        builder.append(value.methodName);
+        builder.appendLiteral("(");
+        appendUnsigned64AsHex(value.objectPtr, builder);
+        builder.appendLiteral(") ");
+        return builder.toString();
+    }
+};
+
+} // namespace WTF
+
+using WTF::Logger;

Copied: trunk/Source/WTF/wtf/LoggerHelper.h (from rev 225695, trunk/Source/WebCore/PAL/pal/LoggerHelper.h) (0 => 225696)


--- trunk/Source/WTF/wtf/LoggerHelper.h	                        (rev 0)
+++ trunk/Source/WTF/wtf/LoggerHelper.h	2017-12-08 20:33:53 UTC (rev 225696)
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include <wtf/Logger.h>
+
+namespace WTF {
+
+class LoggerHelper {
+public:
+    virtual ~LoggerHelper() = default;
+
+    virtual const Logger& logger() const = 0;
+    virtual const char* logClassName() const = 0;
+    virtual WTFLogChannel& logChannel() const = 0;
+    virtual const void* logIdentifier() const = 0;
+
+#if !RELEASE_LOG_DISABLED
+
+#define LOGIDENTIFIER WTF::Logger::LogSiteIdentifier(logClassName(), __func__, logIdentifier())
+
+#define ALWAYS_LOG(...)     logger().logAlways(logChannel(), __VA_ARGS__)
+#define ERROR_LOG(...)      logger().error(logChannel(), __VA_ARGS__)
+#define WARNING_LOG(...)    logger().warning(logChannel(), __VA_ARGS__)
+#define NOTICE_LOG(...)     logger().notice(logChannel(), __VA_ARGS__)
+#define INFO_LOG(...)       logger().info(logChannel(), __VA_ARGS__)
+#define DEBUG_LOG(...)      logger().debug(logChannel(), __VA_ARGS__)
+#define WILL_LOG(_level_)   logger().willLog(logChannel(), _level_)
+
+#else
+
+#define LOGIDENTIFIER ((void)0)
+
+#define ALWAYS_LOG(...)     ((void)0)
+#define ERROR_LOG(...)      ((void)0)
+#define ERROR_LOG(...)      ((void)0)
+#define WARNING_LOG(...)    ((void)0)
+#define NOTICE_LOG(...)     ((void)0)
+#define INFO_LOG(...)       ((void)0)
+#define DEBUG_LOG(...)      ((void)0)
+#define WILL_LOG(_level_)   false
+
+#endif
+    
+};
+
+} // namespace WTF
+
+using WTF::LoggerHelper;
+

Modified: trunk/Source/WebCore/ChangeLog (225695 => 225696)


--- trunk/Source/WebCore/ChangeLog	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Source/WebCore/ChangeLog	2017-12-08 20:33:53 UTC (rev 225696)
@@ -1,3 +1,69 @@
+2017-12-08  Eric Carlson  <[email protected]>
+
+        Move Logger from PAL to WTF so it can be used outside of WebCore
+        https://bugs.webkit.org/show_bug.cgi?id=180561
+
+        Reviewed by Alex Christensen.
+
+        No new tests, existing API test updated.
+
+        * Modules/mediastream/PeerConnectionBackend.h:
+        * Modules/mediastream/RTCPeerConnection.h:
+        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
+        (PAL::LogArgument<webrtc::RTCStats>::toString): Deleted.
+        * dom/Document.cpp:
+        * dom/Document.h:
+        * html/HTMLMediaElement.cpp:
+        (PAL::LogArgument<WebCore::URL>::toString): Deleted.
+        * html/HTMLMediaElement.h:
+        * html/HTMLMediaElementEnums.h:
+        (PAL::LogArgument<WebCore::HTMLMediaElementEnums::ReadyState>::toString): Deleted.
+        (PAL::LogArgument<WebCore::HTMLMediaElementEnums::NetworkState>::toString): Deleted.
+        * html/MediaElementSession.cpp:
+        (WebCore::MediaElementSession::logger const):
+        * html/MediaElementSession.h:
+        * html/track/DataCue.h:
+        (PAL::LogArgument<WebCore::DataCue>::toString): Deleted.
+        * html/track/TextTrackCue.h:
+        (PAL::LogArgument<WebCore::TextTrackCue>::toString): Deleted.
+        * html/track/TextTrackCueGeneric.h:
+        (PAL::LogArgument<WebCore::TextTrackCueGeneric>::toString): Deleted.
+        * html/track/TrackBase.cpp:
+        (WebCore::nullLogger):
+        (WebCore::TrackBase::TrackBase):
+        * html/track/TrackBase.h:
+        * html/track/VTTCue.h:
+        (PAL::LogArgument<WebCore::VTTCue>::toString): Deleted.
+        * platform/graphics/InbandTextTrackPrivate.h:
+        * platform/graphics/InbandTextTrackPrivateClient.h:
+        (PAL::LogArgument<WebCore::GenericCueData>::toString): Deleted.
+        * platform/graphics/MediaPlayer.cpp:
+        (WebCore::nullLogger):
+        (WebCore::MediaPlayer::mediaPlayerLogger):
+        * platform/graphics/MediaPlayer.h:
+        (WTF::LogArgument<MediaTime>::toString):
+        (PAL::LogArgument<WTF::MediaTime>::toString): Deleted.
+        * platform/graphics/MediaPlayerEnums.h:
+        (PAL::LogArgument<WebCore::MediaPlayerEnums::ReadyState>::toString): Deleted.
+        (PAL::LogArgument<WebCore::MediaPlayerEnums::NetworkState>::toString): Deleted.
+        * platform/graphics/TrackPrivateBase.cpp:
+        (WebCore::TrackPrivateBase::setLogger):
+        * platform/graphics/TrackPrivateBase.h:
+        * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
+        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
+        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
+        * platform/mediastream/RTCIceConnectionState.h:
+        (PAL::LogArgument<WebCore::RTCIceConnectionState>::toString): Deleted.
+        * platform/mediastream/RTCIceGatheringState.h:
+        (PAL::LogArgument<WebCore::RTCIceGatheringState>::toString): Deleted.
+        * platform/mediastream/RTCPeerConnectionState.h:
+        (PAL::LogArgument<WebCore::RTCPeerConnectionState>::toString): Deleted.
+        * platform/mediastream/RTCSignalingState.h:
+        (PAL::LogArgument<WebCore::RTCSignalingState>::toString): Deleted.
+        * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
+
 2017-12-08  Yusuke Suzuki  <[email protected]>
 
         Remove pthread_once in favor of dispatch_once

Modified: trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h (225695 => 225696)


--- trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Source/WebCore/Modules/mediastream/PeerConnectionBackend.h	2017-12-08 20:33:53 UTC (rev 225696)
@@ -37,8 +37,7 @@
 #include "RTCRtpParameters.h"
 #include "RTCSessionDescription.h"
 #include "RTCSignalingState.h"
-#include <pal/Logger.h>
-#include <pal/LoggerHelper.h>
+#include <wtf/LoggerHelper.h>
 
 namespace WebCore {
 
@@ -67,7 +66,7 @@
 
 class PeerConnectionBackend
 #if !RELEASE_LOG_DISABLED
-    : public PAL::LoggerHelper
+    : private LoggerHelper
 #endif
 {
 public:
@@ -120,7 +119,7 @@
     virtual void applyRotationForOutgoingVideoSources() { }
 
 #if !RELEASE_LOG_DISABLED
-    const PAL::Logger& logger() const final { return m_logger.get(); }
+    const Logger& logger() const final { return m_logger.get(); }
     const void* logIdentifier() const final { return m_logIdentifier; }
     const char* logClassName() const override { return "PeerConnectionBackend"; }
     WTFLogChannel& logChannel() const final;
@@ -176,7 +175,7 @@
     Vector<PendingICECandidate> m_pendingICECandidates;
 
 #if !RELEASE_LOG_DISABLED
-    Ref<const PAL::Logger> m_logger;
+    Ref<const Logger> m_logger;
     const void* m_logIdentifier;
 #endif
     bool m_negotiationNeeded { false };

Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h (225695 => 225696)


--- trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.h	2017-12-08 20:33:53 UTC (rev 225696)
@@ -45,7 +45,7 @@
 #include "RTCPeerConnectionState.h"
 #include "RTCRtpTransceiver.h"
 #include "RTCSignalingState.h"
-#include <pal/LoggerHelper.h>
+#include <wtf/LoggerHelper.h>
 
 namespace WebCore {
 
@@ -70,7 +70,7 @@
     , public EventTargetWithInlineData
     , public ActiveDOMObject
 #if !RELEASE_LOG_DISABLED
-    , public PAL::LoggerHelper
+    , private LoggerHelper
 #endif
 {
 public:
@@ -160,7 +160,7 @@
     bool hasPendingActivity() const final;
 
 #if !RELEASE_LOG_DISABLED
-    const PAL::Logger& logger() const final { return m_logger.get(); }
+    const Logger& logger() const final { return m_logger.get(); }
     const void* logIdentifier() const final { return m_logIdentifier; }
     const char* logClassName() const final { return "RTCPeerConnection"; }
     WTFLogChannel& logChannel() const final;
@@ -204,7 +204,7 @@
     RTCPeerConnectionState m_connectionState { RTCPeerConnectionState::New };
 
 #if !RELEASE_LOG_DISABLED
-    Ref<const PAL::Logger> m_logger;
+    Ref<const Logger> m_logger;
     const void* m_logIdentifier;
 #endif
 

Modified: trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h (225695 => 225696)


--- trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h	2017-12-08 20:33:53 UTC (rev 225696)
@@ -32,12 +32,11 @@
 #include "RealtimeOutgoingAudioSource.h"
 #include "RealtimeOutgoingVideoSource.h"
 #include <Timer.h>
-#include <pal/Logger.h>
-#include <pal/LoggerHelper.h>
 #include <webrtc/api/jsep.h>
 #include <webrtc/api/peerconnectioninterface.h>
 #include <webrtc/pc/peerconnectionfactory.h>
 #include <webrtc/pc/rtcstatscollector.h>
+#include <wtf/LoggerHelper.h>
 #include <wtf/ThreadSafeRefCounted.h>
 
 namespace webrtc {
@@ -62,7 +61,7 @@
     , private webrtc::PeerConnectionObserver
     , private webrtc::RTCStatsCollectorCallback
 #if !RELEASE_LOG_DISABLED
-    , public PAL::LoggerHelper
+    , private LoggerHelper
 #endif
 {
 public:
@@ -134,7 +133,7 @@
     bool shouldOfferAllowToReceiveVideo() const;
 
 #if !RELEASE_LOG_DISABLED
-    const PAL::Logger& logger() const final { return m_logger.get(); }
+    const Logger& logger() const final { return m_logger.get(); }
     const void* logIdentifier() const final { return m_logIdentifier; }
     const char* logClassName() const final { return "LibWebRTCMediaEndpoint"; }
     WTFLogChannel& logChannel() const final;
@@ -213,7 +212,7 @@
 
 #if !RELEASE_LOG_DISABLED
     int64_t m_statsFirstDeliveredTimestamp { 0 };
-    Ref<const PAL::Logger> m_logger;
+    Ref<const Logger> m_logger;
     const void* m_logIdentifier;
 #endif
 };
@@ -220,7 +219,7 @@
 
 } // namespace WebCore
 
-namespace PAL {
+namespace WTF {
 
 template<typename Type>
 struct LogArgument;
@@ -233,6 +232,6 @@
     }
 };
 
-}; // namespace PAL
+}; // namespace WTF
 
 #endif // USE(LIBWEBRTC)

Modified: trunk/Source/WebCore/PAL/ChangeLog (225695 => 225696)


--- trunk/Source/WebCore/PAL/ChangeLog	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Source/WebCore/PAL/ChangeLog	2017-12-08 20:33:53 UTC (rev 225696)
@@ -1,3 +1,14 @@
+2017-12-08  Eric Carlson  <[email protected]>
+
+        Move Logger from PAL to WTF so it can be used outside of WebCore
+        https://bugs.webkit.org/show_bug.cgi?id=180561
+
+        Reviewed by Alex Christensen.
+
+        * PAL.xcodeproj/project.pbxproj:
+        * pal/Logger.h: Removed.
+        * pal/LoggerHelper.h: Removed.
+
 2017-12-07  Myles C. Maxfield  <[email protected]>
 
         [Cocoa] Add SPI to disallow user-installed fonts

Modified: trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj (225695 => 225696)


--- trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj	2017-12-08 20:33:53 UTC (rev 225696)
@@ -21,8 +21,6 @@
 /* End PBXAggregateTarget section */
 
 /* Begin PBXBuildFile section */
-		0708AC331F4C874B001F788F /* Logger.h in Headers */ = {isa = PBXBuildFile; fileRef = 0708AC321F4C874A001F788F /* Logger.h */; };
-		07377ADC1F5777D90027F16D /* LoggerHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = 07377ADB1F5777D70027F16D /* LoggerHelper.h */; };
 		0C00CFD41F68CE4600AAC26D /* MediaTimeAVFoundation.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C00CFD21F68CE4600AAC26D /* MediaTimeAVFoundation.h */; };
 		0C2D9E731EEF5AF600DBC317 /* ExportMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C2D9E721EEF5AF600DBC317 /* ExportMacros.h */; };
 		0C2DA06D1F33CA8400DBC317 /* CFLocaleSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 0C2DA0671F33CA8400DBC317 /* CFLocaleSPI.h */; };
@@ -159,8 +157,6 @@
 /* End PBXContainerItemProxy section */
 
 /* Begin PBXFileReference section */
-		0708AC321F4C874A001F788F /* Logger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Logger.h; sourceTree = "<group>"; };
-		07377ADB1F5777D70027F16D /* LoggerHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoggerHelper.h; sourceTree = "<group>"; };
 		0C00CFD11F68CE4600AAC26D /* MediaTimeAVFoundation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MediaTimeAVFoundation.cpp; path = avfoundation/MediaTimeAVFoundation.cpp; sourceTree = "<group>"; };
 		0C00CFD21F68CE4600AAC26D /* MediaTimeAVFoundation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MediaTimeAVFoundation.h; path = avfoundation/MediaTimeAVFoundation.h; sourceTree = "<group>"; };
 		0C2D9E721EEF5AF600DBC317 /* ExportMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExportMacros.h; sourceTree = "<group>"; };
@@ -487,8 +483,6 @@
 				F44291621FA52670002CC93E /* FileSizeFormatter.cpp */,
 				F442915F1FA5261E002CC93E /* FileSizeFormatter.h */,
 				A39DE74D1F7C443C007BCB00 /* HysteresisActivity.h */,
-				0708AC321F4C874A001F788F /* Logger.h */,
-				07377ADB1F5777D70027F16D /* LoggerHelper.h */,
 				1C4876D61F8D7F4E00CCEEBD /* Logging.cpp */,
 				1C4876D71F8D7F4E00CCEEBD /* Logging.h */,
 				1C4876DD1F8D812B00CCEEBD /* LogInitialization.h */,
@@ -644,8 +638,6 @@
 				A30D41211F0DD0EA00B71954 /* KillRing.h in Headers */,
 				0C5AF91C1F43A4C7002EAC02 /* LaunchServicesSPI.h in Headers */,
 				0C2DA1471F3BEB4900DBC317 /* LinkPresentationSPI.h in Headers */,
-				0708AC331F4C874B001F788F /* Logger.h in Headers */,
-				07377ADC1F5777D90027F16D /* LoggerHelper.h in Headers */,
 				1C4876D91F8D7F4E00CCEEBD /* Logging.h in Headers */,
 				0C77858B1F45130F00F4EBB6 /* LookupSPI.h in Headers */,
 				0C2DA1481F3BEB4900DBC317 /* MachVMSPI.h in Headers */,

Deleted: trunk/Source/WebCore/PAL/pal/Logger.h (225695 => 225696)


--- trunk/Source/WebCore/PAL/pal/Logger.h	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Source/WebCore/PAL/pal/Logger.h	2017-12-08 20:33:53 UTC (rev 225696)
@@ -1,224 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include <wtf/Assertions.h>
-#include <wtf/HexNumber.h>
-#include <wtf/Noncopyable.h>
-#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
-#include <wtf/text/StringBuilder.h>
-#include <wtf/text/WTFString.h>
-
-namespace PAL {
-
-template<typename T>
-struct LogArgument {
-    template<typename U = T> static typename std::enable_if<std::is_same<U, bool>::value, String>::type toString(bool argument) { return argument ? ASCIILiteral("true") : ASCIILiteral("false"); }
-    template<typename U = T> static typename std::enable_if<std::is_same<U, int>::value, String>::type toString(int argument) { return String::number(argument); }
-    template<typename U = T> static typename std::enable_if<std::is_same<U, unsigned>::value, String>::type toString(unsigned argument) { return String::number(argument); }
-    template<typename U = T> static typename std::enable_if<std::is_same<U, unsigned long>::value, String>::type toString(unsigned long argument) { return String::number(argument); }
-    template<typename U = T> static typename std::enable_if<std::is_same<U, long>::value, String>::type toString(long argument) { return String::number(argument); }
-    template<typename U = T> static typename std::enable_if<std::is_same<U, float>::value, String>::type toString(float argument) { return String::number(argument); }
-    template<typename U = T> static typename std::enable_if<std::is_same<U, double>::value, String>::type toString(double argument) { return String::number(argument); }
-    template<typename U = T> static typename std::enable_if<std::is_same<typename std::remove_reference<U>::type, AtomicString>::value, String>::type toString(AtomicString argument) { return argument.string(); }
-    template<typename U = T> static typename std::enable_if<std::is_same<typename std::remove_reference<U>::type, String>::value, String>::type toString(String argument) { return argument; }
-    template<typename U = T> static typename std::enable_if<std::is_same<typename std::remove_reference<U>::type, StringBuilder*>::value, String>::type toString(StringBuilder* argument) { return argument->toString(); }
-    template<typename U = T> static typename std::enable_if<std::is_same<U, const char*>::value, String>::type toString(const char* argument) { return String(argument); }
-    template<size_t length> static String toString(const char (&argument)[length]) { return String(argument); }
-};
-
-class Logger : public RefCounted<Logger> {
-    WTF_MAKE_NONCOPYABLE(Logger);
-public:
-
-    class Observer {
-    public:
-        virtual ~Observer() = default;
-        virtual void didLogMessage(const WTFLogChannel&, WTFLogLevel, const String&) = 0;
-    };
-
-    static Ref<Logger> create(const void* owner)
-    {
-        return adoptRef(*new Logger(owner));
-    }
-
-    template<typename... Arguments>
-    inline void logAlways(WTFLogChannel& channel, UNUSED_FUNCTION const Arguments&... arguments) const
-    {
-#if RELEASE_LOG_DISABLED
-        // "Standard" WebCore logging goes to stderr, which is captured in layout test output and can generally be a problem
-        //  on some systems, so don't allow it.
-        UNUSED_PARAM(channel);
-#else
-        if (!willLog(channel, WTFLogLevelAlways))
-            return;
-
-        log(channel, WTFLogLevelAlways, arguments...);
-#endif
-    }
-
-    template<typename... Arguments>
-    inline void error(WTFLogChannel& channel, const Arguments&... arguments) const
-    {
-        if (!willLog(channel, WTFLogLevelError))
-            return;
-
-        log(channel, WTFLogLevelError, arguments...);
-    }
-
-    template<typename... Arguments>
-    inline void warning(WTFLogChannel& channel, const Arguments&... arguments) const
-    {
-        if (!willLog(channel, WTFLogLevelWarning))
-            return;
-
-        log(channel, WTFLogLevelWarning, arguments...);
-    }
-
-    template<typename... Arguments>
-    inline void info(WTFLogChannel& channel, const Arguments&... arguments) const
-    {
-        if (!willLog(channel, WTFLogLevelInfo))
-            return;
-
-        log(channel, WTFLogLevelInfo, arguments...);
-    }
-
-    template<typename... Arguments>
-    inline void debug(WTFLogChannel& channel, const Arguments&... arguments) const
-    {
-        if (!willLog(channel, WTFLogLevelDebug))
-            return;
-
-        log(channel, WTFLogLevelDebug, arguments...);
-    }
-
-    inline bool willLog(const WTFLogChannel& channel, WTFLogLevel level) const
-    {
-        if (!m_enabled)
-            return false;
-
-        if (level <= WTFLogLevelError)
-            return true;
-
-        if (channel.state == WTFLogChannelOff || level > channel.level)
-            return false;
-
-        return m_enabled;
-    }
-
-    bool enabled() const { return m_enabled; }
-    void setEnabled(const void* owner, bool enabled)
-    {
-        ASSERT(owner == m_owner);
-        if (owner == m_owner)
-            m_enabled = enabled;
-    }
-
-    struct LogSiteIdentifier {
-        LogSiteIdentifier(const char* methodName, const void* objectPtr)
-            : methodName { methodName }
-            , objectPtr { reinterpret_cast<uintptr_t>(objectPtr) }
-        {
-        }
-
-        LogSiteIdentifier(const char* className, const char* methodName, const void* objectPtr)
-            : className { className }
-            , methodName { methodName }
-            , objectPtr { reinterpret_cast<uintptr_t>(objectPtr) }
-        {
-        }
-
-        const char* className { nullptr };
-        const char* methodName { nullptr };
-        const uintptr_t objectPtr { 0 };
-    };
-
-    static inline void addObserver(Observer& observer)
-    {
-        observers().append(observer);
-    }
-    static inline void removeObserver(Observer& observer)
-    {
-        observers().removeFirstMatching([&observer](auto anObserver) {
-            return &anObserver.get() == &observer;
-        });
-    }
-
-private:
-    Logger(const void* owner)
-        : m_owner { owner }
-    {
-    }
-
-    template<typename... Argument>
-    static inline void log(WTFLogChannel& channel, WTFLogLevel level, const Argument&... arguments)
-    {
-        String logMessage = makeString(LogArgument<Argument>::toString(arguments)...);
-
-#if RELEASE_LOG_DISABLED
-        WTFLog(&channel, "%s", logMessage.utf8().data());
-#else
-        os_log(channel.osLogChannel, "%{public}s", logMessage.utf8().data());
-#endif
-
-        if (channel.state == WTFLogChannelOff || level > channel.level)
-            return;
-
-        for (Observer& observer : observers())
-            observer.didLogMessage(channel, level, logMessage);
-    }
-
-    static Vector<std::reference_wrapper<Observer>>& observers()
-    {
-        static NeverDestroyed<Vector<std::reference_wrapper<Observer>>> observers;
-        return observers;
-    }
-
-    const void* m_owner;
-    bool m_enabled { true };
-};
-
-template <>
-struct LogArgument<Logger::LogSiteIdentifier> {
-    static String toString(const Logger::LogSiteIdentifier& value)
-    {
-        StringBuilder builder;
-
-        if (value.className) {
-            builder.append(value.className);
-            builder.appendLiteral("::");
-        }
-        builder.append(value.methodName);
-        builder.appendLiteral("(");
-        appendUnsigned64AsHex(value.objectPtr, builder);
-        builder.appendLiteral(") ");
-        return builder.toString();
-    }
-};
-
-} // namespace PAL

Deleted: trunk/Source/WebCore/PAL/pal/LoggerHelper.h (225695 => 225696)


--- trunk/Source/WebCore/PAL/pal/LoggerHelper.h	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Source/WebCore/PAL/pal/LoggerHelper.h	2017-12-08 20:33:53 UTC (rev 225696)
@@ -1,71 +0,0 @@
-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-namespace PAL {
-
-class Logger;
-
-class LoggerHelper {
-public:
-    virtual ~LoggerHelper() = default;
-
-    virtual const Logger& logger() const = 0;
-    virtual const char* logClassName() const = 0;
-    virtual WTFLogChannel& logChannel() const = 0;
-    virtual const void* logIdentifier() const = 0;
-
-
-#if !RELEASE_LOG_DISABLED
-
-#define LOGIDENTIFIER PAL::Logger::LogSiteIdentifier(logClassName(), __func__, logIdentifier())
-
-#define ALWAYS_LOG(...)     logger().logAlways(logChannel(), __VA_ARGS__)
-#define ERROR_LOG(...)      logger().error(logChannel(), __VA_ARGS__)
-#define WARNING_LOG(...)    logger().warning(logChannel(), __VA_ARGS__)
-#define NOTICE_LOG(...)     logger().notice(logChannel(), __VA_ARGS__)
-#define INFO_LOG(...)       logger().info(logChannel(), __VA_ARGS__)
-#define DEBUG_LOG(...)      logger().debug(logChannel(), __VA_ARGS__)
-#define WILL_LOG(_level_)   logger().willLog(logChannel(), _level_)
-
-#else
-
-#define LOGIDENTIFIER ((void)0)
-
-#define ALWAYS_LOG(...)     ((void)0)
-#define ERROR_LOG(...)      ((void)0)
-#define ERROR_LOG(...)      ((void)0)
-#define WARNING_LOG(...)    ((void)0)
-#define NOTICE_LOG(...)     ((void)0)
-#define INFO_LOG(...)       ((void)0)
-#define DEBUG_LOG(...)      ((void)0)
-#define WILL_LOG(_level_)   false
-
-#endif
-    
-};
-
-} // namespace PAL

Modified: trunk/Source/WebCore/dom/Document.cpp (225695 => 225696)


--- trunk/Source/WebCore/dom/Document.cpp	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Source/WebCore/dom/Document.cpp	2017-12-08 20:33:53 UTC (rev 225696)
@@ -213,7 +213,6 @@
 #include <ctime>
 #include <inspector/ConsoleMessage.h>
 #include <inspector/ScriptCallStack.h>
-#include <pal/Logger.h>
 #include <wtf/CurrentTime.h>
 #include <wtf/Language.h>
 #include <wtf/NeverDestroyed.h>

Modified: trunk/Source/WebCore/dom/Document.h (225695 => 225696)


--- trunk/Source/WebCore/dom/Document.h	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Source/WebCore/dom/Document.h	2017-12-08 20:33:53 UTC (rev 225696)
@@ -51,12 +51,12 @@
 #include "UserActionElementSet.h"
 #include "ViewportArguments.h"
 #include "VisibilityState.h"
-#include <pal/Logger.h>
 #include <pal/SessionID.h>
 #include <wtf/Deque.h>
 #include <wtf/Forward.h>
 #include <wtf/HashCountedSet.h>
 #include <wtf/HashSet.h>
+#include <wtf/Logger.h>
 #include <wtf/ObjectIdentifier.h>
 #include <wtf/WeakPtr.h>
 #include <wtf/text/AtomicStringHash.h>
@@ -313,7 +313,7 @@
     , public FontSelectorClient
     , public FrameDestructionObserver
     , public Supplementable<Document>
-    , public PAL::Logger::Observer {
+    , public Logger::Observer {
 public:
     static Ref<Document> create(Frame* frame, const URL& url)
     {
@@ -1371,7 +1371,7 @@
     TextAutoSizing& textAutoSizing();
 #endif
 
-    PAL::Logger& logger();
+    Logger& logger();
 
     void hasStorageAccess(Ref<DeferredPromise>&& passedPromise);
     void requestStorageAccess(Ref<DeferredPromise>&& passedPromise);
@@ -1855,7 +1855,7 @@
 
     OrientationNotifier m_orientationNotifier;
     mutable PAL::SessionID m_sessionID;
-    mutable RefPtr<PAL::Logger> m_logger;
+    mutable RefPtr<Logger> m_logger;
     RefPtr<StringCallback> m_consoleMessageListener;
 
     static bool hasEverCreatedAnAXObjectCache;

Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (225695 => 225696)


--- trunk/Source/WebCore/html/HTMLMediaElement.cpp	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp	2017-12-08 20:33:53 UTC (rev 225696)
@@ -88,7 +88,6 @@
 #include "UserContentController.h"
 #include "UserGestureIndicator.h"
 #include <limits>
-#include <pal/Logger.h>
 #include <pal/SessionID.h>
 #include <pal/system/SleepDisabler.h>
 #include <runtime/Uint8Array.h>
@@ -166,7 +165,7 @@
 #include "VideoFullscreenModel.h"
 #endif
 
-namespace PAL {
+namespace WTF {
 template <>
 struct LogArgument<WebCore::URL> {
     static String toString(const WebCore::URL& url)

Modified: trunk/Source/WebCore/html/HTMLMediaElement.h (225695 => 225696)


--- trunk/Source/WebCore/html/HTMLMediaElement.h	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Source/WebCore/html/HTMLMediaElement.h	2017-12-08 20:33:53 UTC (rev 225696)
@@ -39,8 +39,8 @@
 #include "MediaPlayer.h"
 #include "MediaProducer.h"
 #include "VisibilityChangeClient.h"
-#include <pal/LoggerHelper.h>
 #include <wtf/Function.h>
+#include <wtf/LoggerHelper.h>
 #include <wtf/WeakPtr.h>
 
 #if ENABLE(VIDEO_TRACK)
@@ -66,7 +66,6 @@
 #endif
 
 namespace PAL {
-class Logger;
 class SleepDisabler;
 }
 
@@ -141,7 +140,7 @@
     , private CDMClient
 #endif
 #if !RELEASE_LOG_DISABLED
-    , public PAL::LoggerHelper
+    , private LoggerHelper
 #endif
 {
 public:
@@ -540,7 +539,7 @@
     bool supportsSeeking() const override;
 
 #if !RELEASE_LOG_DISABLED
-    const PAL::Logger& logger() const final { return *m_logger.get(); }
+    const Logger& logger() const final { return *m_logger.get(); }
     const void* logIdentifier() const final { return reinterpret_cast<const void*>(m_logIdentifier); }
     WTFLogChannel& logChannel() const final;
 #endif
@@ -906,7 +905,7 @@
     const char* logClassName() const final { return "HTMLMediaElement"; }
 
     const void* mediaPlayerLogIdentifier() final { return logIdentifier(); }
-    const PAL::Logger& mediaPlayerLogger() final { return logger(); }
+    const Logger& mediaPlayerLogger() final { return logger(); }
 #endif
 
     WeakPtrFactory<HTMLMediaElement> m_weakFactory;
@@ -1127,7 +1126,7 @@
     size_t m_reportedExtraMemoryCost { 0 };
 
 #if !RELEASE_LOG_DISABLED
-    RefPtr<PAL::Logger> m_logger;
+    RefPtr<Logger> m_logger;
     uint64_t m_logIdentifier;
 #endif
 

Modified: trunk/Source/WebCore/html/HTMLMediaElementEnums.h (225695 => 225696)


--- trunk/Source/WebCore/html/HTMLMediaElementEnums.h	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Source/WebCore/html/HTMLMediaElementEnums.h	2017-12-08 20:33:53 UTC (rev 225696)
@@ -63,7 +63,7 @@
 
 } // namespace WebCore
 
-namespace PAL {
+namespace WTF {
 
 template<typename Type>
 struct LogArgument;
@@ -84,5 +84,5 @@
     }
 };
 
-}; // namespace PAL
+}; // namespace WTF
 

Modified: trunk/Source/WebCore/html/MediaElementSession.cpp (225695 => 225696)


--- trunk/Source/WebCore/html/MediaElementSession.cpp	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Source/WebCore/html/MediaElementSession.cpp	2017-12-08 20:33:53 UTC (rev 225696)
@@ -845,7 +845,7 @@
 }
 
 #if !RELEASE_LOG_DISABLED
-const PAL::Logger& MediaElementSession::logger() const
+const Logger& MediaElementSession::logger() const
 {
     return m_element.logger();
 }

Modified: trunk/Source/WebCore/html/MediaElementSession.h (225695 => 225696)


--- trunk/Source/WebCore/html/MediaElementSession.h	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Source/WebCore/html/MediaElementSession.h	2017-12-08 20:33:53 UTC (rev 225696)
@@ -32,7 +32,7 @@
 #include "PlatformMediaSession.h"
 #include "SuccessOr.h"
 #include "Timer.h"
-#include <pal/LoggerHelper.h>
+#include <wtf/LoggerHelper.h>
 #include <wtf/TypeCasts.h>
 
 namespace WebCore {
@@ -54,9 +54,9 @@
 
 class MediaElementSession final : public PlatformMediaSession
 #if !RELEASE_LOG_DISABLED
-    , public PAL::LoggerHelper
+    , private LoggerHelper
 #endif
-    {
+{
     WTF_MAKE_FAST_ALLOCATED;
 public:
     explicit MediaElementSession(HTMLMediaElement&);
@@ -149,7 +149,7 @@
     }
 
 #if !RELEASE_LOG_DISABLED
-    const PAL::Logger& logger() const final;
+    const Logger& logger() const final;
     const void* logIdentifier() const final;
     const char* logClassName() const final { return "MediaElementSession"; }
     WTFLogChannel& logChannel() const final;

Modified: trunk/Source/WebCore/html/track/DataCue.h (225695 => 225696)


--- trunk/Source/WebCore/html/track/DataCue.h	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Source/WebCore/html/track/DataCue.h	2017-12-08 20:33:53 UTC (rev 225696)
@@ -108,7 +108,7 @@
 
 } // namespace WebCore
 
-namespace PAL {
+namespace WTF {
 
 template<typename Type>
 struct LogArgument;

Modified: trunk/Source/WebCore/html/track/TextTrackCue.h (225695 => 225696)


--- trunk/Source/WebCore/html/track/TextTrackCue.h	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Source/WebCore/html/track/TextTrackCue.h	2017-12-08 20:33:53 UTC (rev 225696)
@@ -121,7 +121,7 @@
 
 } // namespace WebCore
 
-namespace PAL {
+namespace WTF {
 
 template<typename Type>
 struct LogArgument;
@@ -134,7 +134,6 @@
     }
 };
 
-
 }
 
 #endif

Modified: trunk/Source/WebCore/html/track/TextTrackCueGeneric.h (225695 => 225696)


--- trunk/Source/WebCore/html/track/TextTrackCueGeneric.h	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Source/WebCore/html/track/TextTrackCueGeneric.h	2017-12-08 20:33:53 UTC (rev 225696)
@@ -94,7 +94,7 @@
 
 } // namespace WebCore
 
-namespace PAL {
+namespace WTF {
 
 template<typename Type>
 struct LogArgument;

Modified: trunk/Source/WebCore/html/track/TrackBase.cpp (225695 => 225696)


--- trunk/Source/WebCore/html/track/TrackBase.cpp	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Source/WebCore/html/track/TrackBase.cpp	2017-12-08 20:33:53 UTC (rev 225696)
@@ -35,6 +35,7 @@
 #include "HTMLMediaElement.h"
 
 namespace WebCore {
+using namespace WTF;
 
 static int s_uniqueId = 0;
 
@@ -45,9 +46,9 @@
     return reinterpret_cast<const void*>(++logIdentifier);
 }
 
-static RefPtr<PAL::Logger>& nullLogger()
+static RefPtr<Logger>& nullLogger()
 {
-    static NeverDestroyed<RefPtr<PAL::Logger>> logger;
+    static NeverDestroyed<RefPtr<Logger>> logger;
     return logger;
 }
 #endif
@@ -64,7 +65,7 @@
 
 #if !RELEASE_LOG_DISABLED
     if (!nullLogger().get()) {
-        nullLogger() = PAL::Logger::create(this);
+        nullLogger() = Logger::create(this);
         nullLogger()->setEnabled(this, false);
     }
 

Modified: trunk/Source/WebCore/html/track/TrackBase.h (225695 => 225696)


--- trunk/Source/WebCore/html/track/TrackBase.h	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Source/WebCore/html/track/TrackBase.h	2017-12-08 20:33:53 UTC (rev 225696)
@@ -27,8 +27,7 @@
 
 #if ENABLE(VIDEO_TRACK)
 
-#include <pal/Logger.h>
-#include <pal/LoggerHelper.h>
+#include <wtf/LoggerHelper.h>
 #include <wtf/text/AtomicString.h>
 
 namespace WebCore {
@@ -40,7 +39,7 @@
 class TrackBase
     : public RefCounted<TrackBase>
 #if !RELEASE_LOG_DISABLED
-    , private PAL::LoggerHelper
+    , private LoggerHelper
 #endif
 {
 public:
@@ -75,7 +74,7 @@
     virtual bool enabled() const = 0;
 
 #if !RELEASE_LOG_DISABLED
-    const PAL::Logger& logger() const final { ASSERT(m_logger); return *m_logger.get(); }
+    const Logger& logger() const final { ASSERT(m_logger); return *m_logger.get(); }
     const void* logIdentifier() const final { return m_logIdentifier; }
     WTFLogChannel& logChannel() const final;
 #endif
@@ -97,7 +96,7 @@
     AtomicString m_language;
     AtomicString m_validBCP47Language;
 #if !RELEASE_LOG_DISABLED
-    RefPtr<const PAL::Logger> m_logger;
+    RefPtr<const Logger> m_logger;
     const void* m_logIdentifier;
 #endif
 };

Modified: trunk/Source/WebCore/html/track/VTTCue.h (225695 => 225696)


--- trunk/Source/WebCore/html/track/VTTCue.h	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Source/WebCore/html/track/VTTCue.h	2017-12-08 20:33:53 UTC (rev 225696)
@@ -229,7 +229,7 @@
 
 } // namespace WebCore
 
-namespace PAL {
+namespace WTF {
 
 template<typename Type>
 struct LogArgument;

Modified: trunk/Source/WebCore/platform/graphics/InbandTextTrackPrivate.h (225695 => 225696)


--- trunk/Source/WebCore/platform/graphics/InbandTextTrackPrivate.h	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Source/WebCore/platform/graphics/InbandTextTrackPrivate.h	2017-12-08 20:33:53 UTC (rev 225696)
@@ -29,7 +29,6 @@
 #if ENABLE(VIDEO_TRACK)
 
 #include "InbandTextTrackPrivateClient.h"
-#include <pal/Logger.h>
 
 namespace WebCore {
 

Modified: trunk/Source/WebCore/platform/graphics/InbandTextTrackPrivateClient.h (225695 => 225696)


--- trunk/Source/WebCore/platform/graphics/InbandTextTrackPrivateClient.h	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Source/WebCore/platform/graphics/InbandTextTrackPrivateClient.h	2017-12-08 20:33:53 UTC (rev 225696)
@@ -264,7 +264,7 @@
 
 } // namespace WebCore
 
-namespace PAL {
+namespace WTF {
 
 template<typename Type>
 struct LogArgument;

Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp (225695 => 225696)


--- trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp	2017-12-08 20:33:53 UTC (rev 225696)
@@ -92,9 +92,9 @@
 const PlatformMedia NoPlatformMedia = { PlatformMedia::None, {0} };
 
 #if !RELEASE_LOG_DISABLED
-static RefPtr<PAL::Logger>& nullLogger()
+static RefPtr<Logger>& nullLogger()
 {
-    static NeverDestroyed<RefPtr<PAL::Logger>> logger;
+    static NeverDestroyed<RefPtr<Logger>> logger;
     return logger;
 }
 #endif
@@ -172,10 +172,10 @@
 class NullMediaPlayerClient : public MediaPlayerClient {
 public:
 #if !RELEASE_LOG_DISABLED
-    const PAL::Logger& mediaPlayerLogger() final
+    const Logger& mediaPlayerLogger() final
     {
         if (!nullLogger().get()) {
-            nullLogger() = PAL::Logger::create(this);
+            nullLogger() = Logger::create(this);
             nullLogger()->setEnabled(this, false);
         }
 
@@ -1503,7 +1503,7 @@
 }
 
 #if !RELEASE_LOG_DISABLED
-const PAL::Logger& MediaPlayer::mediaPlayerLogger()
+const Logger& MediaPlayer::mediaPlayerLogger()
 {
     return client().mediaPlayerLogger();
 }

Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.h (225695 => 225696)


--- trunk/Source/WebCore/platform/graphics/MediaPlayer.h	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.h	2017-12-08 20:33:53 UTC (rev 225696)
@@ -44,11 +44,11 @@
 #include "SecurityOriginHash.h"
 #include "Timer.h"
 #include "VideoTrackPrivate.h"
-#include <pal/Logger.h>
 #include <runtime/Uint8Array.h>
 #include <wtf/Forward.h>
 #include <wtf/Function.h>
 #include <wtf/HashSet.h>
+#include <wtf/Logger.h>
 #include <wtf/MediaTime.h>
 #include <wtf/Noncopyable.h>
 #include <wtf/Ref.h>
@@ -303,7 +303,7 @@
 
 #if !RELEASE_LOG_DISABLED
     virtual const void* mediaPlayerLogIdentifier() { return nullptr; }
-    virtual const PAL::Logger& mediaPlayerLogger() = 0;
+    virtual const Logger& mediaPlayerLogger() = 0;
 #endif
 };
 
@@ -633,7 +633,7 @@
     bool shouldCheckHardwareSupport() const;
 
 #if !RELEASE_LOG_DISABLED
-    const PAL::Logger& mediaPlayerLogger();
+    const Logger& mediaPlayerLogger();
     const void* mediaPlayerLogIdentifier() { return client().mediaPlayerLogIdentifier(); }
 #endif
 
@@ -689,14 +689,14 @@
 
 } // namespace WebCore
 
-namespace PAL {
+namespace WTF {
 
 template<typename Type>
 struct LogArgument;
 
 template <>
-struct LogArgument<WTF::MediaTime> {
-    static String toString(const WTF::MediaTime& time)
+struct LogArgument<MediaTime> {
+    static String toString(const MediaTime& time)
     {
         return time.toString();
     }

Modified: trunk/Source/WebCore/platform/graphics/MediaPlayerEnums.h (225695 => 225696)


--- trunk/Source/WebCore/platform/graphics/MediaPlayerEnums.h	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayerEnums.h	2017-12-08 20:33:53 UTC (rev 225696)
@@ -50,7 +50,7 @@
 } // namespace WebCore
 
 
-namespace PAL {
+namespace WTF {
 
 template<typename Type>
 struct LogArgument;
@@ -71,4 +71,4 @@
     }
 };
 
-}; // namespace PAL
+}; // namespace WTF

Modified: trunk/Source/WebCore/platform/graphics/TrackPrivateBase.cpp (225695 => 225696)


--- trunk/Source/WebCore/platform/graphics/TrackPrivateBase.cpp	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Source/WebCore/platform/graphics/TrackPrivateBase.cpp	2017-12-08 20:33:53 UTC (rev 225696)
@@ -33,7 +33,7 @@
 namespace WebCore {
 
 #if !RELEASE_LOG_DISABLED
-void TrackPrivateBase::setLogger(const PAL::Logger& logger, const void* logIdentifier)
+void TrackPrivateBase::setLogger(const Logger& logger, const void* logIdentifier)
 {
     m_logger = &logger;
     m_logIdentifier = logIdentifier;

Modified: trunk/Source/WebCore/platform/graphics/TrackPrivateBase.h (225695 => 225696)


--- trunk/Source/WebCore/platform/graphics/TrackPrivateBase.h	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Source/WebCore/platform/graphics/TrackPrivateBase.h	2017-12-08 20:33:53 UTC (rev 225696)
@@ -29,8 +29,7 @@
 
 #if ENABLE(VIDEO_TRACK)
 
-#include <pal/Logger.h>
-#include <pal/LoggerHelper.h>
+#include <wtf/LoggerHelper.h>
 #include <wtf/MediaTime.h>
 #include <wtf/ThreadSafeRefCounted.h>
 #include <wtf/text/AtomicString.h>
@@ -49,7 +48,7 @@
 class TrackPrivateBase
     : public ThreadSafeRefCounted<TrackPrivateBase>
 #if !RELEASE_LOG_DISABLED
-    , private PAL::LoggerHelper
+    , private LoggerHelper
 #endif
 {
     WTF_MAKE_NONCOPYABLE(TrackPrivateBase);
@@ -74,8 +73,8 @@
     }
 
 #if !RELEASE_LOG_DISABLED
-    void setLogger(const PAL::Logger&, const void*);
-    const PAL::Logger& logger() const final { ASSERT(m_logger); return *m_logger.get(); }
+    void setLogger(const Logger&, const void*);
+    const Logger& logger() const final { ASSERT(m_logger); return *m_logger.get(); }
     const void* logIdentifier() const final { return m_logIdentifier; }
     WTFLogChannel& logChannel() const final;
 #endif
@@ -84,7 +83,7 @@
     TrackPrivateBase() = default;
 
 #if !RELEASE_LOG_DISABLED
-    RefPtr<const PAL::Logger> m_logger;
+    RefPtr<const Logger> m_logger;
     const void* m_logIdentifier;
 #endif
 };

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm (225695 => 225696)


--- trunk/Source/WebCore/platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm	2017-12-08 20:33:53 UTC (rev 225696)
@@ -35,7 +35,6 @@
 #import <AVFoundation/AVPlayerItem.h>
 #import <AVFoundation/AVPlayerItemTrack.h>
 #import <objc/runtime.h>
-#import <pal/Logger.h>
 #import <wtf/SoftLinking.h>
 
 @class AVMediaSelectionOption;

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp (225695 => 225696)


--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp	2017-12-08 20:33:53 UTC (rev 225696)
@@ -42,7 +42,6 @@
 #include "URL.h"
 #include <CoreMedia/CoreMedia.h>
 #include <heap/HeapInlines.h>
-#include <pal/Logger.h>
 #include <runtime/DataView.h>
 #include <runtime/TypedArrayInlines.h>
 #include <runtime/Uint16Array.h>

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h (225695 => 225696)


--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h	2017-12-08 20:33:53 UTC (rev 225696)
@@ -32,18 +32,14 @@
 #include "InbandTextTrackPrivateAVF.h"
 #include "MediaPlayerPrivate.h"
 #include "Timer.h"
-#include <pal/LoggerHelper.h>
 #include <wtf/Deque.h>
 #include <wtf/Function.h>
 #include <wtf/HashSet.h>
 #include <wtf/Lock.h>
+#include <wtf/LoggerHelper.h>
 #include <wtf/RetainPtr.h>
 #include <wtf/WeakPtr.h>
 
-namespace PAL {
-class Logger;
-}
-
 namespace WebCore {
 
 class InbandMetadataTextTrackPrivateAVF;
@@ -52,7 +48,7 @@
 
 class MediaPlayerPrivateAVFoundation : public MediaPlayerPrivateInterface, public AVFInbandTrackParent
 #if !RELEASE_LOG_DISABLED
-    , private PAL::LoggerHelper
+    , private LoggerHelper
 #endif
 {
 public:
@@ -153,7 +149,7 @@
 #endif
 
 #if !RELEASE_LOG_DISABLED
-    const PAL::Logger& logger() const final { return m_logger.get(); }
+    const Logger& logger() const final { return m_logger.get(); }
     const char* logClassName() const override { return "MediaPlayerPrivateAVFoundation"; }
     const void* logIdentifier() const final { return reinterpret_cast<const void*>(m_logIdentifier); }
     WTFLogChannel& logChannel() const final;
@@ -355,7 +351,7 @@
     MediaPlayer::Preload m_preload;
 
 #if !RELEASE_LOG_DISABLED
-    Ref<const PAL::Logger> m_logger;
+    Ref<const Logger> m_logger;
     const void* m_logIdentifier;
 #endif
 

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (225695 => 225696)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm	2017-12-08 20:33:53 UTC (rev 225696)
@@ -3370,7 +3370,7 @@
 
 #if !RELEASE_LOG_DISABLED
     if (m_callback->logger().willLog(m_callback->logChannel(), WTFLogLevelDebug) && !([keyPath isEqualToString:@"loadedTimeRanges"] || [keyPath isEqualToString:@"seekableTimeRanges"])) {
-        auto identifier = PAL::Logger::LogSiteIdentifier("MediaPlayerPrivateAVFoundation", "observeValueForKeyPath", m_callback->logIdentifier());
+        auto identifier = Logger::LogSiteIdentifier("MediaPlayerPrivateAVFoundation", "observeValueForKeyPath", m_callback->logIdentifier());
 
         if (shouldLogValue) {
             if ([keyPath isEqualToString:@"duration"])

Modified: trunk/Source/WebCore/platform/mediastream/RTCIceConnectionState.h (225695 => 225696)


--- trunk/Source/WebCore/platform/mediastream/RTCIceConnectionState.h	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Source/WebCore/platform/mediastream/RTCIceConnectionState.h	2017-12-08 20:33:53 UTC (rev 225696)
@@ -42,7 +42,7 @@
 
 }; // namespace WebCore
 
-namespace PAL {
+namespace WTF {
 
 template<typename Type>
 struct LogArgument;
@@ -55,6 +55,6 @@
     }
 };
 
-}; // namespace PAL
+}; // namespace WTF
 
 #endif

Modified: trunk/Source/WebCore/platform/mediastream/RTCIceGatheringState.h (225695 => 225696)


--- trunk/Source/WebCore/platform/mediastream/RTCIceGatheringState.h	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Source/WebCore/platform/mediastream/RTCIceGatheringState.h	2017-12-08 20:33:53 UTC (rev 225696)
@@ -40,7 +40,7 @@
 
 }; // namespace WebCore
 
-namespace PAL {
+namespace WTF {
 
 template<typename Type>
 struct LogArgument;
@@ -53,6 +53,6 @@
     }
 };
 
-}; // namespace PAL
+}; // namespace WTF
 
 #endif

Modified: trunk/Source/WebCore/platform/mediastream/RTCPeerConnectionState.h (225695 => 225696)


--- trunk/Source/WebCore/platform/mediastream/RTCPeerConnectionState.h	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Source/WebCore/platform/mediastream/RTCPeerConnectionState.h	2017-12-08 20:33:53 UTC (rev 225696)
@@ -41,7 +41,7 @@
 
 }; // namespace WebCore
 
-namespace PAL {
+namespace WTF {
 
 template<typename Type>
 struct LogArgument;
@@ -54,6 +54,6 @@
     }
 };
 
-}; // namespace PAL
+}; // namespace WTF
 
 #endif

Modified: trunk/Source/WebCore/platform/mediastream/RTCSignalingState.h (225695 => 225696)


--- trunk/Source/WebCore/platform/mediastream/RTCSignalingState.h	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Source/WebCore/platform/mediastream/RTCSignalingState.h	2017-12-08 20:33:53 UTC (rev 225696)
@@ -40,7 +40,7 @@
 
 }; // namespace WebCore
 
-namespace PAL {
+namespace WTF {
 
 template<typename Type>
 struct LogArgument;
@@ -53,6 +53,6 @@
     }
 };
 
-}; // namespace PAL
+}; // namespace WTF
 
 #endif

Modified: trunk/Source/WebCore/platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp (225695 => 225696)


--- trunk/Source/WebCore/platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Source/WebCore/platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp	2017-12-08 20:33:53 UTC (rev 225696)
@@ -31,7 +31,6 @@
 #include "AudioSession.h"
 #include "CAAudioStreamDescription.h"
 #include "Logging.h"
-#include <pal/Logger.h>
 
 #include <pal/cf/CoreMediaSoftLink.h>
 

Modified: trunk/Tools/ChangeLog (225695 => 225696)


--- trunk/Tools/ChangeLog	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Tools/ChangeLog	2017-12-08 20:33:53 UTC (rev 225696)
@@ -1,3 +1,13 @@
+2017-12-08  Eric Carlson  <[email protected]>
+
+        Move Logger from PAL to WTF so it can be used outside of WebCore
+        https://bugs.webkit.org/show_bug.cgi?id=180561
+
+        Reviewed by Alex Christensen.
+
+        * TestWebKitAPI/Tests/WebCore/Logging.cpp:
+        (TestWebKitAPI::TEST_F):
+
 2017-12-08  Chris Dumez  <[email protected]>
 
         Different WebKitTestRunner instances should use different service worker registrations databases

Modified: trunk/Tools/TestWebKitAPI/Tests/WebCore/Logging.cpp (225695 => 225696)


--- trunk/Tools/TestWebKitAPI/Tests/WebCore/Logging.cpp	2017-12-08 20:32:42 UTC (rev 225695)
+++ trunk/Tools/TestWebKitAPI/Tests/WebCore/Logging.cpp	2017-12-08 20:33:53 UTC (rev 225696)
@@ -25,14 +25,12 @@
 
 #include "config.h"
 #include "WTFStringUtilities.h"
-#include <pal/Logger.h>
-#include <pal/LoggerHelper.h>
 #include <wtf/Assertions.h>
+#include <wtf/LoggerHelper.h>
 #include <wtf/MainThread.h>
 
 #define LOG_CHANNEL_PREFIX Test
 
-using namespace PAL;
 using namespace WTF;
 
 const char* logTestingSubsystem = "com.webkit.testing";
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to