Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / web / DatabaseClientImpl.cpp
index 73f3dcb..2547352 100644 (file)
 
 #include "core/dom/Document.h"
 #include "core/dom/ExecutionContext.h"
-#include "core/workers/WorkerGlobalScope.h"
 #include "public/web/WebPermissionClient.h"
 #include "web/WebLocalFrameImpl.h"
-#include "web/WorkerPermissionClient.h"
 
 namespace blink {
 
@@ -52,18 +50,12 @@ DatabaseClientImpl::~DatabaseClientImpl()
 bool DatabaseClientImpl::allowDatabase(ExecutionContext* executionContext, const String& name, const String& displayName, unsigned long estimatedSize)
 {
     ASSERT(executionContext->isContextThread());
-    ASSERT(executionContext->isDocument() || executionContext->isWorkerGlobalScope());
-    if (executionContext->isDocument()) {
-        Document* document = toDocument(executionContext);
-        WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(document->frame());
-        if (!webFrame)
-            return false;
-        if (webFrame->permissionClient())
-            return webFrame->permissionClient()->allowDatabase(name, displayName, estimatedSize);
-    } else {
-        WorkerGlobalScope& workerGlobalScope = *toWorkerGlobalScope(executionContext);
-        return WorkerPermissionClient::from(workerGlobalScope)->allowDatabase(name, displayName, estimatedSize);
-    }
+    Document* document = toDocument(executionContext);
+    WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(document->frame());
+    if (!webFrame)
+        return false;
+    if (webFrame->permissionClient())
+        return webFrame->permissionClient()->allowDatabase(name, displayName, estimatedSize);
     return true;
 }