bool IndexedDBClientImpl::allowIndexedDB(ExecutionContext* context, const String& name)
{
    ASSERT_WITH_SECURITY_IMPLICATION(context->isDocument() || context->isWorkerGlobalScope());

    if (context->isDocument()) {
        WebSecurityOrigin origin(context->securityOrigin());
        Document* document = toDocument(context);
        WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(document->frame());
        // FIXME: webFrame->permissionClient() returns 0 in test_shell and content_shell http://crbug.com/137269
        return !webFrame->permissionClient() || webFrame->permissionClient()->allowIndexedDB(name, origin);
    }

    WorkerGlobalScope& workerGlobalScope = *toWorkerGlobalScope(context);
    return WorkerPermissionClient::from(workerGlobalScope)->allowIndexedDB(name);
}
void LocalFileSystemClient::requestFileSystemAccessAsync(ExecutionContext* context, PassOwnPtr<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);
}
bool StorageClientImpl::canAccessStorage(WebCore::LocalFrame* frame, WebCore::StorageType type) const
{
    WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(frame);
    return !webFrame->permissionClient() || webFrame->permissionClient()->allowStorage(type == WebCore::LocalStorage);
}