Part of https://bugs.webkit.org/show_bug.cgi?id=47354 - Add WebCore/WebKit1 style...
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Oct 2010 18:00:18 +0000 (18:00 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Oct 2010 18:00:18 +0000 (18:00 +0000)
including the first channel to be used for SessionState work.

Reviewed by Sam Weinig.

* Platform/Logging.cpp: Added.
(initializeLogChannelsIfNecessary):
* Platform/Logging.h: Added.

* WebKit2.pro:
* WebKit2.xcodeproj/project.pbxproj:
* win/WebKit2.vcproj:

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

WebKit2/ChangeLog
WebKit2/Platform/Logging.cpp [new file with mode: 0644]
WebKit2/Platform/Logging.h [new file with mode: 0644]
WebKit2/WebKit2.pro
WebKit2/WebKit2.xcodeproj/project.pbxproj
WebKit2/win/WebKit2.vcproj

index 7f22726..31879a2 100644 (file)
@@ -1,3 +1,18 @@
+2010-10-07  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Part of https://bugs.webkit.org/show_bug.cgi?id=47354 - Add WebCore/WebKit1 style logging channel mechanism0 to WebKit2, 
+        including the first channel to be used for SessionState work.
+
+        * Platform/Logging.cpp: Added.
+        (initializeLogChannelsIfNecessary):
+        * Platform/Logging.h: Added.
+
+        * WebKit2.pro:
+        * WebKit2.xcodeproj/project.pbxproj:
+        * win/WebKit2.vcproj:
+
 2010-10-07  Sheriff Bot  <webkit.review.bot@gmail.com>
 
         Unreviewed, rolling out r69315.
diff --git a/WebKit2/Platform/Logging.cpp b/WebKit2/Platform/Logging.cpp
new file mode 100644 (file)
index 0000000..032776d
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2010 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. AND ITS CONTRIBUTORS ``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 ITS 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 "Logging.h"
+
+#if !LOG_DISABLED
+
+WTFLogChannel LogSessionState = { 0x00000001, "WebKit2LogLevel", WTFLogChannelOn };
+
+void initializeLogChannelsIfNecessary()
+{
+    static bool haveInitializedLogChannels = false;
+    if (haveInitializedLogChannels)
+        return;
+    haveInitializedLogChannels = true;
+
+    initializeLogChannel(&LogSessionState);
+}
+
+#endif // LOG_DISABLED
diff --git a/WebKit2/Platform/Logging.h b/WebKit2/Platform/Logging.h
new file mode 100644 (file)
index 0000000..13f38e2
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 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. AND ITS CONTRIBUTORS ``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 ITS 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.
+ */
+
+#ifndef Logging_h
+#define Logging_h
+
+#include <wtf/Assertions.h>
+
+#if !LOG_DISABLED
+
+#ifndef LOG_CHANNEL_PREFIX
+#define LOG_CHANNEL_PREFIX Log
+#endif
+
+EXTERN_C_BEGIN
+
+extern WTFLogChannel LogSessionState;
+
+void initializeLogChannelsIfNecessary(void);
+void initializeLogChannel(WTFLogChannel*);
+
+EXTERN_C_END
+
+#endif // LOG_DISABLED
+
+#endif // Logging_h
index 021356d..6d11cad 100644 (file)
@@ -157,6 +157,7 @@ HEADERS += \
     Platform/CoreIPC/DataReference.h \
     Platform/CoreIPC/HandleMessage.h \
     Platform/CoreIPC/MessageID.h \
+    Platform/Logging.h \
     Platform/Module.h \
     Platform/PlatformProcessIdentifier.h \
     Platform/RunLoop.h \
@@ -299,6 +300,7 @@ SOURCES += \
     Platform/CoreIPC/Connection.cpp \
     Platform/CoreIPC/DataReference.cpp \
     Platform/CoreIPC/qt/ConnectionQt.cpp \
+    Platform/Logging.cpp \
     Platform/Module.cpp \
     Platform/RunLoop.cpp \
     Platform/WorkQueue.cpp \
index 192dc28..d23ee4d 100644 (file)
                1AEFD2F711D1807B008219D3 /* ArgumentCoders.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AEFD2F611D1807B008219D3 /* ArgumentCoders.h */; };
                51578B831209ECEF00A37C4A /* WebData.h in Headers */ = {isa = PBXBuildFile; fileRef = 51578B821209ECEF00A37C4A /* WebData.h */; };
                516A4A5D120A2CCD00C05B7F /* WebError.h in Headers */ = {isa = PBXBuildFile; fileRef = 516A4A5B120A2CCD00C05B7F /* WebError.h */; };
+               51A7F2F3125BF820008AEB1D /* Logging.h in Headers */ = {isa = PBXBuildFile; fileRef = 51A7F2F2125BF820008AEB1D /* Logging.h */; };
+               51A7F2F5125BF8D4008AEB1D /* Logging.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51A7F2F4125BF8D4008AEB1D /* Logging.cpp */; };
                6D8A91A611F0EFD100DD01FE /* com.apple.WebProcess.sb in Resources */ = {isa = PBXBuildFile; fileRef = 6D8A91A511F0EFD100DD01FE /* com.apple.WebProcess.sb */; };
                762B748D120BC75C00819339 /* WKPreferencesPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 762B7484120BBA2D00819339 /* WKPreferencesPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
                762B74AF120BC94F00819339 /* WKPreferencesPrivate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 762B749D120BC8EA00819339 /* WKPreferencesPrivate.cpp */; };
                32DBCF5E0370ADEE00C91783 /* WebKit2Prefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKit2Prefix.h; sourceTree = "<group>"; };
                51578B821209ECEF00A37C4A /* WebData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebData.h; sourceTree = "<group>"; };
                516A4A5B120A2CCD00C05B7F /* WebError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebError.h; sourceTree = "<group>"; };
+               51A7F2F2125BF820008AEB1D /* Logging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Logging.h; sourceTree = "<group>"; };
+               51A7F2F4125BF8D4008AEB1D /* Logging.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Logging.cpp; sourceTree = "<group>"; };
                5DAD7294116FF70B00EE5396 /* WebProcess.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = WebProcess.xcconfig; sourceTree = "<group>"; };
                5DAD73F1116FF90C00EE5396 /* BaseTarget.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = BaseTarget.xcconfig; sourceTree = "<group>"; };
                6D8A91A511F0EFD100DD01FE /* com.apple.WebProcess.sb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = com.apple.WebProcess.sb; path = WebProcess/com.apple.WebProcess.sb; sourceTree = "<group>"; };
                        children = (
                                1AB5A1BA10E021D30040F6CF /* CoreIPC */,
                                1A7E814E1152D2240003695B /* mac */,
+                               51A7F2F4125BF8D4008AEB1D /* Logging.cpp */,
+                               51A7F2F2125BF820008AEB1D /* Logging.h */,
                                C0E3AA451209E2BA00A49D01 /* Module.cpp */,
                                C0E3AA441209E2BA00A49D01 /* Module.h */,
                                BC8780FB1161C2B800CC2768 /* PlatformProcessIdentifier.h */,
                                BC3065FA1259344E00E71278 /* CacheModel.h in Headers */,
                                BC3066BF125A442100E71278 /* WebProcessMessages.h in Headers */,
                                BC306824125A6B9400E71278 /* WebProcessCreationParameters.h in Headers */,
+                               51A7F2F3125BF820008AEB1D /* Logging.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                BC3065C412592F8900E71278 /* WebProcessMac.mm in Sources */,
                                BC3066BE125A442100E71278 /* WebProcessMessageReceiver.cpp in Sources */,
                                BC306825125A6B9400E71278 /* WebProcessCreationParameters.cpp in Sources */,
+                               51A7F2F5125BF8D4008AEB1D /* Logging.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index 63fe5e5..67acd7a 100755 (executable)
                        Name="Platform"\r
                        >\r
                        <File\r
+                               RelativePath="..\Platform\Logging.cpp"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\Platform\Logging.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
                                RelativePath="..\Platform\Module.cpp"\r
                                >\r
                        </File>\r