Title: [107409] branches/chromium/1025/Source/WebKit/chromium/src
Revision
107409
Author
cev...@google.com
Date
2012-02-10 10:27:50 -0800 (Fri, 10 Feb 2012)

Log Message

Merge 107174
BUG=108695
Review URL: https://chromiumcodereview.appspot.com/9380014

Modified Paths

Diff

Modified: branches/chromium/1025/Source/WebKit/chromium/src/DatabaseObserver.cpp (107408 => 107409)


--- branches/chromium/1025/Source/WebKit/chromium/src/DatabaseObserver.cpp	2012-02-10 18:22:33 UTC (rev 107408)
+++ branches/chromium/1025/Source/WebKit/chromium/src/DatabaseObserver.cpp	2012-02-10 18:27:50 UTC (rev 107409)
@@ -165,7 +165,10 @@
         WorkerContext* workerContext = static_cast<WorkerContext*>(scriptExecutionContext);
         WorkerLoaderProxy* workerLoaderProxy = &workerContext->thread()->workerLoaderProxy();
         WebWorkerBase* webWorker = static_cast<WebWorkerBase*>(workerLoaderProxy);
-        return allowDatabaseForWorker(webWorker->commonClient(), webWorker->view()->mainFrame(), name, displayName, estimatedSize);
+        WebView* view = webWorker->view();
+        if (!view)
+            return false;
+        return allowDatabaseForWorker(webWorker->commonClient(), view->mainFrame(), name, displayName, estimatedSize);
 #else
         ASSERT_NOT_REACHED();
 #endif

Modified: branches/chromium/1025/Source/WebKit/chromium/src/IDBFactoryBackendProxy.cpp (107408 => 107409)


--- branches/chromium/1025/Source/WebKit/chromium/src/IDBFactoryBackendProxy.cpp	2012-02-10 18:22:33 UTC (rev 107408)
+++ branches/chromium/1025/Source/WebKit/chromium/src/IDBFactoryBackendProxy.cpp	2012-02-10 18:27:50 UTC (rev 107409)
@@ -183,7 +183,12 @@
     }
     WorkerLoaderProxy* workerLoaderProxy = &context->thread()->workerLoaderProxy();
     WebWorkerBase* webWorker = static_cast<WebWorkerBase*>(workerLoaderProxy);
-    WebFrame* webFrame = webWorker->view()->mainFrame();
+    WebView* webView = webWorker->view();
+    if (!webView) {
+        // Frame is closed, worker is terminaring.
+        return;
+    }
+    WebFrame* webFrame = webView->mainFrame();
     m_webIDBFactory->open(name, new WebIDBCallbacksImpl(callbacks), origin, webFrame, dataDir);
 #endif
 }

Modified: branches/chromium/1025/Source/WebKit/chromium/src/WebWorkerClientImpl.cpp (107408 => 107409)


--- branches/chromium/1025/Source/WebKit/chromium/src/WebWorkerClientImpl.cpp	2012-02-10 18:22:33 UTC (rev 107408)
+++ branches/chromium/1025/Source/WebKit/chromium/src/WebWorkerClientImpl.cpp	2012-02-10 18:27:50 UTC (rev 107409)
@@ -187,8 +187,10 @@
     m_proxy->workerContextDestroyed();
 }
 
-bool WebWorkerClientImpl::allowFileSystem() 
+bool WebWorkerClientImpl::allowFileSystem()
 {
+    if (m_proxy->askedToTerminate())
+        return false;
     WebKit::WebViewImpl* webView = m_webFrame->viewImpl();
     if (!webView)
         return false;
@@ -203,6 +205,8 @@
 
 bool WebWorkerClientImpl::allowDatabase(WebFrame*, const WebString& name, const WebString& displayName, unsigned long estimatedSize) 
 {
+    if (m_proxy->askedToTerminate())
+        return false;
     WebKit::WebViewImpl* webView = m_webFrame->viewImpl();
     if (!webView)
         return false;
@@ -210,7 +214,9 @@
 }
  
 WebView* WebWorkerClientImpl::view() const 
-{   
+{
+    if (m_proxy->askedToTerminate())
+        return 0;
     return m_webFrame->view(); 
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to