Reviewed by Adam.
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Jul 2007 04:09:11 +0000 (04:09 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Jul 2007 04:09:11 +0000 (04:09 +0000)
        - WebKit part of fix for <rdar://problem/5262230> Crash while loading a popup in addictinggames.com

        Made closeWindowSoon fire on a timer instead of happening synchronously.

        * WebChromeClient.cpp:
        (WebChromeClient::closeWindowSoon): Actually close the window on a timer, not immediately.
        * WebKit.vcproj/WebKit.vcproj:
        * WebView.cpp:
        (WebView::WebView):
        (WebView::closeWindowSoon):
        (WebView::closeWindowTimerFired):
        * WebView.h:

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

WebKit/win/ChangeLog
WebKit/win/WebChromeClient.cpp
WebKit/win/WebKit.vcproj/WebKit.vcproj
WebKit/win/WebView.cpp
WebKit/win/WebView.h

index 4c1302d..a418df8 100644 (file)
@@ -1,3 +1,20 @@
+2007-07-19  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Adam.
+        
+        - WebKit part of fix for <rdar://problem/5262230> Crash while loading a popup in addictinggames.com
+        
+        Made closeWindowSoon fire on a timer instead of happening synchronously.
+
+        * WebChromeClient.cpp:
+        (WebChromeClient::closeWindowSoon): Actually close the window on a timer, not immediately.
+        * WebKit.vcproj/WebKit.vcproj:
+        * WebView.cpp:
+        (WebView::WebView):
+        (WebView::closeWindowSoon):
+        (WebView::closeWindowTimerFired):
+        * WebView.h:
+
 2007-07-18  Timothy Hatcher  <timothy@apple.com>
 
         Reviewed by Adam.
index 3a4520e..e94e623 100644 (file)
@@ -319,7 +319,7 @@ void WebChromeClient::closeWindowSoon()
 
     m_webView->setGroupName(0);
     m_webView->stopLoading(0);
-    m_webView->closeWindow();
+    m_webView->closeWindowSoon();
 }
 
 void WebChromeClient::runJavaScriptAlert(Frame*, const String& message)
index 763bbba..b462102 100644 (file)
@@ -54,7 +54,7 @@
                                WarnAsError="true"
                                Detect64BitPortabilityProblems="true"
                                DebugInformationFormat="3"
-                               DisableSpecificWarnings="4127"
+                               DisableSpecificWarnings="4127;4355"
                                ForcedIncludeFiles="CodeAnalysisConfig.h"
                                EnablePREfast="$(EnablePREfast)"
                        />
                                WarnAsError="true"
                                Detect64BitPortabilityProblems="true"
                                DebugInformationFormat="3"
-                               DisableSpecificWarnings="4127"
+                               DisableSpecificWarnings="4127;4355"
                                ForcedIncludeFiles="CodeAnalysisConfig.h"
                                EnablePREfast="$(EnablePREfast)"
                        />
                                WarnAsError="true"
                                Detect64BitPortabilityProblems="true"
                                DebugInformationFormat="3"
-                               DisableSpecificWarnings="4127"
+                               DisableSpecificWarnings="4127;4355"
                                ForcedIncludeFiles="CodeAnalysisConfig.h"
                                EnablePREfast="$(EnablePREfast)"
                        />
index d5d20b3..5093856 100644 (file)
@@ -138,6 +138,7 @@ WebView::WebView()
 , m_didClose(false)
 , m_inIMEComposition(0)
 , m_toolTipHwnd(0)
+, m_closeWindowTimer(this, &WebView::closeWindowTimerFired)
 {
     KJS::Collector::registerAsMainThread();
 
@@ -543,6 +544,18 @@ void WebView::frameRect(RECT* rect)
     ::GetWindowRect(m_viewWindow, rect);
 }
 
+void WebView::closeWindowSoon()
+{
+    m_closeWindowTimer.startOneShot(0);
+    AddRef();
+}
+
+void WebView::closeWindowTimerFired(WebCore::Timer<WebView>*)
+{
+    closeWindow();
+    Release();
+}
+
 void WebView::closeWindow()
 {
     if (m_hasSpellCheckerDocumentTag) {
index 199089e..ea811b9 100644 (file)
@@ -34,6 +34,7 @@
 #include "WebFrame.h"
 
 #include <WebCore/IntRect.h>
+#include <WebCore/Timer.h>
 #include <wtf/OwnPtr.h>
 
 class WebFrame;
@@ -631,6 +632,7 @@ public:
     void deleteBackingStore();
     void frameRect(RECT* rect);
     void closeWindow();
+    void closeWindowSoon();
     void close();
     bool didClose() const { return m_didClose; }
     void setProhibitsMainFrameScrolling(bool = true);
@@ -673,10 +675,12 @@ protected:
     bool continuousCheckingAllowed();
     void initializeCacheSizesIfNecessary();
     void initializeToolTipWindow();
+    void closeWindowTimerFired(WebCore::Timer<WebView>*);
     void prepareCandidateWindow(WebCore::Frame*, HIMC);
     void updateSelectionForIME();
     bool onIMERequestCharPosition(WebCore::Frame*, IMECHARPOSITION*, LRESULT*);
     bool onIMERequestReconvertString(WebCore::Frame*, RECONVERTSTRING*, LRESULT*);
+
     ULONG m_refCount;
     WebCore::String m_groupName;
     HWND m_hostWindow;
@@ -721,6 +725,8 @@ protected:
     WebCore::String m_toolTip;
 
     static bool s_allowSiteSpecificHacks;
+
+    WebCore::Timer<WebView> m_closeWindowTimer;
 };
 
 #endif