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

Unified Diff: Source/web/WorkerFileSystemClient.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/WorkerFileSystemClient.cpp
diff --git a/Source/web/WorkerFileSystemClient.cpp b/Source/web/WorkerFileSystemClient.cpp
index 0ab0c7de86b685eaa0924600a1886e672027fdec..6154df12193df711612fdb68e94ef937deaccd3e 100644
--- a/Source/web/WorkerFileSystemClient.cpp
+++ b/Source/web/WorkerFileSystemClient.cpp
@@ -33,6 +33,7 @@
#include "WebWorkerBase.h"
#include "WorkerAllowMainThreadBridgeBase.h"
+#include "WorkerPermissionClient.h"
#include "core/dom/ExecutionContext.h"
#include "core/platform/AsyncFileSystemCallbacks.h"
#include "core/workers/WorkerGlobalScope.h"
@@ -88,6 +89,12 @@ WorkerFileSystemClient::~WorkerFileSystemClient()
bool WorkerFileSystemClient::allowFileSystem(ExecutionContext* context)
{
WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(context);
+ WorkerPermissionClient* permissionClient = WorkerPermissionClient::from(workerGlobalScope);
+ if (permissionClient->proxy())
+ return permissionClient->allowFileSystem();
+
+ // FIXME: Deprecate this bridge code when PermissionClientProxy is
+ // implemented by the embedder.
WebCore::WorkerThread* workerThread = workerGlobalScope->thread();
WorkerRunLoop& runLoop = workerThread->runLoop();
WebCore::WorkerLoaderProxy* workerLoaderProxy = &workerThread->workerLoaderProxy();

Powered by Google App Engine
This is Rietveld 408576698