Grant workers experimental access to IndexedDB.
authordgrogan@chromium.org <dgrogan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 3 Dec 2011 02:20:10 +0000 (02:20 +0000)
committerdgrogan@chromium.org <dgrogan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 3 Dec 2011 02:20:10 +0000 (02:20 +0000)
commit875f173959785b0f48d368757c596ed09942b60b
tree4c2fd3af00f699c034d5e526a3e2a23e6cb78164
parent2fcb4714e8a628cc7e82a8c0762a3b44a23a37a7
Grant workers experimental access to IndexedDB.
https://bugs.webkit.org/show_bug.cgi?id=73609

Reviewed by Nate Chapin.

Source/WebCore:

No new tests - there will be chromium ui tests that depend on
webkit.org/b/73297.

* storage/IDBFactory.cpp:
(WebCore::IDBFactory::open): Call new function,
IDBFactoryBackendInterface::openFromWorker.
* storage/IDBFactoryBackendImpl.cpp:
(WebCore::IDBFactoryBackendImpl::open):
(WebCore::IDBFactoryBackendImpl::openFromWorker):
(WebCore::IDBFactoryBackendImpl::openInternal):
* storage/IDBFactoryBackendImpl.h:
* storage/IDBFactoryBackendInterface.h:
* workers/WorkerContext.cpp:
(WebCore::WorkerContext::webkitIndexedDB): Stores
IDBFactoryBackendInterface, implemented by IDBFactoryBackendProxy in
chromium, in the WorkerContext.  For the Document case it is stored in
the PageGroup.  Storing it in the WorkerContext causes more memory
churn, but that should be trivial.  I don't know of any better
alternatives.
* workers/WorkerContext.h:
* workers/WorkerContext.idl:

Source/WebKit/chromium:

* src/IDBFactoryBackendProxy.cpp:
(WebKit::IDBFactoryBackendProxy::allowIDBFromWorkerThread): Return
true while behind a runtime flag, and while we figure out how to check
permission in a thread-safe manner.
(WebKit::IDBFactoryBackendProxy::openFromWorker): Using the webFrame
from the worker seems to satisfy the weak condition in chromium that
neither it nor it's associated RenderView is NULL.
* src/IDBFactoryBackendProxy.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@101890 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/page/DOMWindow.idl
Source/WebCore/storage/IDBFactory.cpp
Source/WebCore/storage/IDBFactoryBackendImpl.cpp
Source/WebCore/storage/IDBFactoryBackendImpl.h
Source/WebCore/storage/IDBFactoryBackendInterface.h
Source/WebCore/workers/WorkerContext.cpp
Source/WebCore/workers/WorkerContext.h
Source/WebCore/workers/WorkerContext.idl
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/IDBFactoryBackendProxy.cpp
Source/WebKit/chromium/src/IDBFactoryBackendProxy.h
Source/WebKit/chromium/src/WebIDBFactoryImpl.cpp