Commit d1ae3238 authored by jorlow@chromium.org's avatar jorlow@chromium.org

2010-01-29 Jeremy Orlow <jorlow@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@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@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@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
parent c599001d
2010-01-29 Jeremy Orlow <jorlow@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@nokia.com>
Reviewed by Kenneth Rohde Christiansen.
......
2010-01-29 Jeremy Orlow <jorlow@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@apple.com>
Reviewed by Adam Roben.
......@@ -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);
......@@ -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',
......
......@@ -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",
......
......@@ -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"
......
......@@ -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"
......
......@@ -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
......@@ -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
......
......@@ -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"
......
......@@ -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) \
......
......@@ -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()
{
......
/*
* 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
/*
* 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
......@@ -151,6 +151,8 @@ namespace WebCore {
macro(touchend) \
macro(touchcancel) \
\
macro(success) \
\
// end of DOM_EVENT_NAMES_FOR_EACH
class EventNames : public Noncopyable {
......
......@@ -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;
......
......@@ -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&);
......
......@@ -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:
......
/*
* 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
/*
* 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;
};
}
/*
* 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
/*
* 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;
};
}
/*
* 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.