[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9
jorlow at chromium.org
jorlow at chromium.org
Thu Feb 4 21:32:54 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit 01e68fec8ada443b8b8d71040b9fd671c63bcc15
Author: jorlow at chromium.org <jorlow at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sat Jan 30 00:18:49 2010 +0000
2010-01-29 Jeremy Orlow <jorlow at chromium.org>
Reviewed by Dimitri Glazkov.
A first step towards the Indexed Database API
https://bugs.webkit.org/show_bug.cgi?id=34342
Add runtime enable support for Indexed Database API.
* features.gypi:
* public/WebRuntimeFeatures.h:
* src/WebRuntimeFeatures.cpp:
(WebKit::WebRuntimeFeatures::enableIndexedDatabase):
(WebKit::WebRuntimeFeatures::isIndexedDatabaseEnabled):
2010-01-29 Jeremy Orlow <jorlow at chromium.org>
Reviewed by Dimitri Glazkov.
A first step towards the Indexed Database API
https://bugs.webkit.org/show_bug.cgi?id=34342
Flesh out the first part of Indexed Database API.
Currently only compiles with v8 + chromium for now.
Completely non-functional, but it seems best to do
this in chunks.
No tests because nothing works yet.
* Configurations/FeatureDefines.xcconfig:
* WebCore.gypi:
* bindings/scripts/CodeGeneratorV8.pm:
* bindings/v8/DOMObjectsInclude.h:
* bindings/v8/DerivedSourcesAllInOne.cpp:
* bindings/v8/RuntimeEnabledFeatures.cpp:
* bindings/v8/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setIndexedDatabaseEnabled):
(WebCore::RuntimeEnabledFeatures::indexedDatabaseEnabled):
* bindings/v8/V8Index.cpp:
* bindings/v8/V8Index.h:
* bindings/v8/custom/V8DOMWindowCustom.cpp:
(WebCore::V8DOMWindow::IndexedDBEnabled):
* bindings/v8/custom/V8IDBRequestCustom.cpp: Added.
(WebCore::V8IDBRequest::resultAccessorGetter):
* bindings/v8/custom/V8IndexedDatabaseRequestCustom.cpp: Added.
(WebCore::V8IndexedDatabaseRequest::openCallback):
* dom/EventNames.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::indexedDB):
* page/DOMWindow.h:
* page/DOMWindow.idl:
* storage/IDBDatabaseError.h: Added.
(WebCore::IDBDatabaseError::create):
(WebCore::IDBDatabaseError::~IDBDatabaseError):
(WebCore::IDBDatabaseError::code):
(WebCore::IDBDatabaseError::setCode):
(WebCore::IDBDatabaseError::message):
(WebCore::IDBDatabaseError::setMessage):
(WebCore::IDBDatabaseError::IDBDatabaseError):
* storage/IDBDatabaseError.idl: Added.
* storage/IDBDatabaseException.h: Added.
(WebCore::IDBDatabaseException::create):
(WebCore::IDBDatabaseException::~IDBDatabaseException):
(WebCore::IDBDatabaseException::code):
(WebCore::IDBDatabaseException::setCode):
(WebCore::IDBDatabaseException::message):
(WebCore::IDBDatabaseException::setMessage):
(WebCore::IDBDatabaseException::IDBDatabaseException):
* storage/IDBDatabaseException.idl: Added.
* storage/IDBRequest.cpp: Added.
(WebCore::IDBRequest::IDBRequest):
(WebCore::IDBRequest::~IDBRequest):
(WebCore::IDBRequest::abort):
(WebCore::IDBRequest::eventTargetData):
(WebCore::IDBRequest::ensureEventTargetData):
* storage/IDBRequest.h: Added.
(WebCore::IDBRequest::create):
(WebCore::IDBRequest::readyState):
(WebCore::IDBRequest::error):
(WebCore::IDBRequest::result):
(WebCore::IDBRequest::scriptExecutionContext):
(WebCore::IDBRequest::toIDBRequest):
(WebCore::IDBRequest::refEventTarget):
(WebCore::IDBRequest::derefEventTarget):
* storage/IDBRequest.idl: Added.
* storage/IndexedDatabaseRequest.cpp: Added.
(WebCore::IndexedDatabaseRequest::IndexedDatabaseRequest):
(WebCore::IndexedDatabaseRequest::~IndexedDatabaseRequest):
(WebCore::IndexedDatabaseRequest::open):
* storage/IndexedDatabaseRequest.h: Added.
(WebCore::IndexedDatabaseRequest::create):
(WebCore::IndexedDatabaseRequest::request):
* storage/IndexedDatabaseRequest.idl: Added.
2010-01-29 Jeremy Orlow <jorlow at chromium.org>
Reviewed by Dimitri Glazkov.
A first step towards the Indexed Database API
https://bugs.webkit.org/show_bug.cgi?id=34342
Add Indexed Database API
* configure.ac:
2010-01-29 Jeremy Orlow <jorlow at chromium.org>
Reviewed by Dimitri Glazkov.
A first step towards the Indexed Database API
https://bugs.webkit.org/show_bug.cgi?id=34342
Add indexed database API.
* Scripts/build-webkit:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54085 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/ChangeLog b/ChangeLog
index 25066c1..358e597 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2010-01-29 Jeremy Orlow <jorlow at chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ A first step towards the Indexed Database API
+ https://bugs.webkit.org/show_bug.cgi?id=34342
+
+ Add Indexed Database API
+
+ * configure.ac:
+
2010-01-27 Simon Hausmann <simon.hausmann at nokia.com>
Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index a183c56..4231b6e 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,82 @@
+2010-01-29 Jeremy Orlow <jorlow at chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ A first step towards the Indexed Database API
+ https://bugs.webkit.org/show_bug.cgi?id=34342
+
+ Flesh out the first part of Indexed Database API.
+ Currently only compiles with v8 + chromium for now.
+ Completely non-functional, but it seems best to do
+ this in chunks.
+
+ No tests because nothing works yet.
+
+ * Configurations/FeatureDefines.xcconfig:
+ * WebCore.gypi:
+ * bindings/scripts/CodeGeneratorV8.pm:
+ * bindings/v8/DOMObjectsInclude.h:
+ * bindings/v8/DerivedSourcesAllInOne.cpp:
+ * bindings/v8/RuntimeEnabledFeatures.cpp:
+ * bindings/v8/RuntimeEnabledFeatures.h:
+ (WebCore::RuntimeEnabledFeatures::setIndexedDatabaseEnabled):
+ (WebCore::RuntimeEnabledFeatures::indexedDatabaseEnabled):
+ * bindings/v8/V8Index.cpp:
+ * bindings/v8/V8Index.h:
+ * bindings/v8/custom/V8DOMWindowCustom.cpp:
+ (WebCore::V8DOMWindow::IndexedDBEnabled):
+ * bindings/v8/custom/V8IDBRequestCustom.cpp: Added.
+ (WebCore::V8IDBRequest::resultAccessorGetter):
+ * bindings/v8/custom/V8IndexedDatabaseRequestCustom.cpp: Added.
+ (WebCore::V8IndexedDatabaseRequest::openCallback):
+ * dom/EventNames.h:
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::indexedDB):
+ * page/DOMWindow.h:
+ * page/DOMWindow.idl:
+ * storage/IDBDatabaseError.h: Added.
+ (WebCore::IDBDatabaseError::create):
+ (WebCore::IDBDatabaseError::~IDBDatabaseError):
+ (WebCore::IDBDatabaseError::code):
+ (WebCore::IDBDatabaseError::setCode):
+ (WebCore::IDBDatabaseError::message):
+ (WebCore::IDBDatabaseError::setMessage):
+ (WebCore::IDBDatabaseError::IDBDatabaseError):
+ * storage/IDBDatabaseError.idl: Added.
+ * storage/IDBDatabaseException.h: Added.
+ (WebCore::IDBDatabaseException::create):
+ (WebCore::IDBDatabaseException::~IDBDatabaseException):
+ (WebCore::IDBDatabaseException::code):
+ (WebCore::IDBDatabaseException::setCode):
+ (WebCore::IDBDatabaseException::message):
+ (WebCore::IDBDatabaseException::setMessage):
+ (WebCore::IDBDatabaseException::IDBDatabaseException):
+ * storage/IDBDatabaseException.idl: Added.
+ * storage/IDBRequest.cpp: Added.
+ (WebCore::IDBRequest::IDBRequest):
+ (WebCore::IDBRequest::~IDBRequest):
+ (WebCore::IDBRequest::abort):
+ (WebCore::IDBRequest::eventTargetData):
+ (WebCore::IDBRequest::ensureEventTargetData):
+ * storage/IDBRequest.h: Added.
+ (WebCore::IDBRequest::create):
+ (WebCore::IDBRequest::readyState):
+ (WebCore::IDBRequest::error):
+ (WebCore::IDBRequest::result):
+ (WebCore::IDBRequest::scriptExecutionContext):
+ (WebCore::IDBRequest::toIDBRequest):
+ (WebCore::IDBRequest::refEventTarget):
+ (WebCore::IDBRequest::derefEventTarget):
+ * storage/IDBRequest.idl: Added.
+ * storage/IndexedDatabaseRequest.cpp: Added.
+ (WebCore::IndexedDatabaseRequest::IndexedDatabaseRequest):
+ (WebCore::IndexedDatabaseRequest::~IndexedDatabaseRequest):
+ (WebCore::IndexedDatabaseRequest::open):
+ * storage/IndexedDatabaseRequest.h: Added.
+ (WebCore::IndexedDatabaseRequest::create):
+ (WebCore::IndexedDatabaseRequest::request):
+ * storage/IndexedDatabaseRequest.idl: Added.
+
2010-01-29 Brian Weinstein <bweinstein at apple.com>
Reviewed by Adam Roben.
diff --git a/WebCore/Configurations/FeatureDefines.xcconfig b/WebCore/Configurations/FeatureDefines.xcconfig
index 640c61d..e5dac91 100644
--- a/WebCore/Configurations/FeatureDefines.xcconfig
+++ b/WebCore/Configurations/FeatureDefines.xcconfig
@@ -51,6 +51,7 @@ ENABLE_EVENTSOURCE = ENABLE_EVENTSOURCE;
ENABLE_FILTERS = ENABLE_FILTERS;
ENABLE_GEOLOCATION = ENABLE_GEOLOCATION;
ENABLE_ICONDATABASE = ENABLE_ICONDATABASE;
+ENABLE_INDEXED_DATABASE = ENABLE_INDEXED_DATABASE;
ENABLE_JAVASCRIPT_DEBUGGER = ENABLE_JAVASCRIPT_DEBUGGER;
ENABLE_MATHML = ;
ENABLE_NOTIFICATIONS = ;
@@ -71,4 +72,4 @@ ENABLE_XHTMLMP = ;
ENABLE_XPATH = ENABLE_XPATH;
ENABLE_XSLT = ENABLE_XSLT;
-FEATURE_DEFINES = $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_CANVAS) $(ENABLE_3D_RENDERING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CLIENT_BASED_GEOLOCATION) $(ENABLE_DATABASE) $(ENABLE_DATAGRID) $(ENABLE_DATALIST) $(ENABLE_DOM_STORAGE) $(ENABLE_EVENTSOURCE) $(ENABLE_FILTERS) $(ENABLE_GEOLOCATION) $(ENABLE_ICONDATABASE) $(ENABLE_INDEXED_DATABASE) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_MATHML) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFLINE_WEB_APPLICATIONS) $(ENABLE_SHARED_WORKERS) $(ENABLE_SVG) $(ENABLE_SVG_ANIMATION) $(ENABLE_SVG_AS_IMAGE) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_SVG_FOREIGN_OBJECT) $(ENABLE_SVG_USE) $(ENABLE_VIDEO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WML) $(ENABLE_WORKERS) $(ENABLE_XHTMLMP) $(ENABLE_XPATH) $(ENABLE_XSLT);
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 8bfac51..3b757c4 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -211,6 +211,10 @@
'plugins/Plugin.idl',
'plugins/PluginArray.idl',
'storage/Database.idl',
+ 'storage/IDBDatabaseError.idl',
+ 'storage/IDBDatabaseException.idl',
+ 'storage/IDBRequest.idl',
+ 'storage/IndexedDatabaseRequest.idl',
'storage/SQLError.idl',
'storage/SQLResultSet.idl',
'storage/SQLResultSetRowList.idl',
@@ -717,6 +721,8 @@
'bindings/v8/custom/V8HTMLPlugInElementCustom.cpp',
'bindings/v8/custom/V8HTMLSelectElementCustom.cpp',
'bindings/v8/custom/V8HTMLSelectElementCustom.h',
+ 'bindings/v8/custom/V8IDBRequestCustom.cpp',
+ 'bindings/v8/custom/V8IndexedDatabaseRequestCustom.cpp',
'bindings/v8/custom/V8InjectedScriptHostCustom.cpp',
'bindings/v8/custom/V8InspectorFrontendHostCustom.cpp',
'bindings/v8/custom/V8LocationCustom.cpp',
@@ -3180,6 +3186,12 @@
'storage/DatabaseTracker.cpp',
'storage/DatabaseTracker.h',
'storage/DatabaseTrackerClient.h',
+ 'storage/IDBDatabaseError.h',
+ 'storage/IDBDatabaseException.h',
+ 'storage/IDBRequest.cpp',
+ 'storage/IDBRequest.h',
+ 'storage/IndexedDatabaseRequest.cpp',
+ 'storage/IndexedDatabaseRequest.h',
'storage/LocalStorageTask.cpp',
'storage/LocalStorageTask.h',
'storage/LocalStorageThread.cpp',
diff --git a/WebCore/bindings/scripts/CodeGeneratorV8.pm b/WebCore/bindings/scripts/CodeGeneratorV8.pm
index 336b0ab..1da8517 100644
--- a/WebCore/bindings/scripts/CodeGeneratorV8.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorV8.pm
@@ -375,6 +375,7 @@ sub GetInternalFields
return ("abstractWorkerCacheIndex", "cacheIndex") if $name eq "SharedWorker";
return ("abstractWorkerCacheIndex", "workerContextCacheIndex", "cacheIndex") if $name eq "SharedWorkerContext";
return ("cacheIndex") if $name eq "Notification";
+ return ("cacheIndex") if $name eq "IDBRequest";
return ("cacheIndex") if $name eq "SVGElementInstance";
return ("consoleIndex", "historyIndex", "locationbarIndex", "menubarIndex", "navigatorIndex", "personalbarIndex",
"screenIndex", "scrollbarsIndex", "selectionIndex", "statusbarIndex", "toolbarIndex", "locationIndex",
diff --git a/WebCore/bindings/v8/DOMObjectsInclude.h b/WebCore/bindings/v8/DOMObjectsInclude.h
index 3cb8e17..d3d14cd 100644
--- a/WebCore/bindings/v8/DOMObjectsInclude.h
+++ b/WebCore/bindings/v8/DOMObjectsInclude.h
@@ -198,6 +198,13 @@
#include "Geoposition.h"
#include "PositionError.h"
+#if ENABLE(INDEXED_DATABASE)
+#include "IDBDatabaseError.h"
+#include "IDBDatabaseException.h"
+#include "IDBRequest.h"
+#include "IndexedDatabaseRequest.h"
+#endif // DATABASE
+
#if ENABLE(SVG)
#include "SVGAngle.h"
#include "SVGAnimatedPoints.h"
diff --git a/WebCore/bindings/v8/DerivedSourcesAllInOne.cpp b/WebCore/bindings/v8/DerivedSourcesAllInOne.cpp
index 291c616..9658b19 100644
--- a/WebCore/bindings/v8/DerivedSourcesAllInOne.cpp
+++ b/WebCore/bindings/v8/DerivedSourcesAllInOne.cpp
@@ -257,6 +257,13 @@
#include "bindings/V8SQLTransaction.cpp"
#endif
+#if ENABLE(INDEXED_DATABASE)
+#include "bindings/V8IDBDatabaseError.cpp"
+#include "bindings/V8IDBDatabaseException.cpp"
+#include "bindings/V8IDBRequest.cpp"
+#include "bindings/V8IndexedDatabaseRequest.cpp"
+#endif
+
#if ENABLE(WORKERS)
#include "bindings/V8AbstractWorker.cpp"
#include "bindings/V8DedicatedWorkerContext.cpp"
diff --git a/WebCore/bindings/v8/RuntimeEnabledFeatures.cpp b/WebCore/bindings/v8/RuntimeEnabledFeatures.cpp
index 780520b..a480480 100644
--- a/WebCore/bindings/v8/RuntimeEnabledFeatures.cpp
+++ b/WebCore/bindings/v8/RuntimeEnabledFeatures.cpp
@@ -38,5 +38,6 @@ bool RuntimeEnabledFeatures::isSessionStorageEnabled = true;
bool RuntimeEnabledFeatures::isNotificationsEnabled = false;
bool RuntimeEnabledFeatures::isApplicationCacheEnabled = false;
bool RuntimeEnabledFeatures::isGeolocationEnabled = false;
+bool RuntimeEnabledFeatures::isIndexedDatabaseEnabled = false;
} // namespace WebCore
diff --git a/WebCore/bindings/v8/RuntimeEnabledFeatures.h b/WebCore/bindings/v8/RuntimeEnabledFeatures.h
index d030176..4428004 100644
--- a/WebCore/bindings/v8/RuntimeEnabledFeatures.h
+++ b/WebCore/bindings/v8/RuntimeEnabledFeatures.h
@@ -51,6 +51,9 @@ public:
static void setGeolocationEnabled(bool isEnabled) { isGeolocationEnabled = isEnabled; }
static bool geolocationEnabled() { return isGeolocationEnabled; }
+ static void setIndexedDatabaseEnabled(bool isEnabled) { isIndexedDatabaseEnabled = isEnabled; }
+ static bool indexedDatabaseEnabled() { return isIndexedDatabaseEnabled; }
+
private:
// Never instantiate.
RuntimeEnabledFeatures() { }
@@ -60,6 +63,7 @@ private:
static bool isNotificationsEnabled;
static bool isApplicationCacheEnabled;
static bool isGeolocationEnabled;
+ static bool isIndexedDatabaseEnabled;
};
} // namespace WebCore
diff --git a/WebCore/bindings/v8/V8Index.cpp b/WebCore/bindings/v8/V8Index.cpp
index 8ba0ef7..5ee4a0c 100644
--- a/WebCore/bindings/v8/V8Index.cpp
+++ b/WebCore/bindings/v8/V8Index.cpp
@@ -427,6 +427,13 @@
#include "V8SQLTransaction.h"
#endif
+#if ENABLE(INDEXED_DATABASE)
+#include "V8IDBDatabaseError.h"
+#include "V8IDBDatabaseException.h"
+#include "V8IDBRequest.h"
+#include "V8IndexedDatabaseRequest.h"
+#endif
+
#if ENABLE(XPATH)
#include "V8XPathResult.h"
#include "V8XPathException.h"
diff --git a/WebCore/bindings/v8/V8Index.h b/WebCore/bindings/v8/V8Index.h
index d291809..7936794 100644
--- a/WebCore/bindings/v8/V8Index.h
+++ b/WebCore/bindings/v8/V8Index.h
@@ -453,6 +453,16 @@ typedef v8::Persistent<v8::FunctionTemplate> (*FunctionTemplateFactory)();
#define DOM_OBJECT_STORAGE_TYPES(V)
#endif
+#if ENABLE(INDEXED_DATABASE)
+#define DOM_OBJECT_INDEXED_DATABASE_TYPES(V) \
+ V(IDBDATABASEERROR, IDBDatabaseError) \
+ V(IDBDATABASEEXCEPTION, IDBDatabaseException) \
+ V(IDBREQUEST, IDBRequest) \
+ V(INDEXEDDATABASEREQUEST, IndexedDatabaseRequest)
+#else
+#define DOM_OBJECT_INDEXED_DATABASE_TYPES(V)
+#endif
+
#if ENABLE(WORKERS)
#define DOM_OBJECT_WORKERS_TYPES(V) \
V(ERROREVENT, ErrorEvent)
@@ -523,6 +533,7 @@ typedef v8::Persistent<v8::FunctionTemplate> (*FunctionTemplateFactory)();
DOM_OBJECT_TYPES_2(V) \
DOM_OBJECT_DATABASE_TYPES(V) \
DOM_OBJECT_STORAGE_TYPES(V) \
+ DOM_OBJECT_INDEXED_DATABASE_TYPES(V) \
DOM_OBJECT_WORKERS_TYPES(V) \
DOM_OBJECT_3D_CANVAS_TYPES(V) \
DOM_OBJECT_XPATH_TYPES(V) \
diff --git a/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp b/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
index 924da72..2933b4d 100644
--- a/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
@@ -301,6 +301,13 @@ bool V8DOMWindow::OpenDatabaseEnabled()
}
#endif
+#if ENABLE(INDEXED_DATABASE)
+bool V8DOMWindow::IndexedDBEnabled()
+{
+ return RuntimeEnabledFeatures::indexedDatabaseEnabled();
+}
+#endif
+
#if ENABLE(DOM_STORAGE)
bool V8DOMWindow::LocalStorageEnabled()
{
diff --git a/WebCore/bindings/v8/custom/V8IDBRequestCustom.cpp b/WebCore/bindings/v8/custom/V8IDBRequestCustom.cpp
new file mode 100644
index 0000000..5ee9542
--- /dev/null
+++ b/WebCore/bindings/v8/custom/V8IDBRequestCustom.cpp
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "V8IDBRequest.h"
+
+#include "SerializedScriptValue.h"
+#include "V8Proxy.h"
+
+namespace WebCore {
+
+v8::Handle<v8::Value> V8IDBRequest::resultAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ IDBRequest* request = V8IDBRequest::toNative(info.Holder());
+ SerializedScriptValue* result = request->result();
+ if (!result)
+ return v8::Null();
+
+ return result->deserialize();
+}
+
+} // namespace WebCore
diff --git a/WebCore/bindings/v8/custom/V8IndexedDatabaseRequestCustom.cpp b/WebCore/bindings/v8/custom/V8IndexedDatabaseRequestCustom.cpp
new file mode 100644
index 0000000..66220ea
--- /dev/null
+++ b/WebCore/bindings/v8/custom/V8IndexedDatabaseRequestCustom.cpp
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "V8IndexedDatabaseRequest.h"
+
+#include "V8Binding.h"
+#include "V8Proxy.h"
+
+namespace WebCore {
+
+v8::Handle<v8::Value> V8IndexedDatabaseRequest::openCallback(const v8::Arguments& args)
+{
+ IndexedDatabaseRequest* imp = V8IndexedDatabaseRequest::toNative(args.Holder());
+ if (args.Length() < 2)
+ return throwError(V8Proxy::TypeError);
+ V8Parameter<> name = args[0];
+ V8Parameter<> description = args[1];
+ bool modifyDatabase = true;
+ if (args.Length() > 2)
+ modifyDatabase = args[2]->BooleanValue();
+
+ ExceptionCode ec = 0;
+ imp->open(name, description, modifyDatabase, ec);
+ if (ec)
+ return throwError(ec);
+ return v8::Handle<v8::Value>();
+}
+
+} // namespace WebCore
diff --git a/WebCore/dom/EventNames.h b/WebCore/dom/EventNames.h
index 76e70fd..b76776e 100644
--- a/WebCore/dom/EventNames.h
+++ b/WebCore/dom/EventNames.h
@@ -151,6 +151,8 @@ namespace WebCore {
macro(touchend) \
macro(touchcancel) \
\
+ macro(success) \
+ \
// end of DOM_EVENT_NAMES_FOR_EACH
class EventNames : public Noncopyable {
diff --git a/WebCore/page/DOMWindow.cpp b/WebCore/page/DOMWindow.cpp
index 27b00fa..3eb2b8e 100644
--- a/WebCore/page/DOMWindow.cpp
+++ b/WebCore/page/DOMWindow.cpp
@@ -643,6 +643,13 @@ NotificationCenter* DOMWindow::webkitNotifications() const
}
#endif
+#if ENABLE(INDEXED_DATABASE)
+IndexedDatabaseRequest* DOMWindow::indexedDB() const
+{
+ return 0;
+}
+#endif
+
void DOMWindow::postMessage(PassRefPtr<SerializedScriptValue> message, MessagePort* port, const String& targetOrigin, DOMWindow* source, ExceptionCode& ec)
{
MessagePortArray ports;
diff --git a/WebCore/page/DOMWindow.h b/WebCore/page/DOMWindow.h
index bdd1ef5..dc1e68c 100644
--- a/WebCore/page/DOMWindow.h
+++ b/WebCore/page/DOMWindow.h
@@ -52,6 +52,7 @@ namespace WebCore {
class FloatRect;
class Frame;
class History;
+ class IndexedDatabaseRequest;
class InspectorTimelineAgent;
class Location;
class Media;
@@ -216,6 +217,10 @@ namespace WebCore {
NotificationCenter* webkitNotifications() const;
#endif
+#if ENABLE(INDEXED_DATABASE)
+ IndexedDatabaseRequest* indexedDB() const;
+#endif
+
void postMessage(PassRefPtr<SerializedScriptValue> message, const MessagePortArray*, const String& targetOrigin, DOMWindow* source, ExceptionCode&);
// FIXME: remove this when we update the ObjC bindings (bug #28774).
void postMessage(PassRefPtr<SerializedScriptValue> message, MessagePort*, const String& targetOrigin, DOMWindow* source, ExceptionCode&);
diff --git a/WebCore/page/DOMWindow.idl b/WebCore/page/DOMWindow.idl
index dcd090e..f17f594 100644
--- a/WebCore/page/DOMWindow.idl
+++ b/WebCore/page/DOMWindow.idl
@@ -170,6 +170,9 @@ module window {
#if defined(ENABLE_NOTIFICATIONS) && ENABLE_NOTIFICATIONS
readonly attribute [EnabledAtRuntime] NotificationCenter webkitNotifications;
#endif
+#if defined(ENABLE_INDEXED_DATABASE) && ENABLE_INDEXED_DATABASE
+ readonly attribute [EnabledAtRuntime] IndexedDatabaseRequest indexedDB;
+#endif
#if defined(ENABLE_ORIENTATION_EVENTS) && ENABLE_ORIENTATION_EVENTS
// This is the interface orientation in degrees. Some examples are:
diff --git a/WebCore/storage/IDBDatabaseError.h b/WebCore/storage/IDBDatabaseError.h
new file mode 100644
index 0000000..e8fd2dd
--- /dev/null
+++ b/WebCore/storage/IDBDatabaseError.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef IDBDatabaseError_h
+#define IDBDatabaseError_h
+
+#include "PlatformString.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebCore {
+
+class IDBDatabaseError : public RefCounted<IDBDatabaseError> {
+public:
+ static PassRefPtr<IDBDatabaseError> create()
+ {
+ return adoptRef(new IDBDatabaseError());
+ }
+ ~IDBDatabaseError() { }
+
+ unsigned short code() const { return m_code; }
+ void setCode(unsigned short value) { m_code = value; }
+ String message() const { return m_message; }
+ void setMessage(const String& value) { m_message = value; }
+
+private:
+ IDBDatabaseError() { }
+
+ unsigned short m_code;
+ String m_message;
+};
+
+} // namespace WebCore
+
+#endif
+
+#endif // IDBDatabaseError_h
+
diff --git a/WebCore/storage/IDBDatabaseError.idl b/WebCore/storage/IDBDatabaseError.idl
new file mode 100644
index 0000000..6c6019c
--- /dev/null
+++ b/WebCore/storage/IDBDatabaseError.idl
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+module storage {
+
+ interface [
+ Conditional=INDEXED_DATABASE
+ ] IDBDatabaseError {
+ attribute unsigned short code;
+ attribute DOMString message;
+ };
+
+}
diff --git a/WebCore/storage/IDBDatabaseException.h b/WebCore/storage/IDBDatabaseException.h
new file mode 100644
index 0000000..d94a7f9
--- /dev/null
+++ b/WebCore/storage/IDBDatabaseException.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef IDBDatabaseException_h
+#define IDBDatabaseException_h
+
+#include "PlatformString.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebCore {
+
+class IDBDatabaseException : public RefCounted<IDBDatabaseException> {
+public:
+ static PassRefPtr<IDBDatabaseException> create()
+ {
+ return adoptRef(new IDBDatabaseException());
+ }
+ ~IDBDatabaseException() { }
+
+ unsigned short code() const { return m_code; }
+ void setCode(unsigned short value) { m_code = value; }
+ String message() const { return m_message; }
+ void setMessage(const String& value) { m_message = value; }
+
+private:
+ IDBDatabaseException() { }
+
+ unsigned short m_code;
+ String m_message;
+};
+
+} // namespace WebCore
+
+#endif
+
+#endif // IDBDatabaseException_h
+
diff --git a/WebCore/storage/IDBDatabaseException.idl b/WebCore/storage/IDBDatabaseException.idl
new file mode 100644
index 0000000..898e5f9
--- /dev/null
+++ b/WebCore/storage/IDBDatabaseException.idl
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+module storage {
+
+ interface [
+ Conditional=INDEXED_DATABASE
+ ] IDBDatabaseException {
+ const unsigned short UNKNOWN_ERR = 0;
+ const unsigned short NON_TRANSIENT_ERR = 1;
+ const unsigned short NOT_FOUND_ERR = 2;
+ const unsigned short CONSTRAINT_ERR = 3;
+ const unsigned short DATA_ERR = 4;
+ const unsigned short NOT_ALLOWED_ERR = 5;
+ const unsigned short SERIAL_ERR = 11;
+ const unsigned short RECOVERABLE_ERR = 21;
+ const unsigned short TRANSIENT_ERR = 31;
+ const unsigned short TIMEOUT_ERR = 32;
+ const unsigned short DEADLOCK_ERR = 33;
+ attribute unsigned short code;
+ attribute DOMString message;
+ };
+
+}
diff --git a/WebCore/storage/IDBRequest.cpp b/WebCore/storage/IDBRequest.cpp
new file mode 100644
index 0000000..1a20499
--- /dev/null
+++ b/WebCore/storage/IDBRequest.cpp
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "config.h"
+#include "IDBRequest.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "IDBDatabaseError.h"
+#include "SerializedScriptValue.h"
+
+namespace WebCore {
+
+IDBRequest::IDBRequest(ScriptExecutionContext* context)
+ : ActiveDOMObject(context, this)
+{
+}
+
+IDBRequest::~IDBRequest()
+{
+}
+
+void IDBRequest::abort()
+{
+}
+
+EventTargetData* IDBRequest::eventTargetData()
+{
+ return 0;
+}
+
+EventTargetData* IDBRequest::ensureEventTargetData()
+{
+ return 0;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
+
diff --git a/WebCore/storage/IDBRequest.h b/WebCore/storage/IDBRequest.h
new file mode 100644
index 0000000..5f00aa8
--- /dev/null
+++ b/WebCore/storage/IDBRequest.h
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef IDBRequest_h
+#define IDBRequest_h
+
+#include "ActiveDOMObject.h"
+#include "EventTarget.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebCore {
+
+class IDBDatabaseError;
+class SerializedScriptValue;
+
+class IDBRequest : public RefCounted<IDBRequest>, public ActiveDOMObject, public EventTarget {
+public:
+ static PassRefPtr<IDBRequest> create(ScriptExecutionContext* context)
+ {
+ return adoptRef(new IDBRequest(context));
+ }
+ ~IDBRequest();
+
+ void abort();
+ unsigned short readyState() const { return m_readyState; }
+ IDBDatabaseError* error() const { return m_error.get(); }
+ SerializedScriptValue* result() const { return m_result.get(); }
+
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(success);
+ DEFINE_ATTRIBUTE_EVENT_LISTENER(error);
+
+ using RefCounted<IDBRequest>::ref;
+ using RefCounted<IDBRequest>::deref;
+
+ // EventTarget interface
+ virtual ScriptExecutionContext* scriptExecutionContext() const { return ActiveDOMObject::scriptExecutionContext(); }
+ virtual IDBRequest* toIDBRequest() { return this; }
+
+private:
+ explicit IDBRequest(ScriptExecutionContext* context);
+
+ // EventTarget interface
+ virtual void refEventTarget() { ref(); }
+ virtual void derefEventTarget() { deref(); }
+ virtual EventTargetData* eventTargetData();
+ virtual EventTargetData* ensureEventTargetData();
+
+ unsigned short m_readyState;
+ RefPtr<IDBDatabaseError> m_error;
+ RefPtr<SerializedScriptValue> m_result;
+
+ EventTargetData m_eventTargetData;
+};
+
+} // namespace WebCore
+
+#endif
+
+#endif // IDBRequest_h
+
diff --git a/WebCore/storage/IDBRequest.idl b/WebCore/storage/IDBRequest.idl
new file mode 100644
index 0000000..b34184c
--- /dev/null
+++ b/WebCore/storage/IDBRequest.idl
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+module storage {
+
+ interface [
+ Conditional=INDEXED_DATABASE,
+ EventTarget
+ ] IDBRequest {
+ void abort();
+ const unsigned short INITIAL = 0;
+ const unsigned short LOADING = 1;
+ const unsigned short DONE = 2;
+ readonly attribute unsigned short readyState;
+ readonly attribute IDBDatabaseError error;
+ readonly attribute [CustomGetter] any result;
+ attribute EventListener onsuccess;
+ attribute EventListener onerror;
+ };
+
+}
diff --git a/WebCore/storage/IndexedDatabaseRequest.cpp b/WebCore/storage/IndexedDatabaseRequest.cpp
new file mode 100644
index 0000000..827493b
--- /dev/null
+++ b/WebCore/storage/IndexedDatabaseRequest.cpp
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "config.h"
+#include "IndexedDatabaseRequest.h"
+
+#if ENABLE(INDEXED_DATABASE)
+
+#include "ExceptionCode.h"
+#include "IDBRequest.h"
+
+namespace WebCore {
+
+IndexedDatabaseRequest::IndexedDatabaseRequest()
+{
+}
+
+IndexedDatabaseRequest::~IndexedDatabaseRequest()
+{
+}
+
+void IndexedDatabaseRequest::open(const String& name, const String& description, bool modifyDatabase, ExceptionCode& exception)
+{
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(INDEXED_DATABASE)
+
diff --git a/WebCore/storage/IndexedDatabaseRequest.h b/WebCore/storage/IndexedDatabaseRequest.h
new file mode 100644
index 0000000..74aada3
--- /dev/null
+++ b/WebCore/storage/IndexedDatabaseRequest.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef IndexedDatabaseRequest_h
+#define IndexedDatabaseRequest_h
+
+#include "ExceptionCode.h"
+#include "PlatformString.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+
+#if ENABLE(INDEXED_DATABASE)
+
+namespace WebCore {
+
+class IDBRequest;
+
+class IndexedDatabaseRequest : public RefCounted<IndexedDatabaseRequest> {
+public:
+ static PassRefPtr<IndexedDatabaseRequest> create()
+ {
+ return adoptRef(new IndexedDatabaseRequest());
+ }
+ ~IndexedDatabaseRequest();
+
+ IDBRequest* request() const { return m_request.get(); }
+ void open(const String& name, const String& description, bool modifyDatabase, ExceptionCode&);
+
+private:
+ IndexedDatabaseRequest();
+
+ PassRefPtr<IDBRequest> m_request;
+};
+
+} // namespace WebCore
+
+#endif
+
+#endif // IndexedDatabaseRequest_h
+
diff --git a/WebCore/storage/IndexedDatabaseRequest.idl b/WebCore/storage/IndexedDatabaseRequest.idl
new file mode 100644
index 0000000..b1fc7da
--- /dev/null
+++ b/WebCore/storage/IndexedDatabaseRequest.idl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+module storage {
+
+ interface [
+ Conditional=INDEXED_DATABASE
+ ] IndexedDatabaseRequest {
+ readonly attribute IDBRequest request;
+ [Custom] void open(in DOMString name, in DOMString description, in optional boolean modifyDatabase)
+ raises(IDBDatabaseException);
+ };
+
+}
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 01c1381..a27d430 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,18 @@
+2010-01-29 Jeremy Orlow <jorlow at chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ A first step towards the Indexed Database API
+ https://bugs.webkit.org/show_bug.cgi?id=34342
+
+ Add runtime enable support for Indexed Database API.
+
+ * features.gypi:
+ * public/WebRuntimeFeatures.h:
+ * src/WebRuntimeFeatures.cpp:
+ (WebKit::WebRuntimeFeatures::enableIndexedDatabase):
+ (WebKit::WebRuntimeFeatures::isIndexedDatabaseEnabled):
+
2010-01-29 Yury Semikhatsky <yurys at chromium.org>
Reviewed by Pavel Feldman.
diff --git a/WebKit/chromium/features.gypi b/WebKit/chromium/features.gypi
index f6acda4..da2386b 100644
--- a/WebKit/chromium/features.gypi
+++ b/WebKit/chromium/features.gypi
@@ -50,6 +50,7 @@
'ENABLE_JAVASCRIPT_DEBUGGER=0',
'ENABLE_JSC_MULTIPLE_THREADS=0',
'ENABLE_ICONDATABASE=0',
+ 'ENABLE_INDEXED_DATABASE=1',
'ENABLE_NOTIFICATIONS=1',
'ENABLE_OPENTYPE_SANITIZER=1',
'ENABLE_ORIENTATION_EVENTS=0',
diff --git a/WebKit/chromium/public/WebRuntimeFeatures.h b/WebKit/chromium/public/WebRuntimeFeatures.h
index da56b9a..04f88c9 100644
--- a/WebKit/chromium/public/WebRuntimeFeatures.h
+++ b/WebKit/chromium/public/WebRuntimeFeatures.h
@@ -65,6 +65,9 @@ public:
WEBKIT_API static void enableGeolocation(bool);
WEBKIT_API static bool isGeolocationEnabled();
+ WEBKIT_API static void enableIndexedDatabase(bool);
+ WEBKIT_API static bool isIndexedDatabaseEnabled();
+
private:
WebRuntimeFeatures();
};
diff --git a/WebKit/chromium/src/WebRuntimeFeatures.cpp b/WebKit/chromium/src/WebRuntimeFeatures.cpp
index c8eed37..0ef8b9b 100644
--- a/WebKit/chromium/src/WebRuntimeFeatures.cpp
+++ b/WebKit/chromium/src/WebRuntimeFeatures.cpp
@@ -168,4 +168,20 @@ bool WebRuntimeFeatures::isGeolocationEnabled()
#endif
}
+void WebRuntimeFeatures::enableIndexedDatabase(bool enable)
+{
+#if ENABLE(INDEXED_DATABASE)
+ RuntimeEnabledFeatures::setIndexedDatabaseEnabled(enable);
+#endif
+}
+
+bool WebRuntimeFeatures::isIndexedDatabaseEnabled()
+{
+#if ENABLE(INDEXED_DATABASE)
+ return RuntimeEnabledFeatures::indexedDatabaseEnabled();
+#else
+ return false;
+#endif
+}
+
} // namespace WebKit
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 2d2a154..8c6a228 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,14 @@
+2010-01-29 Jeremy Orlow <jorlow at chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ A first step towards the Indexed Database API
+ https://bugs.webkit.org/show_bug.cgi?id=34342
+
+ Add indexed database API.
+
+ * Scripts/build-webkit:
+
2010-01-29 Andras Becsi <abecsi at webkit.org>
Reviewed by Alexey Proskuryakov.
diff --git a/WebKitTools/Scripts/build-webkit b/WebKitTools/Scripts/build-webkit
index fdb1b2c..8171fba 100755
--- a/WebKitTools/Scripts/build-webkit
+++ b/WebKitTools/Scripts/build-webkit
@@ -51,7 +51,7 @@ my $makeArgs;
my $startTime = time();
my ($threeDCanvasSupport, $threeDRenderingSupport, $channelMessagingSupport, $clientBasedGeolocationSupport, $databaseSupport, $datagridSupport, $datalistSupport,
- $domStorageSupport, $eventsourceSupport, $filtersSupport, $geolocationSupport, $iconDatabaseSupport,
+ $domStorageSupport, $eventsourceSupport, $filtersSupport, $geolocationSupport, $iconDatabaseSupport, $indexedDatabaseSupport,
$javaScriptDebuggerSupport, $mathmlSupport, $offlineWebApplicationSupport, $sharedWorkersSupport,
$svgSupport, $svgAnimationSupport, $svgAsImageSupport, $svgDOMObjCBindingsSupport, $svgFontsSupport,
$svgForeignObjectSupport, $svgUseSupport, $videoSupport, $webSocketsSupport, $wmlSupport, $wcssSupport, $xhtmlmpSupport, $workersSupport,
@@ -97,6 +97,9 @@ my @features = (
{ option => "icon-database", desc => "Toggle Icon database support",
define => "ENABLE_ICONDATABASE", default => 1, value => \$iconDatabaseSupport },
+ { option => "indexed-database", desc => "Toggle Indexed Database API support",
+ define => "ENABLE_INDEXED_DATABASE", default => 0, value => \$indexedDatabaseSupport },
+
{ option => "javascript-debugger", desc => "Toggle JavaScript Debugger/Profiler support",
define => "ENABLE_JAVASCRIPT_DEBUGGER", default => 1, value => \$javaScriptDebuggerSupport },
diff --git a/configure.ac b/configure.ac
index 3924294..3ca4743 100644
--- a/configure.ac
+++ b/configure.ac
@@ -331,6 +331,14 @@ AC_ARG_ENABLE(dom_storage,
[],[enable_dom_storage="yes"])
AC_MSG_RESULT([$enable_dom_storage])
+# check whether to enable the indexed database API
+AC_MSG_CHECKING([whether to enable the indexed database API])
+AC_ARG_ENABLE(indexed_database,
+ AC_HELP_STRING([--enable-indexeddb],
+ [enable the indexed database API [default=no]]),
+ [],[enable_indexed_database="no"])
+AC_MSG_RESULT([$enable_indexed_database])
+
# check whether to build with database support
AC_MSG_CHECKING([whether to enable HTML5 client-side database storage support])
AC_ARG_ENABLE(database,
@@ -751,6 +759,7 @@ AM_CONDITIONAL([ENABLE_DATABASE],[test "$enable_database" = "yes"])
AM_CONDITIONAL([ENABLE_DATALIST],[test "$enable_datalist" = "yes"])
AM_CONDITIONAL([ENABLE_EVENTSOURCE],[test "$enable_eventsource" = "yes"])
AM_CONDITIONAL([ENABLE_ICONDATABASE],[test "$enable_icon_database" = "yes"])
+AM_CONDITIONAL([ENABLE_INDEXED_DATABASE],[test "$enable_indexed_database" = "yes"])
AM_CONDITIONAL([ENABLE_XHTMLMP],[test "$enable_xhtmlmp" = "yes"])
AM_CONDITIONAL([ENABLE_XPATH],[test "$enable_xpath" = "yes"])
AM_CONDITIONAL([ENABLE_XSLT],[test "$enable_xslt" = "yes"])
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list