Put FOR_EACH_COCLASS macro into its own file and export it
authoraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Oct 2007 05:22:03 +0000 (05:22 +0000)
committeraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 25 Oct 2007 05:22:03 +0000 (05:22 +0000)
         The macro used to be called FOR_EACH_CLASS and lived in WebKitDLL.cpp.
         This way we will be able to use the macro in more places that care
         about all WebKit's COM classes.

         Reviewed by Ada.

         * ForEachCoClass.h: Added.
         * WebKit.vcproj/WebKit.vcproj: Copy ForEachCoClass.h to
         WebKitOutputDir, and added it to the project.
         * WebKitDLL.cpp: Updated for macro rename, and changed to #undef the
         macros we pass to FOR_EACH_COCLASS after we're done with them.

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

WebKit/win/ChangeLog
WebKit/win/ForEachCoClass.h [new file with mode: 0644]
WebKit/win/WebKit.vcproj/WebKit.vcproj
WebKit/win/WebKitDLL.cpp

index f2a6d2253702c5cb825132e3a6899282dc7ca50f..e53bf456be2d6bbdbdc9cbad9cf3593117b1fb98 100644 (file)
@@ -1,3 +1,19 @@
+2007-10-24  Adam Roben  <aroben@apple.com>
+
+        Put FOR_EACH_COCLASS macro into its own file and export it
+
+        The macro used to be called FOR_EACH_CLASS and lived in WebKitDLL.cpp.
+        This way we will be able to use the macro in more places that care
+        about all WebKit's COM classes.
+
+        Reviewed by Ada.
+
+        * ForEachCoClass.h: Added.
+        * WebKit.vcproj/WebKit.vcproj: Copy ForEachCoClass.h to
+        WebKitOutputDir, and added it to the project.
+        * WebKitDLL.cpp: Updated for macro rename, and changed to #undef the
+        macros we pass to FOR_EACH_COCLASS after we're done with them.
+
 2007-10-24  Ada Chan  <adachan@apple.com>
 
         <rdar://problem/5552221> REGRESSION(310A24-ToT): Shortcut key disable. (15604)
diff --git a/WebKit/win/ForEachCoClass.h b/WebKit/win/ForEachCoClass.h
new file mode 100644 (file)
index 0000000..39f50fc
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2007 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.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE 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 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 ForEachCoClass_h
+#define ForEachCoClass_h
+
+#define FOR_EACH_COCLASS(macro) \
+    macro(CFDictionaryPropertyBag) \
+    macro(WebCache) \
+    macro(WebDebugProgram) \
+    macro(WebDownload) \
+    macro(WebError) \
+    macro(WebHistory) \
+    macro(WebHistoryItem) \
+    macro(WebIconDatabase) \
+    macro(WebJavaScriptCollector) \
+    macro(WebKitStatistics) \
+    macro(WebMutableURLRequest) \
+    macro(WebNotificationCenter) \
+    macro(WebPreferences) \
+    macro(WebScrollBar) \
+    macro(WebURLCredential) \
+    macro(WebURLProtectionSpace) \
+    macro(WebURLRequest) \
+    macro(WebURLResponse) \
+    macro(WebView) \
+    // end of macro
+
+#endif // !defined(ForEachCoClass_h)
index a8a8279240eb772c2f2f893b3afe46a737172c69..51d98a6c8e4dbbf69cd5582aa5a1268e9331c4d4 100644 (file)
                        />\r
                        <Tool\r
                                Name="VCPostBuildEventTool"\r
-                               CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\WebLocalizableStrings.h&quot; &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\WebKitGraphics.h&quot; &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ProgIDMacros.h&quot; &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\include\WebCore\npfunctions.h&quot; &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\include\JavaScriptCore\npapi.h&quot; &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\include\JavaScriptCore\npruntime.h&quot; &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(OutDir)\WebKit.resources&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\$(ProjectName).resources\*&quot; &quot;$(OutDir)\$(ProjectName).resources&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(OutDir)\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\English.lproj\Localizable.strings&quot; &quot;$(OutDir)\WebKit.resources\en.lproj\&quot;&#x0D;&#x0A;"\r
+                               CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\WebLocalizableStrings.h&quot; &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\WebKitGraphics.h&quot; &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForEachCoClass.h&quot; &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ProgIDMacros.h&quot; &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\include\WebCore\npfunctions.h&quot; &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\include\JavaScriptCore\npapi.h&quot; &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\include\JavaScriptCore\npruntime.h&quot; &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(OutDir)\WebKit.resources&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\$(ProjectName).resources\*&quot; &quot;$(OutDir)\$(ProjectName).resources&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(OutDir)\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\English.lproj\Localizable.strings&quot; &quot;$(OutDir)\WebKit.resources\en.lproj\&quot;&#x0D;&#x0A;"\r
                        />\r
                </Configuration>\r
                <Configuration\r
                        />\r
                        <Tool\r
                                Name="VCPostBuildEventTool"\r
-                               CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\WebLocalizableStrings.h&quot; &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\WebKitGraphics.h&quot; &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ProgIDMacros.h&quot; &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\include\WebCore\npfunctions.h&quot; &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\include\JavaScriptCore\npapi.h&quot; &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\include\JavaScriptCore\npruntime.h&quot; &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(OutDir)\WebKit.resources&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\$(ProjectName).resources\*&quot; &quot;$(OutDir)\$(ProjectName).resources&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(OutDir)\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\English.lproj\Localizable.strings&quot; &quot;$(OutDir)\WebKit.resources\en.lproj\&quot;&#x0D;&#x0A;"\r
+                               CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\WebLocalizableStrings.h&quot; &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\WebKitGraphics.h&quot; &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForEachCoClass.h&quot; &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ProgIDMacros.h&quot; &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\include\WebCore\npfunctions.h&quot; &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\include\JavaScriptCore\npapi.h&quot; &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\include\JavaScriptCore\npruntime.h&quot; &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(OutDir)\WebKit.resources&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\$(ProjectName).resources\*&quot; &quot;$(OutDir)\$(ProjectName).resources&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(OutDir)\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\English.lproj\Localizable.strings&quot; &quot;$(OutDir)\WebKit.resources\en.lproj\&quot;&#x0D;&#x0A;"\r
                        />\r
                </Configuration>\r
                <Configuration\r
                        />\r
                        <Tool\r
                                Name="VCPostBuildEventTool"\r
-                               CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\WebLocalizableStrings.h&quot; &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\WebKitGraphics.h&quot; &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ProgIDMacros.h&quot; &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\include\WebCore\npfunctions.h&quot; &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\include\JavaScriptCore\npapi.h&quot; &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\include\JavaScriptCore\npruntime.h&quot; &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(OutDir)\WebKit.resources&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\$(ProjectName).resources\*&quot; &quot;$(OutDir)\$(ProjectName).resources&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(OutDir)\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\English.lproj\Localizable.strings&quot; &quot;$(OutDir)\WebKit.resources\en.lproj\&quot;&#x0D;&#x0A;"\r
+                               CommandLine="mkdir 2&gt;NUL &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\WebLocalizableStrings.h&quot; &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\WebKitGraphics.h&quot; &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ForEachCoClass.h&quot; &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)\..\ProgIDMacros.h&quot; &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\include\WebCore\npfunctions.h&quot; &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\include\JavaScriptCore\npapi.h&quot; &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(WebKitOutputDir)\include\JavaScriptCore\npruntime.h&quot; &quot;$(WebKitOutputDir)\include\WebKit&quot;&#x0D;&#x0A;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(OutDir)\WebKit.resources&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\$(ProjectName).resources\*&quot; &quot;$(OutDir)\$(ProjectName).resources&quot;&#x0D;&#x0A;mkdir 2&gt;NUL &quot;$(OutDir)\WebKit.resources\en.lproj&quot;&#x0D;&#x0A;xcopy /y /d &quot;$(ProjectDir)..\English.lproj\Localizable.strings&quot; &quot;$(OutDir)\WebKit.resources\en.lproj\&quot;&#x0D;&#x0A;"\r
                        />\r
                </Configuration>\r
        </Configurations>\r
                                RelativePath="..\DOMHTMLClasses.h"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\ForEachCoClass.h"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\HTTPHeaderPropertyBag.h"\r
                                >\r
index 0c06bc72bb38d5864d5091f853ab12158a958e25..712dec8a391eb89af79b85865ef6263583d02aaa 100644 (file)
@@ -26,6 +26,7 @@
 #include "config.h"
 #include "WebKitDLL.h"
 
+#include "ForEachCoClass.h"
 #include "IWebURLResponse.h"
 #include "ProgIDMacros.h"
 #include "WebKit.h"
@@ -46,32 +47,11 @@ ULONG gLockCount;
 ULONG gClassCount;
 HINSTANCE gInstance;
 
-#define FOR_EACH_CLASS(macro) \
-    macro(CFDictionaryPropertyBag) \
-    macro(WebCache) \
-    macro(WebDebugProgram) \
-    macro(WebDownload) \
-    macro(WebError) \
-    macro(WebHistory) \
-    macro(WebHistoryItem) \
-    macro(WebIconDatabase) \
-    macro(WebJavaScriptCollector) \
-    macro(WebKitStatistics) \
-    macro(WebMutableURLRequest) \
-    macro(WebNotificationCenter) \
-    macro(WebPreferences) \
-    macro(WebScrollBar) \
-    macro(WebURLCredential) \
-    macro(WebURLProtectionSpace) \
-    macro(WebURLRequest) \
-    macro(WebURLResponse) \
-    macro(WebView)
-
 #define CLSID_FOR_CLASS(cls) CLSID_##cls,
-
 static CLSID gRegCLSIDs[] = {
-    FOR_EACH_CLASS(CLSID_FOR_CLASS)
+    FOR_EACH_COCLASS(CLSID_FOR_CLASS)
 };
+#undef CLSID_FOR_CLASS
 
 void shutDownWebKit()
 {
@@ -158,8 +138,9 @@ STDAPI DllCanUnloadNow(void)
 
 static const int gSlotsPerEntry = 12;
 static LPCTSTR gRegTable[][3] = {
-    FOR_EACH_CLASS(KEYS_FOR_CLASS)
+    FOR_EACH_COCLASS(KEYS_FOR_CLASS)
 };
+#undef KEYS_FOR_CLASS
 
 static void substituteGUID(LPTSTR str, const UUID* guid)
 {