Reviewed by Adam.
[WebKit-https.git] / WebKit / win / WebView.cpp
index d5d20b3e67a8e248fcd2b4425b863fbbe00402b1..50938561137123af39789b0c7360ec6e6cded2c5 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) {