From ad779360af149e78a72064cb21d11e4a7a2d4a8d Mon Sep 17 00:00:00 2001 From: aroben Date: Thu, 25 Oct 2007 05:22:03 +0000 Subject: [PATCH] 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. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@27017 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- WebKit/win/ChangeLog | 16 ++++++++ WebKit/win/ForEachCoClass.h | 54 ++++++++++++++++++++++++++ WebKit/win/WebKit.vcproj/WebKit.vcproj | 10 +++-- WebKit/win/WebKitDLL.cpp | 29 +++----------- 4 files changed, 82 insertions(+), 27 deletions(-) create mode 100644 WebKit/win/ForEachCoClass.h diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog index f2a6d2253702..e53bf456be2d 100644 --- a/WebKit/win/ChangeLog +++ b/WebKit/win/ChangeLog @@ -1,3 +1,19 @@ +2007-10-24 Adam Roben + + 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 REGRESSION(310A24-ToT): Shortcut key disable. (15604) diff --git a/WebKit/win/ForEachCoClass.h b/WebKit/win/ForEachCoClass.h new file mode 100644 index 000000000000..39f50fc34534 --- /dev/null +++ b/WebKit/win/ForEachCoClass.h @@ -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) diff --git a/WebKit/win/WebKit.vcproj/WebKit.vcproj b/WebKit/win/WebKit.vcproj/WebKit.vcproj index a8a8279240eb..51d98a6c8e4d 100644 --- a/WebKit/win/WebKit.vcproj/WebKit.vcproj +++ b/WebKit/win/WebKit.vcproj/WebKit.vcproj @@ -106,7 +106,7 @@ /> @@ -372,6 +372,10 @@ RelativePath="..\DOMHTMLClasses.h" > + + diff --git a/WebKit/win/WebKitDLL.cpp b/WebKit/win/WebKitDLL.cpp index 0c06bc72bb38..712dec8a391e 100644 --- a/WebKit/win/WebKitDLL.cpp +++ b/WebKit/win/WebKitDLL.cpp @@ -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) { -- 2.36.0