WebKit Bugzilla
Attachment 341941 Details for
Bug 185893
: Logging macros are sensitive to pal/Logging.h vs Logging.h include order
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185893-20180604175551.patch (text/plain), 12.67 KB, created by
Simon Fraser (smfr)
on 2018-06-04 17:55:51 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Simon Fraser (smfr)
Created:
2018-06-04 17:55:51 PDT
Size:
12.67 KB
patch
obsolete
>Subversion Revision: 232484 >diff --git a/Source/WebCore/PAL/ChangeLog b/Source/WebCore/PAL/ChangeLog >index bab4bc1f51a86c4214604a776fd6b2e6128b7fd5..34fe6c9a428ad0dad35831d92fc7b2d725f9eeb2 100644 >--- a/Source/WebCore/PAL/ChangeLog >+++ b/Source/WebCore/PAL/ChangeLog >@@ -1,3 +1,25 @@ >+2018-06-04 Simon Fraser <simon.fraser@apple.com> >+ >+ Logging macros are sensitive to pal/Logging.h vs Logging.h include order >+ https://bugs.webkit.org/show_bug.cgi?id=185893 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Remove unused functionality from pal/Logging code until we need it. Primarily this removes the >+ #define LOG_CHANNEL_PREFIX from pal/Logging.h, which caused include-order problems with unified sources. >+ >+ Future work should move shared logging code up to WTF (or into PAL). >+ >+ * PAL.xcodeproj/project.pbxproj: >+ * pal/CMakeLists.txt: >+ * pal/LogInitialization.h: Removed. >+ * pal/Logging.cpp: >+ (PAL::isLogChannelEnabled): Deleted. >+ (PAL::setLogChannelToAccumulate): Deleted. >+ (PAL::initializeLogChannelsIfNecessary): Deleted. >+ * pal/Logging.h: >+ * pal/cocoa/LoggingCocoa.mm: Removed. >+ > 2018-06-04 Wenson Hsieh <wenson_hsieh@apple.com> > > [WebKit on watchOS] Remove all uses of the EXTRA_ZOOM_MODE compiler flag >diff --git a/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj b/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj >index 8109bf5ace3b831ef191f4d3dd27f6c5596a4859..e43e1b89e630a212ab863f231cfab97f09a84b89 100644 >--- a/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj >+++ b/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj >@@ -105,7 +105,6 @@ > 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 */; }; > 2D02E93C2056FAA700A13797 /* AudioToolboxSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D02E93B2056FAA700A13797 /* AudioToolboxSPI.h */; }; > 31308B1420A21705003FB929 /* SystemPreviewSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 31308B1320A21705003FB929 /* SystemPreviewSPI.h */; }; > 570AB8F120AE2E8D00B8BE87 /* SecKeyProxySPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 570AB8F020AE2E8D00B8BE87 /* SecKeyProxySPI.h */; }; >@@ -251,8 +250,6 @@ > 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>"; }; > 2D02E93B2056FAA700A13797 /* AudioToolboxSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AudioToolboxSPI.h; sourceTree = "<group>"; }; >@@ -500,7 +497,6 @@ > A39DE74D1F7C443C007BCB00 /* HysteresisActivity.h */, > 1C4876D61F8D7F4E00CCEEBD /* Logging.cpp */, > 1C4876D71F8D7F4E00CCEEBD /* Logging.h */, >- 1C4876DD1F8D812B00CCEEBD /* LogInitialization.h */, > 1C4876DC1F8D7FC600CCEEBD /* LogMacros.h */, > A3C66CDA1F462D6A009E6EE9 /* SessionID.cpp */, > A3C66CDB1F462D6A009E6EE9 /* SessionID.h */, >@@ -542,7 +538,6 @@ > isa = PBXGroup; > children = ( > F44291661FA52705002CC93E /* FileSizeFormatterCocoa.mm */, >- 1C4876DF1F8D837500CCEEBD /* LoggingCocoa.mm */, > ); > path = cocoa; > sourceTree = "<group>"; >@@ -821,7 +816,6 @@ > 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 */, >diff --git a/Source/WebCore/PAL/pal/CMakeLists.txt b/Source/WebCore/PAL/pal/CMakeLists.txt >index aebe481184071f391c1bd5b048f2eec0b8d1bd06..2f6e8f2070359770a8bc6e3ca4af80e789155cfa 100644 >--- a/Source/WebCore/PAL/pal/CMakeLists.txt >+++ b/Source/WebCore/PAL/pal/CMakeLists.txt >@@ -2,7 +2,6 @@ set(PAL_PUBLIC_HEADERS > ExportMacros.h > FileSizeFormatter.h > HysteresisActivity.h >- LogInitialization.h > LogMacros.h > Logging.h > SessionID.h >diff --git a/Source/WebCore/PAL/pal/LogInitialization.h b/Source/WebCore/PAL/pal/LogInitialization.h >deleted file mode 100644 >index 57fdd68e613bce2092ede7913abd8201cc0d385f..0000000000000000000000000000000000000000 >--- a/Source/WebCore/PAL/pal/LogInitialization.h >+++ /dev/null >@@ -1,44 +0,0 @@ >-/* >- * 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 >diff --git a/Source/WebCore/PAL/pal/Logging.cpp b/Source/WebCore/PAL/pal/Logging.cpp >index ac85b6d8271cd7879fae6287707c62ea5e6b9152..e62548d46791f8fa7e11316c743d98f1988f7c2e 100644 >--- a/Source/WebCore/PAL/pal/Logging.cpp >+++ b/Source/WebCore/PAL/pal/Logging.cpp >@@ -26,10 +26,6 @@ > #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) >@@ -39,50 +35,6 @@ > > 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()); >-} >- >-#endif // !LOG_DISABLED || !RELEASE_LOG_DISABLED >- > void registerNotifyCallback(const String& notifyID, WTF::Function<void()>&& callback) > { > #if PLATFORM(COCOA) >@@ -97,4 +49,3 @@ void registerNotifyCallback(const String& notifyID, WTF::Function<void()>&& call > } > > } // namespace WebCore >- >diff --git a/Source/WebCore/PAL/pal/Logging.h b/Source/WebCore/PAL/pal/Logging.h >index 031399c6f72ad8e38678284889b2a5127294e6a9..6caaedb35a051d9d53e2ba3241ca9003a3b01a72 100644 >--- a/Source/WebCore/PAL/pal/Logging.h >+++ b/Source/WebCore/PAL/pal/Logging.h >@@ -25,29 +25,10 @@ > > #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); >- >-#endif // !LOG_DISABLED || !RELEASE_LOG_DISABLED >- > PAL_EXPORT void registerNotifyCallback(const String&, WTF::Function<void()>&&); > > } // namespace PAL >diff --git a/Source/WebCore/PAL/pal/cocoa/LoggingCocoa.mm b/Source/WebCore/PAL/pal/cocoa/LoggingCocoa.mm >deleted file mode 100644 >index 2cdcea222ff736ebd32c3bf5886b0f10c18a4680..0000000000000000000000000000000000000000 >--- a/Source/WebCore/PAL/pal/cocoa/LoggingCocoa.mm >+++ /dev/null >@@ -1,48 +0,0 @@ >-/* >- * 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 { >- >-String logLevelString() >-{ >-#if !LOG_DISABLED >- static NSString * const defaultsDomain = @"PALLogging"; >- return [[NSUserDefaults standardUserDefaults] stringForKey:defaultsDomain]; >-#else >- return String(); >-#endif >-} >- >-} >- >-#endif // !LOG_DISABLED || !RELEASE_LOG_DISABLED >-
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185893
: 341941