WebKit/win:
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 10 May 2008 00:26:15 +0000 (00:26 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 10 May 2008 00:26:15 +0000 (00:26 +0000)
        Reviewed by Adam Roben

        Fix a hang-on-quit bug where in the DLL_PROCESS_DETACH DllMain callback, we assummed that
        we could cleanly shutdown WebKit but we couldn't because any background threads have already
        been uncleanly aborted at that point.

        * ForEachCoClass.cpp:
        (shutDownWebKit): Moved from WebKitDLL to here, to be exposed via WebKit.def
        * ForEachCoClass.h:

        * WebKit.vcproj/WebKit.def:
        * WebKit.vcproj/WebKit_debug.def:

        * WebKitDLL.cpp:
        (DllMain): Don't call shutDownWebKit here

WebKitTools:
        Reviewed by Adam Roben

        Explicitly call shutDownWebKit() before quitting.

        * Drosera/win/Drosera.cpp:
        (_tWinMain):

        * DumpRenderTree/win/DumpRenderTree.cpp:
        (main):

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

WebKit/win/ChangeLog
WebKit/win/ForEachCoClass.cpp
WebKit/win/ForEachCoClass.h
WebKit/win/WebKit.vcproj/WebKit.def
WebKit/win/WebKit.vcproj/WebKit_debug.def
WebKit/win/WebKitDLL.cpp
WebKitTools/ChangeLog
WebKitTools/Drosera/win/Drosera.cpp
WebKitTools/DumpRenderTree/win/DumpRenderTree.cpp

index 9b95e9d..206d79a 100644 (file)
@@ -1,3 +1,21 @@
+2008-05-09  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Adam Roben
+
+        Fix a hang-on-quit bug where in the DLL_PROCESS_DETACH DllMain callback, we assummed that
+        we could cleanly shutdown WebKit but we couldn't because any background threads have already
+        been uncleanly aborted at that point.
+        
+        * ForEachCoClass.cpp:
+        (shutDownWebKit): Moved from WebKitDLL to here, to be exposed via WebKit.def
+        * ForEachCoClass.h:
+        
+        * WebKit.vcproj/WebKit.def:
+        * WebKit.vcproj/WebKit_debug.def:
+        
+        * WebKitDLL.cpp:
+        (DllMain): Don't call shutDownWebKit here
+
 2008-05-09  Sam Weinig  <sam@webkit.org>
 
         Rubber-stamped by Mark Rowe.
index edc6a45..6e30d3f 100644 (file)
 #include "ForEachCoClass.h"
 
 #include <JavaScriptCore/Assertions.h>
+#include <WebCore/IconDatabase.h>
+#include <WebCore/PageGroup.h>
 
 void setUseOpenSourceWebKit(bool b)
 {
     s_progIDs = b ? openSourceProgIDs : productionProgIDs;
 }
 
+void shutDownWebKit()
+{
+    WebCore::iconDatabase()->close();
+    WebCore::PageGroup::closeLocalStorage();
+}
+
 LPCOLESTR progIDForClass(WebKitClass cls)
 {
     ASSERT(cls < WebKitClassSentinel);
index 7a73752..830ee21 100644 (file)
@@ -88,6 +88,7 @@ static LPCOLESTR openSourceProgIDs[WebKitClassSentinel] = {
 #define PROGID(className) progIDForClass(className##Class)
 
 void setUseOpenSourceWebKit(bool);
+void shutDownWebKit();
 LPCOLESTR progIDForClass(WebKitClass);
 
 
index 6b446ca..1ad4640 100644 (file)
@@ -89,6 +89,7 @@ EXPORTS
 ;      KJS_JSObject_JSObjectSetSlot
 ;      KJS_JSObject_JSObjectToString
         setUseOpenSourceWebKit
+        shutDownWebKit
         progIDForClass
         WebLocalizedStringUTF8
         WebLocalizedLPCTSTRUTF8
index e7fd4c8..c0b7e33 100644 (file)
@@ -89,6 +89,7 @@ EXPORTS
 ;       KJS_JSObject_JSObjectSetSlot
 ;       KJS_JSObject_JSObjectToString
         setUseOpenSourceWebKit
+        shutDownWebKit
         progIDForClass
         WebLocalizedStringUTF8
         WebLocalizedLPCTSTRUTF8
index d5ae538..94d66e8 100644 (file)
@@ -35,9 +35,7 @@
 #include "WebScriptDebugServer.h"
 #pragma warning( push, 0 )
 #include <WebCore/COMPtr.h>
-#include <WebCore/IconDatabase.h>
 #include <WebCore/Page.h>
-#include <WebCore/PageGroup.h>
 #include <WebCore/SharedBuffer.h>
 #include <WebCore/Widget.h>
 #include <wtf/Vector.h>
@@ -55,12 +53,6 @@ static CLSID gRegCLSIDs[] = {
 };
 #undef CLSID_FOR_CLASS
 
-void shutDownWebKit()
-{
-    WebCore::iconDatabase()->close();
-    WebCore::PageGroup::closeLocalStorage();
-}
-
 STDAPI_(BOOL) DllMain( HMODULE hModule, DWORD  ul_reason_for_call, LPVOID /*lpReserved*/)
 {
     switch (ul_reason_for_call) {
@@ -71,9 +63,6 @@ STDAPI_(BOOL) DllMain( HMODULE hModule, DWORD  ul_reason_for_call, LPVOID /*lpRe
             return TRUE;
 
         case DLL_PROCESS_DETACH:
-            shutDownWebKit();
-            break;
-
         case DLL_THREAD_ATTACH:
         case DLL_THREAD_DETACH:
             break;
index 0b35d25..a72fff8 100644 (file)
@@ -1,3 +1,15 @@
+2008-05-09  Brady Eidson  <beidson@apple.com>
+
+        Reviewed by Adam Roben
+
+        Explicitly call shutDownWebKit() before quitting.
+
+        * Drosera/win/Drosera.cpp:
+        (_tWinMain):
+
+        * DumpRenderTree/win/DumpRenderTree.cpp:
+        (main):
+
 2008-05-09  Mark Rowe  <mrowe@apple.com>
 
         Fix the Tiger build of Drosera.
index 820054f..833347c 100644 (file)
@@ -92,6 +92,8 @@ int APIENTRY _tWinMain(HINSTANCE hInstance,
         }
     }
 
+    shutDownWebKit();
+
     return static_cast<int>(msg.wParam);
 }
 
index f4c66fd..4b19ce6 100644 (file)
@@ -47,6 +47,7 @@
 #include <pthread.h>
 #include <string>
 #include <tchar.h>
+#include <WebKit/ForEachCoClass.h>
 #include <WebKit/WebKit.h>
 #include <fcntl.h>
 #include <io.h>
@@ -1083,5 +1084,7 @@ int main(int argc, char* argv[])
     }
 #endif
 
+    shutDownWebKit();
+
     return 0;
 }