Allow PAL to log messages
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Oct 2017 20:30:16 +0000 (20:30 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Oct 2017 20:30:16 +0000 (20:30 +0000)
https://bugs.webkit.org/show_bug.cgi?id=171523

Reviewed by Alex Christensen.

Source/WebCore:

Make the model of WebCore/PAL match the model of WebKit/WebCore. This is because PAL will
need to log things (because existing files in WebCore/platform need to log things).

No new tests because there is no behavior change.

* WebCore.xcodeproj/project.pbxproj:
* page/mac/PageMac.mm:
(WebCore::Page::platformInitialize):
* platform/Logging.cpp:
(WebCore::registerNotifyCallback): Deleted.
* platform/Logging.h:
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForWithReason):

Source/WebCore/PAL:

* PAL.xcodeproj/project.pbxproj:
* pal/CMakeLists.txt:
* pal/LogInitialization.h: Copied from Source/WebCore/platform/LogMacros.h.
* pal/LogMacros.h: Copied from Source/WebCore/platform/LogMacros.h.
* pal/Logging.cpp: Copied from Source/WebCore/platform/Logging.cpp.
(PAL::isLogChannelEnabled):
(PAL::setLogChannelToAccumulate):
(PAL::initializeLogChannelsIfNecessary):
(PAL::registerNotifyCallback):
* pal/Logging.h: Copied from Source/WebCore/platform/LogMacros.h.
* pal/PlatformMac.cmake:
* pal/cocoa/LoggingCocoa.mm: Renamed from Source/WebCore/platform/LogMacros.h.
(PAL::logLevelString):

Source/WebKit:

* Platform/Logging.h:
* Scripts/generate-forwarding-headers.pl:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223206 268f45cc-cd09-0410-ab3c-d52691b4dbfc

18 files changed:
Source/WebCore/ChangeLog
Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj
Source/WebCore/PAL/pal/CMakeLists.txt
Source/WebCore/PAL/pal/LogInitialization.h [new file with mode: 0644]
Source/WebCore/PAL/pal/LogMacros.h [moved from Source/WebCore/platform/LogMacros.h with 96% similarity]
Source/WebCore/PAL/pal/Logging.cpp [new file with mode: 0644]
Source/WebCore/PAL/pal/Logging.h [new file with mode: 0644]
Source/WebCore/PAL/pal/PlatformMac.cmake
Source/WebCore/PAL/pal/cocoa/LoggingCocoa.mm [new file with mode: 0644]
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/page/mac/PageMac.mm
Source/WebCore/platform/Logging.cpp
Source/WebCore/platform/Logging.h
Source/WebCore/rendering/SimpleLineLayout.cpp
Source/WebKit/ChangeLog
Source/WebKit/Platform/Logging.h
Source/WebKit/Scripts/generate-forwarding-headers.pl

index 2ee8eb5..453195c 100644 (file)
@@ -1,3 +1,24 @@
+2017-10-11  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        Allow PAL to log messages
+        https://bugs.webkit.org/show_bug.cgi?id=171523
+
+        Reviewed by Alex Christensen.
+
+        Make the model of WebCore/PAL match the model of WebKit/WebCore. This is because PAL will
+        need to log things (because existing files in WebCore/platform need to log things).
+
+        No new tests because there is no behavior change.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * page/mac/PageMac.mm:
+        (WebCore::Page::platformInitialize):
+        * platform/Logging.cpp:
+        (WebCore::registerNotifyCallback): Deleted.
+        * platform/Logging.h:
+        * rendering/SimpleLineLayout.cpp:
+        (WebCore::SimpleLineLayout::canUseForWithReason):
+
 2017-10-11  Chris Dumez  <cdumez@apple.com>
 
         Unreviewed, fix build with some SDKs.
 2017-10-11  Chris Dumez  <cdumez@apple.com>
 
         Unreviewed, fix build with some SDKs.
index eda7405..c9207aa 100644 (file)
@@ -1,3 +1,24 @@
+2017-10-11  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        Allow PAL to log messages
+        https://bugs.webkit.org/show_bug.cgi?id=171523
+
+        Reviewed by Alex Christensen.
+
+        * PAL.xcodeproj/project.pbxproj:
+        * pal/CMakeLists.txt:
+        * pal/LogInitialization.h: Copied from Source/WebCore/platform/LogMacros.h.
+        * pal/LogMacros.h: Copied from Source/WebCore/platform/LogMacros.h.
+        * pal/Logging.cpp: Copied from Source/WebCore/platform/Logging.cpp.
+        (PAL::isLogChannelEnabled):
+        (PAL::setLogChannelToAccumulate):
+        (PAL::initializeLogChannelsIfNecessary):
+        (PAL::registerNotifyCallback):
+        * pal/Logging.h: Copied from Source/WebCore/platform/LogMacros.h.
+        * pal/PlatformMac.cmake:
+        * pal/cocoa/LoggingCocoa.mm: Renamed from Source/WebCore/platform/LogMacros.h.
+        (PAL::logLevelString):
+
 2017-10-06  Chris Dumez  <cdumez@apple.com>
 
         [Beacon][Cocoa] Beacon requests with BufferSource payload should not have a Content-Type HTTP header
 2017-10-06  Chris Dumez  <cdumez@apple.com>
 
         [Beacon][Cocoa] Beacon requests with BufferSource payload should not have a Content-Type HTTP header
index 9b7f290..f51adb0 100644 (file)
                1C09D0531E31C44100725F18 /* CryptoDigest.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C09D0521E31C44100725F18 /* CryptoDigest.h */; };
                1C09D0561E31C46500725F18 /* CryptoDigestCommonCrypto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C09D0551E31C46500725F18 /* CryptoDigestCommonCrypto.cpp */; };
                1C09D0581E31C57E00725F18 /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C09D0571E31C57E00725F18 /* config.h */; };
                1C09D0531E31C44100725F18 /* CryptoDigest.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C09D0521E31C44100725F18 /* CryptoDigest.h */; };
                1C09D0561E31C46500725F18 /* CryptoDigestCommonCrypto.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C09D0551E31C46500725F18 /* CryptoDigestCommonCrypto.cpp */; };
                1C09D0581E31C57E00725F18 /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C09D0571E31C57E00725F18 /* config.h */; };
+               1C4876D81F8D7F4E00CCEEBD /* Logging.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C4876D61F8D7F4E00CCEEBD /* Logging.cpp */; };
+               1C4876D91F8D7F4E00CCEEBD /* Logging.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C4876D71F8D7F4E00CCEEBD /* Logging.h */; };
+               1C4876E01F8D837500CCEEBD /* LoggingCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1C4876DF1F8D837500CCEEBD /* LoggingCocoa.mm */; };
                A10265871F56746100B4C844 /* FoundationSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A10265861F56746100B4C844 /* FoundationSPI.h */; };
                A10265891F56747A00B4C844 /* HIToolboxSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A10265881F56747A00B4C844 /* HIToolboxSPI.h */; };
                A102658B1F56748C00B4C844 /* QuickDrawSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A102658A1F56748C00B4C844 /* QuickDrawSPI.h */; };
                A10265871F56746100B4C844 /* FoundationSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A10265861F56746100B4C844 /* FoundationSPI.h */; };
                A10265891F56747A00B4C844 /* HIToolboxSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A10265881F56747A00B4C844 /* HIToolboxSPI.h */; };
                A102658B1F56748C00B4C844 /* QuickDrawSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A102658A1F56748C00B4C844 /* QuickDrawSPI.h */; };
                1C09D05D1E31C77A00725F18 /* PAL.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = PAL.xcconfig; sourceTree = "<group>"; };
                1C09D0621E31EC2800725F18 /* DebugRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = DebugRelease.xcconfig; sourceTree = "<group>"; };
                1C09D0631E31EC3100725F18 /* Base.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Base.xcconfig; sourceTree = "<group>"; };
                1C09D05D1E31C77A00725F18 /* PAL.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = PAL.xcconfig; sourceTree = "<group>"; };
                1C09D0621E31EC2800725F18 /* DebugRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = DebugRelease.xcconfig; sourceTree = "<group>"; };
                1C09D0631E31EC3100725F18 /* Base.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Base.xcconfig; sourceTree = "<group>"; };
+               1C4876D61F8D7F4E00CCEEBD /* Logging.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Logging.cpp; sourceTree = "<group>"; };
+               1C4876D71F8D7F4E00CCEEBD /* Logging.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Logging.h; sourceTree = "<group>"; };
+               1C4876DC1F8D7FC600CCEEBD /* LogMacros.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LogMacros.h; sourceTree = "<group>"; };
+               1C4876DD1F8D812B00CCEEBD /* LogInitialization.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LogInitialization.h; sourceTree = "<group>"; };
+               1C4876DF1F8D837500CCEEBD /* LoggingCocoa.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = LoggingCocoa.mm; sourceTree = "<group>"; };
                1C67CEA11E32EDA800F80F2E /* FeatureDefines.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = FeatureDefines.xcconfig; sourceTree = "<group>"; };
                1C67CEA21E32EE2600F80F2E /* Version.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Version.xcconfig; sourceTree = "<group>"; };
                A10265861F56746100B4C844 /* FoundationSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FoundationSPI.h; sourceTree = "<group>"; };
                1C67CEA11E32EDA800F80F2E /* FeatureDefines.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = FeatureDefines.xcconfig; sourceTree = "<group>"; };
                1C67CEA21E32EE2600F80F2E /* Version.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Version.xcconfig; sourceTree = "<group>"; };
                A10265861F56746100B4C844 /* FoundationSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FoundationSPI.h; sourceTree = "<group>"; };
                        children = (
                                0C00CFCC1F68CE2300AAC26D /* avfoundation */,
                                0CF99CA51F73841C007EE793 /* cf */,
                        children = (
                                0C00CFCC1F68CE2300AAC26D /* avfoundation */,
                                0CF99CA51F73841C007EE793 /* cf */,
+                               1C4876DE1F8D831300CCEEBD /* cocoa */,
                                1C09D0511E31C41200725F18 /* crypto */,
                                0C2DA0651F33CA3300DBC317 /* spi */,
                                A3788E9F1F05B7CE00679425 /* system */,
                                1C09D0511E31C41200725F18 /* crypto */,
                                0C2DA0651F33CA3300DBC317 /* spi */,
                                A3788E9F1F05B7CE00679425 /* system */,
                                A39DE74D1F7C443C007BCB00 /* HysteresisActivity.h */,
                                0708AC321F4C874A001F788F /* Logger.h */,
                                07377ADB1F5777D70027F16D /* LoggerHelper.h */,
                                A39DE74D1F7C443C007BCB00 /* HysteresisActivity.h */,
                                0708AC321F4C874A001F788F /* Logger.h */,
                                07377ADB1F5777D70027F16D /* LoggerHelper.h */,
+                               1C4876D61F8D7F4E00CCEEBD /* Logging.cpp */,
+                               1C4876D71F8D7F4E00CCEEBD /* Logging.h */,
+                               1C4876DD1F8D812B00CCEEBD /* LogInitialization.h */,
+                               1C4876DC1F8D7FC600CCEEBD /* LogMacros.h */,
                                A3C66CDA1F462D6A009E6EE9 /* SessionID.cpp */,
                                A3C66CDB1F462D6A009E6EE9 /* SessionID.h */,
                        );
                                A3C66CDA1F462D6A009E6EE9 /* SessionID.cpp */,
                                A3C66CDB1F462D6A009E6EE9 /* SessionID.h */,
                        );
                        path = Configurations;
                        sourceTree = "<group>";
                };
                        path = Configurations;
                        sourceTree = "<group>";
                };
+               1C4876DE1F8D831300CCEEBD /* cocoa */ = {
+                       isa = PBXGroup;
+                       children = (
+                               1C4876DF1F8D837500CCEEBD /* LoggingCocoa.mm */,
+                       );
+                       path = cocoa;
+                       sourceTree = "<group>";
+               };
                A30D411D1F0DD0AC00B71954 /* text */ = {
                        isa = PBXGroup;
                        children = (
                A30D411D1F0DD0AC00B71954 /* text */ = {
                        isa = PBXGroup;
                        children = (
                                0C2DA1471F3BEB4900DBC317 /* LinkPresentationSPI.h in Headers */,
                                0708AC331F4C874B001F788F /* Logger.h in Headers */,
                                07377ADC1F5777D90027F16D /* LoggerHelper.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 */,
                                0C5AF91D1F43A4C7002EAC02 /* MediaPlayerSPI.h in Headers */,
                                0C77858B1F45130F00F4EBB6 /* LookupSPI.h in Headers */,
                                0C2DA1481F3BEB4900DBC317 /* MachVMSPI.h in Headers */,
                                0C5AF91D1F43A4C7002EAC02 /* MediaPlayerSPI.h in Headers */,
                                A1175B581F6B470500C4B9F0 /* DefaultSearchProvider.cpp in Sources */,
                                A30D41221F0DD0EA00B71954 /* KillRing.cpp in Sources */,
                                A30D41251F0DD12D00B71954 /* KillRingMac.mm in Sources */,
                                A1175B581F6B470500C4B9F0 /* DefaultSearchProvider.cpp in Sources */,
                                A30D41221F0DD0EA00B71954 /* KillRing.cpp in Sources */,
                                A30D41251F0DD12D00B71954 /* KillRingMac.mm in Sources */,
+                               1C4876D81F8D7F4E00CCEEBD /* Logging.cpp in Sources */,
+                               1C4876E01F8D837500CCEEBD /* LoggingCocoa.mm in Sources */,
                                0CF99CA41F736375007EE793 /* MediaTimeAVFoundation.cpp in Sources */,
                                A1175B4F1F6B337300C4B9F0 /* PopupMenu.mm in Sources */,
                                A3C66CDC1F462D6A009E6EE9 /* SessionID.cpp in Sources */,
                                0CF99CA41F736375007EE793 /* MediaTimeAVFoundation.cpp in Sources */,
                                A1175B4F1F6B337300C4B9F0 /* PopupMenu.mm in Sources */,
                                A3C66CDC1F462D6A009E6EE9 /* SessionID.cpp in Sources */,
index 415d03d..a69db1c 100644 (file)
@@ -1,4 +1,5 @@
 set(PAL_SOURCES
 set(PAL_SOURCES
+    Logging.cpp
     SessionID.cpp
 
     system/SleepDisabler.cpp
     SessionID.cpp
 
     system/SleepDisabler.cpp
diff --git a/Source/WebCore/PAL/pal/LogInitialization.h b/Source/WebCore/PAL/pal/LogInitialization.h
new file mode 100644 (file)
index 0000000..57fdd68
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2003, 2006, 2013, 2015, 2016, 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/Forward.h>
+#include <wtf/Optional.h>
+#include <wtf/text/WTFString.h>
+
+namespace PAL {
+
+#if !LOG_DISABLED || !RELEASE_LOG_DISABLED
+
+String logLevelString();
+bool isLogChannelEnabled(const String& name);
+PAL_EXPORT void setLogChannelToAccumulate(const String& name);
+PAL_EXPORT void initializeLogChannelsIfNecessary(std::optional<String> = std::nullopt);
+
+#endif // !LOG_DISABLED || !RELEASE_LOG_DISABLED
+
+} // namespace WebCore
similarity index 96%
rename from Source/WebCore/platform/LogMacros.h
rename to Source/WebCore/PAL/pal/LogMacros.h
index aa4e374..418134a 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (C) 2015, 2016 Apple Inc.  All rights reserved.
+ * Copyright (C) 2015, 2016, 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
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -38,3 +38,4 @@
     } while (0)
 
 #endif // !LOG_DISABLED
     } while (0)
 
 #endif // !LOG_DISABLED
+
diff --git a/Source/WebCore/PAL/pal/Logging.cpp b/Source/WebCore/PAL/pal/Logging.cpp
new file mode 100644 (file)
index 0000000..af817ad
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * Copyright (C) 2003, 2006, 2013, 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.
+ */
+
+#include "config.h"
+#include "Logging.h"
+
+#include "LogInitialization.h"
+
+#include <wtf/StdLibExtras.h>
+#include <wtf/text/CString.h>
+#include <wtf/text/WTFString.h>
+
+#if PLATFORM(COCOA)
+#include <notify.h>
+#include <wtf/BlockPtr.h>
+#endif
+
+namespace PAL {
+
+#if !LOG_DISABLED || !RELEASE_LOG_DISABLED
+
+#define DEFINE_PAL_LOG_CHANNEL(name) DEFINE_LOG_CHANNEL(name, LOG_CHANNEL_WEBKIT_SUBSYSTEM)
+PAL_LOG_CHANNELS(DEFINE_PAL_LOG_CHANNEL)
+
+static WTFLogChannel* logChannels[] = {
+    PAL_LOG_CHANNELS(LOG_CHANNEL_ADDRESS)
+};
+
+static const size_t logChannelCount = WTF_ARRAY_LENGTH(logChannels);
+
+bool isLogChannelEnabled(const String& name)
+{
+    WTFLogChannel* channel = WTFLogChannelByName(logChannels, logChannelCount, name.utf8().data());
+    if (!channel)
+        return false;
+    return channel->state != WTFLogChannelOff;
+}
+
+static bool logChannelsNeedInitialization = true;
+
+void setLogChannelToAccumulate(const String& name)
+{
+    WTFLogChannel* channel = WTFLogChannelByName(logChannels, logChannelCount, name.utf8().data());
+    if (!channel)
+        return;
+
+    channel->state = WTFLogChannelOnWithAccumulation;
+    logChannelsNeedInitialization = true;
+}
+
+void initializeLogChannelsIfNecessary(std::optional<String> logChannelString)
+{
+    if (!logChannelsNeedInitialization && !logChannelString)
+        return;
+
+    logChannelsNeedInitialization = false;
+
+    String enabledChannelsString = logChannelString ? logChannelString.value() : logLevelString();
+    WTFInitializeLogChannelStatesFromString(logChannels, logChannelCount, enabledChannelsString.utf8().data());
+}
+
+#ifndef NDEBUG
+void registerNotifyCallback(const String& notifyID, WTF::Function<void()>&& callback)
+{
+#if PLATFORM(COCOA)
+    int token;
+    notify_register_dispatch(notifyID.utf8().data(), &token, dispatch_get_main_queue(), BlockPtr<void(int)>::fromCallable([callback = WTFMove(callback)](int) {
+        callback();
+    }).get());
+#else
+    UNUSED_PARAM(notifyID);
+    UNUSED_PARAM(callback);
+#endif
+}
+#endif
+
+#endif // !LOG_DISABLED || !RELEASE_LOG_DISABLED
+
+} // namespace WebCore
+
diff --git a/Source/WebCore/PAL/pal/Logging.h b/Source/WebCore/PAL/pal/Logging.h
new file mode 100644 (file)
index 0000000..a1cddd8
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2003-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 "LogMacros.h"
+#include <wtf/Assertions.h>
+#include <wtf/Forward.h>
+
+namespace PAL {
+
+#if !LOG_DISABLED || !RELEASE_LOG_DISABLED
+
+#ifndef LOG_CHANNEL_PREFIX
+#define LOG_CHANNEL_PREFIX PALLog
+#endif
+
+#define PAL_LOG_CHANNELS(M) \
+    M(Network) \
+
+PAL_LOG_CHANNELS(DECLARE_LOG_CHANNEL)
+
+String logLevelString();
+bool isLogChannelEnabled(const String& name);
+PAL_EXPORT void setLogChannelToAccumulate(const String& name);
+#ifndef NDEBUG
+void registerNotifyCallback(const String& notifyID, WTF::Function<void()>&& callback);
+#endif
+
+#endif // !LOG_DISABLED || !RELEASE_LOG_DISABLED
+
+} // namespace PAL
+
index 6ddaf07..6d34a0a 100644 (file)
@@ -3,6 +3,8 @@ list(APPEND PAL_SOURCES
 
     cf/CoreMediaSoftLink.cpp
 
 
     cf/CoreMediaSoftLink.cpp
 
+    cocoa/LoggingCocoa.mm
+
     crypto/commoncrypto/CryptoDigestCommonCrypto.cpp
 
     system/cocoa/SleepDisablerCocoa.cpp
     crypto/commoncrypto/CryptoDigestCommonCrypto.cpp
 
     system/cocoa/SleepDisablerCocoa.cpp
diff --git a/Source/WebCore/PAL/pal/cocoa/LoggingCocoa.mm b/Source/WebCore/PAL/pal/cocoa/LoggingCocoa.mm
new file mode 100644 (file)
index 0000000..62e39d1
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2003, 2006, 2013 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.
+ */
+
+#include "config.h"
+#include "Logging.h"
+
+#include <wtf/text/WTFString.h>
+
+#if !LOG_DISABLED || !RELEASE_LOG_DISABLED
+
+namespace PAL {
+
+static NSString * const defaultsDomain = @"PALLogging";
+
+String logLevelString()
+{
+    return [[NSUserDefaults standardUserDefaults] stringForKey:defaultsDomain];
+}
+
+}
+
+#endif // !LOG_DISABLED || !RELEASE_LOG_DISABLED
+
index 524ed16..8c42aa6 100644 (file)
                0FDA7C261883333200C954B5 /* JSWebKitPlaybackTargetAvailabilityEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FDA7C241883333200C954B5 /* JSWebKitPlaybackTargetAvailabilityEvent.cpp */; };
                0FDA7C271883333200C954B5 /* JSWebKitPlaybackTargetAvailabilityEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FDA7C251883333200C954B5 /* JSWebKitPlaybackTargetAvailabilityEvent.h */; };
                0FDCD7F31D47E655009F08BC /* LogInitialization.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FDCD7F21D47E655009F08BC /* LogInitialization.h */; settings = {ATTRIBUTES = (Private, ); }; };
                0FDA7C261883333200C954B5 /* JSWebKitPlaybackTargetAvailabilityEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FDA7C241883333200C954B5 /* JSWebKitPlaybackTargetAvailabilityEvent.cpp */; };
                0FDA7C271883333200C954B5 /* JSWebKitPlaybackTargetAvailabilityEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FDA7C251883333200C954B5 /* JSWebKitPlaybackTargetAvailabilityEvent.h */; };
                0FDCD7F31D47E655009F08BC /* LogInitialization.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FDCD7F21D47E655009F08BC /* LogInitialization.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               0FDCD7F51D47E725009F08BC /* LogMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FDCD7F41D47E725009F08BC /* LogMacros.h */; settings = {ATTRIBUTES = (Private, ); }; };
                0FDF45A71BD1C6FD00E4FA8C /* PlatformCAAnimation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FDF45A61BD1C6FD00E4FA8C /* PlatformCAAnimation.cpp */; };
                0FDF45A91BD1C82500E4FA8C /* TimingFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FDF45A81BD1C82500E4FA8C /* TimingFunction.cpp */; };
                0FE5806319327A6200DE32EB /* ScrollingTreeMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FE5806119327A6200DE32EB /* ScrollingTreeMac.cpp */; };
                0FDF45A71BD1C6FD00E4FA8C /* PlatformCAAnimation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FDF45A61BD1C6FD00E4FA8C /* PlatformCAAnimation.cpp */; };
                0FDF45A91BD1C82500E4FA8C /* TimingFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FDF45A81BD1C82500E4FA8C /* TimingFunction.cpp */; };
                0FE5806319327A6200DE32EB /* ScrollingTreeMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FE5806119327A6200DE32EB /* ScrollingTreeMac.cpp */; };
                0FDA7C241883333200C954B5 /* JSWebKitPlaybackTargetAvailabilityEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitPlaybackTargetAvailabilityEvent.cpp; sourceTree = "<group>"; };
                0FDA7C251883333200C954B5 /* JSWebKitPlaybackTargetAvailabilityEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebKitPlaybackTargetAvailabilityEvent.h; sourceTree = "<group>"; };
                0FDCD7F21D47E655009F08BC /* LogInitialization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LogInitialization.h; sourceTree = "<group>"; };
                0FDA7C241883333200C954B5 /* JSWebKitPlaybackTargetAvailabilityEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebKitPlaybackTargetAvailabilityEvent.cpp; sourceTree = "<group>"; };
                0FDA7C251883333200C954B5 /* JSWebKitPlaybackTargetAvailabilityEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebKitPlaybackTargetAvailabilityEvent.h; sourceTree = "<group>"; };
                0FDCD7F21D47E655009F08BC /* LogInitialization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LogInitialization.h; sourceTree = "<group>"; };
-               0FDCD7F41D47E725009F08BC /* LogMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LogMacros.h; sourceTree = "<group>"; };
                0FDF45A61BD1C6FD00E4FA8C /* PlatformCAAnimation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformCAAnimation.cpp; sourceTree = "<group>"; };
                0FDF45A81BD1C82500E4FA8C /* TimingFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TimingFunction.cpp; sourceTree = "<group>"; };
                0FE5806119327A6200DE32EB /* ScrollingTreeMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollingTreeMac.cpp; sourceTree = "<group>"; };
                0FDF45A61BD1C6FD00E4FA8C /* PlatformCAAnimation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformCAAnimation.cpp; sourceTree = "<group>"; };
                0FDF45A81BD1C82500E4FA8C /* TimingFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TimingFunction.cpp; sourceTree = "<group>"; };
                0FE5806119327A6200DE32EB /* ScrollingTreeMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrollingTreeMac.cpp; sourceTree = "<group>"; };
                                A8239DFE09B3CF8A00B60641 /* Logging.cpp */,
                                A8239DFF09B3CF8A00B60641 /* Logging.h */,
                                0FDCD7F21D47E655009F08BC /* LogInitialization.h */,
                                A8239DFE09B3CF8A00B60641 /* Logging.cpp */,
                                A8239DFF09B3CF8A00B60641 /* Logging.h */,
                                0FDCD7F21D47E655009F08BC /* LogInitialization.h */,
-                               0FDCD7F41D47E725009F08BC /* LogMacros.h */,
                                46EFAF0F1E5FB9E100E7F34B /* LowPowerModeNotifier.cpp */,
                                46EFAF101E5FB9E100E7F34B /* LowPowerModeNotifier.h */,
                                7AE6C9391BE0C60100E19E03 /* MainThreadSharedTimer.cpp */,
                                46EFAF0F1E5FB9E100E7F34B /* LowPowerModeNotifier.cpp */,
                                46EFAF101E5FB9E100E7F34B /* LowPowerModeNotifier.h */,
                                7AE6C9391BE0C60100E19E03 /* MainThreadSharedTimer.cpp */,
                                A8239E0109B3CF8A00B60641 /* Logging.h in Headers */,
                                9BA273F4172206BB0097CE47 /* LogicalSelectionOffsetCaches.h in Headers */,
                                0FDCD7F31D47E655009F08BC /* LogInitialization.h in Headers */,
                                A8239E0109B3CF8A00B60641 /* Logging.h in Headers */,
                                9BA273F4172206BB0097CE47 /* LogicalSelectionOffsetCaches.h in Headers */,
                                0FDCD7F31D47E655009F08BC /* LogInitialization.h in Headers */,
-                               0FDCD7F51D47E725009F08BC /* LogMacros.h in Headers */,
                                93A806171E03B51C008A1F26 /* LongRange.h in Headers */,
                                46EFAF121E5FB9F100E7F34B /* LowPowerModeNotifier.h in Headers */,
                                1A0409DC1A4360B5009E47F3 /* MachSendRight.h in Headers */,
                                93A806171E03B51C008A1F26 /* LongRange.h in Headers */,
                                46EFAF121E5FB9F100E7F34B /* LowPowerModeNotifier.h in Headers */,
                                1A0409DC1A4360B5009E47F3 /* MachSendRight.h in Headers */,
index cfdd6f5..6ac5217 100644 (file)
@@ -35,6 +35,7 @@
 #import "Logging.h"
 #import "MainFrame.h"
 #import "RenderObject.h"
 #import "Logging.h"
 #import "MainFrame.h"
 #import "RenderObject.h"
+#import <pal/Logging.h>
 
 #if PLATFORM(IOS)
 #import "WebCoreThreadInternal.h"
 
 #if PLATFORM(IOS)
 #import "WebCoreThreadInternal.h"
@@ -61,8 +62,8 @@ void Page::platformInitialize()
 #if ENABLE(TREE_DEBUGGING)
     static std::once_flag onceFlag;
     std::call_once(onceFlag, [] {
 #if ENABLE(TREE_DEBUGGING)
     static std::once_flag onceFlag;
     std::call_once(onceFlag, [] {
-        registerNotifyCallback("com.apple.WebKit.showRenderTree", printRenderTreeForLiveDocuments);
-        registerNotifyCallback("com.apple.WebKit.showLayerTree", printLayerTreeForLiveDocuments);
+        PAL::registerNotifyCallback("com.apple.WebKit.showRenderTree", printRenderTreeForLiveDocuments);
+        PAL::registerNotifyCallback("com.apple.WebKit.showLayerTree", printLayerTreeForLiveDocuments);
     });
 #endif
 }
     });
 #endif
 }
index 14a477c..a015960 100644 (file)
@@ -80,21 +80,6 @@ void initializeLogChannelsIfNecessary(std::optional<String> logChannelString)
     WTFInitializeLogChannelStatesFromString(logChannels, logChannelCount, enabledChannelsString.utf8().data());
 }
 
     WTFInitializeLogChannelStatesFromString(logChannels, logChannelCount, enabledChannelsString.utf8().data());
 }
 
-#ifndef NDEBUG
-void registerNotifyCallback(const String& notifyID, WTF::Function<void()>&& callback)
-{
-#if PLATFORM(COCOA)
-    int token;
-    notify_register_dispatch(notifyID.utf8().data(), &token, dispatch_get_main_queue(), BlockPtr<void (int)>::fromCallable([callback = WTFMove(callback)] (int) {
-        callback();
-    }).get());
-#else
-    UNUSED_PARAM(notifyID);
-    UNUSED_PARAM(callback);
-#endif
-}
-#endif
-
 #endif // !LOG_DISABLED || !RELEASE_LOG_DISABLED
 
 } // namespace WebCore
 #endif // !LOG_DISABLED || !RELEASE_LOG_DISABLED
 
 } // namespace WebCore
index 8f0a490..80bd97e 100644 (file)
@@ -25,7 +25,7 @@
 
 #pragma once
 
 
 #pragma once
 
-#include "LogMacros.h"
+#include <pal/LogMacros.h>
 #include <wtf/Assertions.h>
 #include <wtf/Forward.h>
 
 #include <wtf/Assertions.h>
 #include <wtf/Forward.h>
 
@@ -105,9 +105,6 @@ WEBCORE_LOG_CHANNELS(DECLARE_LOG_CHANNEL)
 String logLevelString();
 bool isLogChannelEnabled(const String& name);
 WEBCORE_EXPORT void setLogChannelToAccumulate(const String& name);
 String logLevelString();
 bool isLogChannelEnabled(const String& name);
 WEBCORE_EXPORT void setLogChannelToAccumulate(const String& name);
-#ifndef NDEBUG
-void registerNotifyCallback(const String& notifyID, WTF::Function<void()>&& callback);
-#endif
 
 #endif // !LOG_DISABLED || !RELEASE_LOG_DISABLED
 
 
 #endif // !LOG_DISABLED || !RELEASE_LOG_DISABLED
 
index 0ab0566..1eb4677 100644 (file)
@@ -53,6 +53,7 @@
 #include "SimpleLineLayoutTextFragmentIterator.h"
 #include "Text.h"
 #include "TextPaintStyle.h"
 #include "SimpleLineLayoutTextFragmentIterator.h"
 #include "Text.h"
 #include "TextPaintStyle.h"
+#include <pal/Logging.h>
 
 namespace WebCore {
 namespace SimpleLineLayout {
 
 namespace WebCore {
 namespace SimpleLineLayout {
@@ -254,9 +255,9 @@ AvoidanceReasonFlags canUseForWithReason(const RenderBlockFlow& flow, IncludeRea
 #ifndef NDEBUG
     static std::once_flag onceFlag;
     std::call_once(onceFlag, [] {
 #ifndef NDEBUG
     static std::once_flag onceFlag;
     std::call_once(onceFlag, [] {
-        registerNotifyCallback("com.apple.WebKit.showSimpleLineLayoutCoverage", WTF::Function<void()> { printSimpleLineLayoutCoverage });
-        registerNotifyCallback("com.apple.WebKit.showSimpleLineLayoutReasons", WTF::Function<void()> { printSimpleLineLayoutBlockList });
-        registerNotifyCallback("com.apple.WebKit.toggleSimpleLineLayout", WTF::Function<void()> { toggleSimpleLineLayout });
+        PAL::registerNotifyCallback("com.apple.WebKit.showSimpleLineLayoutCoverage", WTF::Function<void()> { printSimpleLineLayoutCoverage });
+        PAL::registerNotifyCallback("com.apple.WebKit.showSimpleLineLayoutReasons", WTF::Function<void()> { printSimpleLineLayoutBlockList });
+        PAL::registerNotifyCallback("com.apple.WebKit.toggleSimpleLineLayout", WTF::Function<void()> { toggleSimpleLineLayout });
     });
 #endif
     AvoidanceReasonFlags reasons = { };
     });
 #endif
     AvoidanceReasonFlags reasons = { };
index 58ebcd7..870ce98 100644 (file)
@@ -1,3 +1,13 @@
+2017-10-11  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        Allow PAL to log messages
+        https://bugs.webkit.org/show_bug.cgi?id=171523
+
+        Reviewed by Alex Christensen.
+
+        * Platform/Logging.h:
+        * Scripts/generate-forwarding-headers.pl:
+
 2017-10-11  Ryosuke Niwa  <rniwa@webkit.org>
 
         Sanitize URL in pasteboard for other applications and cross origin content
 2017-10-11  Ryosuke Niwa  <rniwa@webkit.org>
 
         Sanitize URL in pasteboard for other applications and cross origin content
index f4a566a..8e90b02 100644 (file)
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef WebKitLogging_h
-#define WebKitLogging_h
+#pragma once
 
 
-#include <WebCore/LogMacros.h>
+#include <pal/LogMacros.h>
 #include <wtf/Assertions.h>
 #include <wtf/text/WTFString.h>
 
 #include <wtf/Assertions.h>
 #include <wtf/text/WTFString.h>
 
@@ -84,4 +83,3 @@ WEBKIT2_LOG_CHANNELS(DECLARE_LOG_CHANNEL)
 
 #endif // !LOG_DISABLED || !RELEASE_LOG_DISABLED
 
 
 #endif // !LOG_DISABLED || !RELEASE_LOG_DISABLED
 
-#endif // Logging_h
index d845bee..3a8484f 100755 (executable)
@@ -37,7 +37,7 @@ use Getopt::Long;
 my $srcRoot = realpath(File::Spec->catfile(dirname(abs_path($0)), "../.."));
 my @platformPrefixes = ("ca", "cf", "cocoa", "Cocoa", "CoordinatedGraphics", "curl", "gtk", "ios", "mac", "soup", "win", "wpe");
 my @frameworks = ("JavaScriptCore", "WebCore", "WebKit");
 my $srcRoot = realpath(File::Spec->catfile(dirname(abs_path($0)), "../.."));
 my @platformPrefixes = ("ca", "cf", "cocoa", "Cocoa", "CoordinatedGraphics", "curl", "gtk", "ios", "mac", "soup", "win", "wpe");
 my @frameworks = ("JavaScriptCore", "WebCore", "WebKit");
-my @skippedPrefixes;
+my @skippedPrefixes = ("PAL");
 my @frameworkHeaders;
 my $framework;
 my %neededHeaders;
 my @frameworkHeaders;
 my $framework;
 my %neededHeaders;