Index: Source/web/IDBFactoryBackendProxy.cpp |
diff --git a/Source/web/IDBFactoryBackendProxy.cpp b/Source/web/IDBFactoryBackendProxy.cpp |
index f0eb7f60a359052023c631ccec0c76a210190af5..79963c345cb99deb919b3539d533967ef59cb2e0 100644 |
--- a/Source/web/IDBFactoryBackendProxy.cpp |
+++ b/Source/web/IDBFactoryBackendProxy.cpp |
@@ -44,6 +44,7 @@ |
#include "WebWorkerBase.h" |
#include "WebWorkerClientImpl.h" |
#include "WorkerAllowMainThreadBridgeBase.h" |
+#include "WorkerPermissionClient.h" |
#include "bindings/v8/WorkerScriptController.h" |
#include "core/dom/CrossThreadTask.h" |
#include "core/dom/DOMError.h" |
@@ -121,6 +122,17 @@ bool IDBFactoryBackendProxy::allowIndexedDB(ExecutionContext* context, const Str |
allowed = !webView->permissionClient() || webView->permissionClient()->allowIndexedDB(webFrame, name, origin); |
} else { |
WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(context); |
+ WorkerPermissionClient* permissionClient = WorkerPermissionClient::from(workerGlobalScope); |
+ if (permissionClient->proxy()) { |
+ allowed = permissionClient->allowIndexedDB(name); |
+ if (!allowed) |
+ callbacks->onError(WebIDBDatabaseError(UnknownError, "The user denied permission to access the database.")); |
+ |
+ return allowed; |
+ } |
+ |
+ // FIXME: Deprecate this bridge code when PermissionClientProxy is |
+ // implemented by the embedder. |
WebWorkerBase* webWorkerBase = static_cast<WebWorkerBase*>(workerGlobalScope->thread()->workerLoaderProxy().toWebWorkerBase()); |
WorkerRunLoop& runLoop = workerGlobalScope->thread()->runLoop(); |