Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2609)

Unified Diff: Source/web/IDBFactoryBackendProxy.cpp

Issue 50773002: Introduce WebWorkerPermissionClientProxy to deprecate WorkerAllowMainThreadBridge (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/web/IDBFactoryBackendProxy.cpp
diff --git a/Source/web/IDBFactoryBackendProxy.cpp b/Source/web/IDBFactoryBackendProxy.cpp
index f0eb7f60a359052023c631ccec0c76a210190af5..2138ca8e0cfc52ee91305e2fe46e73cb82a95202 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,12 @@ 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())
+ return permissionClient->allowIndexedDB(name);
+
+ // 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();

Powered by Google App Engine
This is Rietveld 408576698