Index: Source/web/LocalFileSystemClient.cpp |
diff --git a/Source/web/LocalFileSystemClient.cpp b/Source/web/LocalFileSystemClient.cpp |
index 9f933a9369fe80015f6fd48a70265bef894dfdff..a9dc3fd115a9984dae1cf0ab360b4c498acafc43 100644 |
--- a/Source/web/LocalFileSystemClient.cpp |
+++ b/Source/web/LocalFileSystemClient.cpp |
@@ -66,21 +66,33 @@ bool LocalFileSystemClient::allowFileSystem(ExecutionContext* context) |
return WorkerPermissionClient::from(*toWorkerGlobalScope(context))->allowFileSystem(); |
} |
-void LocalFileSystemClient::requestFileSystemAccess(ExecutionContext* context, PassOwnPtr<WebCore::PermissionCallbacks> callbacks) |
+bool LocalFileSystemClient::requestFileSystemAccessSync(ExecutionContext* context) |
{ |
ASSERT(context); |
if (context->isDocument()) { |
- Document* document = toDocument(context); |
- WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(document->frame()); |
- if (!webFrame->permissionClient()) { |
- callbacks->onAllowed(); |
- return; |
- } |
- webFrame->permissionClient()->requestFileSystemAccess(callbacks); |
- return; |
+ ASSERT_NOT_REACHED(); |
+ return false; |
} |
+ |
ASSERT(context->isWorkerGlobalScope()); |
- WorkerPermissionClient::from(*toWorkerGlobalScope(context))->requestFileSystemAccess(callbacks); |
+ return WorkerPermissionClient::from(*toWorkerGlobalScope(context))->requestFileSystemAccessSync(); |
+} |
+ |
+void LocalFileSystemClient::requestFileSystemAccessAsync(ExecutionContext* context, PassOwnPtr<WebCore::PermissionCallbacks> callbacks) |
+{ |
+ ASSERT(context); |
+ if (!context->isDocument()) { |
+ ASSERT_NOT_REACHED(); |
+ return; |
+ } |
+ |
+ Document* document = toDocument(context); |
+ WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(document->frame()); |
+ if (!webFrame->permissionClient()) { |
+ callbacks->onAllowed(); |
+ return; |
+ } |
+ webFrame->permissionClient()->requestFileSystemAccessAsync(callbacks); |
} |
LocalFileSystemClient::LocalFileSystemClient() |