WebCore: Adding support for the optional creation callback that could be
passed to openDatabase().

Reviewed by Adam Barth.

Tests: storage/open-database-creation-callback.html
       storage/open-database-creation-callback-isolated-world.html

https://bugs.webkit.org/show_bug.cgi?id=34726

* Android.jscbindings.mk
* Android.v8bindings.mk
* GNUmakefile.am:
* WebCore.gypi:
* WebCore.pro:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::openDatabase):
* bindings/js/JSDatabaseCallback.cpp: Added.
(WebCore::JSDatabaseCallback::JSDatabaseCallback):
(WebCore::JSDatabaseCallback::~JSDatabaseCallback):
(WebCore::JSDatabaseCallback::handleEvent):
* bindings/js/JSDatabaseCallback.h: Added.
(WebCore::JSDatabaseCallback::create):
* bindings/v8/custom/V8DOMWindowCustom.cpp:
(WebCore::V8DOMWindow::openDatabaseCallback):
* bindings/v8/custom/V8DatabaseCallback.cpp: Added.
(WebCore::V8DatabaseCallback::V8DatabaseCallback):
(WebCore::V8DatabaseCallback::~V8DatabaseCallback):
(WebCore::V8DatabaseCallback::handleEvent):
* bindings/v8/custom/V8DatabaseCallback.h: Added.
(WebCore::V8DatabaseCallback::create):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::openDatabase):
* page/DOMWindow.h:
* page/DOMWindow.idl:
* storage/Database.cpp:
(WebCore::DatabaseCreationCallbackTask::create):
(WebCore::DatabaseCreationCallbackTask::performTask):
(WebCore::DatabaseCreationCallbackTask::DatabaseCreationCallbackTask):
(WebCore::Database::openDatabase):
(WebCore::Database::Database):
(WebCore::Database::performOpenAndVerify):
(WebCore::Database::performCreationCallback):
* storage/Database.h:
(WebCore::Database::isNew):
* storage/DatabaseCallback.h: Added.
(WebCore::DatabaseCallback::~DatabaseCallback):
* workers/WorkerContext.cpp:
(WebCore::WorkerContext::openDatabase):
* workers/WorkerContext.h:

LayoutTests: Adding a test to test the creation callback passed to
openDatabase() and another one to make sure it is executed in the
correct world.

Reviewed by Adam Barth.

Also, fixing fast/frames/sandboxed-iframe-storage.html: calling
openDatabase() without at least 4 parameters should always fail,
because the database name, version, description and estimated size
are not optional according to the spec.

https://bugs.webkit.org/show_bug.cgi?id=34726

* fast/frames/resources/sandboxed-iframe-storage-allowed.html:
* fast/frames/resources/sandboxed-iframe-storage-disallowed.html:
* fast/frames/sandboxed-iframe-storage-expected.txt:
* platform/qt/Skipped:
* storage/open-database-creation-callback-expected.txt: Added.
* storage/open-database-creation-callback.html: Added.
* storage/open-database-creation-callback-isolated-world-expected.txt: Added.
* storage/open-database-creation-callback-isolated-world.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55823 268f45cc-cd09-0410-ab3c-d52691b4dbfc
30 files changed