[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

jorlow at chromium.org jorlow at chromium.org
Wed Dec 22 16:32:31 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 188ec8b9900d23a25a6d861f2ce4531d9f91a6ad
Author: jorlow at chromium.org <jorlow at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Nov 25 14:05:14 2010 +0000

    2010-11-25  Jeremy Orlow  <jorlow at chromium.org>
    
            Reviewed by Steve Block.
    
            Add an OptionsObject class for IndexedDB (and later Geolocation)
            https://bugs.webkit.org/show_bug.cgi?id=50030
    
            * storage/indexeddb/create-object-store-options-expected.txt: Added.
            * storage/indexeddb/create-object-store-options.html: Added.
            * storage/indexeddb/tutorial.html:
    2010-11-25  Jeremy Orlow  <jorlow at chromium.org>
    
            Reviewed by Steve Block.
    
            Add an OptionsObject class for IndexedDB (and later Geolocation)
            https://bugs.webkit.org/show_bug.cgi?id=50030
    
            Geolocation and IndexedDB both have the concept of an optional
            parameter that has various options supplied with it.  In
            Geolocation this was done with custom bindings, but I'm trying to
            avoid that for IndexedDB.
    
            This first patch implements it in V8 and makes createObjectStore use it.
            The next patch will cover Geolocation and JSC.
    
            Test: storage/indexeddb/create-object-store-options.html
    
            * WebCore.gypi:
            * bindings/scripts/CodeGeneratorV8.pm:
            * bindings/scripts/test/CPP/WebDOMTestObj.cpp:
            (WebDOMTestObj::optionsObject):
            * bindings/scripts/test/CPP/WebDOMTestObj.h:
            * bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp:
            * bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp:
            * bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.cpp:
            * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
            (webkit_dom_test_obj_options_object):
            * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
            * bindings/scripts/test/JS/JSTestObj.cpp:
            (WebCore::jsTestObjPrototypeFunctionOptionsObject):
            * bindings/scripts/test/JS/JSTestObj.h:
            * bindings/scripts/test/ObjC/DOMTestObj.h:
            * bindings/scripts/test/ObjC/DOMTestObj.mm:
            (-[DOMTestObj optionsObject:ooo:]):
            * bindings/scripts/test/TestObj.idl:
            * bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp:
            (WebCore::ConfigureV8TestMediaQueryListListenerTemplate):
            * bindings/scripts/test/V8/V8TestObj.cpp:
            (WebCore::TestObjInternal::optionsObjectCallback):
            * bindings/v8/OptionsObject.cpp: Added.
            (WebCore::OptionsObject::OptionsObject):
            (WebCore::OptionsObject::~OptionsObject):
            (WebCore::OptionsObject::operator=):
            (WebCore::OptionsObject::undefinedOrNull):
            (WebCore::OptionsObject::getKeyBool):
            (WebCore::OptionsObject::getKeyString):
            (WebCore::OptionsObject::getKey):
            * bindings/v8/OptionsObject.h:
            * bindings/js/OptionsObject.h:
            * storage/IDBDatabase.cpp:
            (WebCore::IDBDatabase::createObjectStore):
            * storage/IDBDatabase.h:
            (WebCore::IDBDatabase::createObjectStore):
            * storage/IDBDatabase.idl:
    2010-11-25  Jeremy Orlow  <jorlow at chromium.org>
    
            Reviewed by Steve Block.
    
            Add exception code to WebIDBTransaction::objectStore
            https://bugs.webkit.org/show_bug.cgi?id=50030
    
            * public/WebIDBTransaction.h:
            (WebKit::WebIDBTransaction::objectStore):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72728 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index ba72a0d..89bb523 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
+2010-11-25  Jeremy Orlow  <jorlow at chromium.org>
+
+        Reviewed by Steve Block.
+
+        Add an OptionsObject class for IndexedDB (and later Geolocation)
+        https://bugs.webkit.org/show_bug.cgi?id=50030
+
+        * storage/indexeddb/create-object-store-options-expected.txt: Added.
+        * storage/indexeddb/create-object-store-options.html: Added.
+        * storage/indexeddb/tutorial.html:
+
 2010-11-25  Ilya Tikhonovsky  <loislo at chromium.org>
 
         Unreviewed. Upstream chromium test expectations.
diff --git a/LayoutTests/storage/indexeddb/create-object-store-options-expected.txt b/LayoutTests/storage/indexeddb/create-object-store-options-expected.txt
new file mode 100644
index 0000000..aec381f
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/create-object-store-options-expected.txt
@@ -0,0 +1,29 @@
+Test IndexedDB's createObjectStore's various options
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS 'webkitIndexedDB' in window is true
+PASS webkitIndexedDB == null is false
+webkitIndexedDB.open('name', 'description')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+db = event.result
+result = db.setVersion('version 1')
+Deleted all object stores.
+db.createObjectStore('a', {keyPath: 'a'})
+db.createObjectStore('b')
+trans = db.transaction([], webkitIDBTransaction.READ_WRITE)
+trans.objectStore('a').put({'a': 0})
+trans.objectStore('b').put({'a': 0}, 0)
+trans.objectStore('a').get(0)
+PASS event.result.a is {a: 0}
+trans.objectStore('b').get(0)
+PASS event.result.a is {a: 0}
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/storage/indexeddb/create-object-store-options.html b/LayoutTests/storage/indexeddb/create-object-store-options.html
new file mode 100644
index 0000000..b28d2d2
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/create-object-store-options.html
@@ -0,0 +1,90 @@
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+<script src="../../fast/js/resources/js-test-post-function.js"></script>
+<script src="resources/shared.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+
+description("Test IndexedDB's createObjectStore's various options");
+if (window.layoutTestController)
+    layoutTestController.waitUntilDone();
+
+function test()
+{
+    shouldBeTrue("'webkitIndexedDB' in window");
+    shouldBeFalse("webkitIndexedDB == null");
+
+    result = evalAndLog("webkitIndexedDB.open('name', 'description')");
+    verifyResult(result);
+    result.onsuccess = openSuccess;
+    result.onerror = unexpectedErrorCallback;
+}
+
+function openSuccess()
+{
+    db = evalAndLog("db = event.result");
+
+    result = evalAndLog("result = db.setVersion('version 1')");
+    result.onsuccess = cleanDatabase;
+    result.onerror = unexpectedErrorCallback;
+}
+
+function cleanDatabase()
+{
+    deleteAllObjectStores(db, cleaned);
+}
+
+function cleaned()
+{
+    evalAndLog("db.createObjectStore('a', {keyPath: 'a'})");
+    evalAndLog("db.createObjectStore('b')");
+
+    trans = evalAndLog("trans = db.transaction([], webkitIDBTransaction.READ_WRITE)");
+
+    req = evalAndLog("trans.objectStore('a').put({'a': 0})");
+    req.onsuccess = putB;
+    req.onerror = unexpectedErrorCallback;
+}
+
+function putB()
+{
+    req = evalAndLog("trans.objectStore('b').put({'a': 0}, 0)");  // OOPS
+    req.onsuccess = getA;
+    req.onerror = unexpectedErrorCallback;
+}
+
+function getA()
+{
+    req = evalAndLog("trans.objectStore('a').get(0)");
+    req.onsuccess = getB;
+    req.onerror = unexpectedErrorCallback;
+}
+
+function getB()
+{
+    shouldBe("event.result.a", "{a: 0}");
+
+    req = evalAndLog("trans.objectStore('b').get(0)");
+    req.onsuccess = checkB;
+    req.onerror = unexpectedErrorCallback;
+}
+
+function checkB()
+{
+    shouldBe("event.result.a", "{a: 0}");
+
+    done();
+}
+
+var successfullyParsed = true;
+
+test();
+
+</script>
+</body>
+</html>
diff --git a/LayoutTests/storage/indexeddb/tutorial.html b/LayoutTests/storage/indexeddb/tutorial.html
index db9f2fa..3578848 100644
--- a/LayoutTests/storage/indexeddb/tutorial.html
+++ b/LayoutTests/storage/indexeddb/tutorial.html
@@ -150,13 +150,25 @@ function onSetVersion()
     // a number attribute and at least one sibling). You can even go wild and say
     // "foo[0][2].bar[0].baz.test[1][2][3]". It's possible this will change in the future though.
     //
-    // If you set autoIncrement (the third optional parameter), IndexedDB will generate a key
+    // If you set autoIncrement (another optional parameter), IndexedDB will generate a key
     // for your entry automatically. And if you have a keyPath set, it'll set the value at
     // the location of the keyPath _in the database_ (i.e. it will not modify the value you pass
     // in to put/add). Unfortunately autoIncrement is not yet implemented in Chromium/WebKit.
     //
+    // Another optional parameter, "evictable" is not yet implemented. When it is, it'll hint
+    // which data should be deleted first if the browser decides this origin is using too much
+    // storage. (The alternative is that it'll suggest the user delete everything from the
+    // origin, so it's in your favor to set it approperately!) This is great for when you have
+    // some absolutely critical data (like unset emails) and a bunch of less critical, (but
+    // maybe still important!) data.
+    //
+    // All of these options can be passed into createObjectStore via its (optional) second
+    // parameter. So, if you wanted to define all, You'd do {keyPath: "something",
+    // evictable: true, autoIncrement: true}. You can also pass in subsets of all three or
+    // omit the object (since it's optional).
+    //
     // Let's now create an objectStore for people. We'll supply a key path in this case.
-    var objectStore = db.createObjectStore("people", "id");
+    var objectStore = db.createObjectStore("people", {keyPath: "id"});
 
     // Notice that it returned synchronously. The rule of thumb is that any call that touches (in
     // any way) keys or values is asynchronous and any other call (besides setVersion and open) are
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 4c7e92a..8f65bc0 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,58 @@
+2010-11-25  Jeremy Orlow  <jorlow at chromium.org>
+
+        Reviewed by Steve Block.
+
+        Add an OptionsObject class for IndexedDB (and later Geolocation)
+        https://bugs.webkit.org/show_bug.cgi?id=50030
+
+        Geolocation and IndexedDB both have the concept of an optional
+        parameter that has various options supplied with it.  In
+        Geolocation this was done with custom bindings, but I'm trying to
+        avoid that for IndexedDB.  
+
+        This first patch implements it in V8 and makes createObjectStore use it.
+        The next patch will cover Geolocation and JSC.
+
+        Test: storage/indexeddb/create-object-store-options.html
+
+        * WebCore.gypi:
+        * bindings/scripts/CodeGeneratorV8.pm:
+        * bindings/scripts/test/CPP/WebDOMTestObj.cpp:
+        (WebDOMTestObj::optionsObject):
+        * bindings/scripts/test/CPP/WebDOMTestObj.h:
+        * bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp:
+        * bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp:
+        * bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.cpp:
+        * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
+        (webkit_dom_test_obj_options_object):
+        * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        (WebCore::jsTestObjPrototypeFunctionOptionsObject):
+        * bindings/scripts/test/JS/JSTestObj.h:
+        * bindings/scripts/test/ObjC/DOMTestObj.h:
+        * bindings/scripts/test/ObjC/DOMTestObj.mm:
+        (-[DOMTestObj optionsObject:ooo:]):
+        * bindings/scripts/test/TestObj.idl:
+        * bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp:
+        (WebCore::ConfigureV8TestMediaQueryListListenerTemplate):
+        * bindings/scripts/test/V8/V8TestObj.cpp:
+        (WebCore::TestObjInternal::optionsObjectCallback):
+        * bindings/v8/OptionsObject.cpp: Added.
+        (WebCore::OptionsObject::OptionsObject):
+        (WebCore::OptionsObject::~OptionsObject):
+        (WebCore::OptionsObject::operator=):
+        (WebCore::OptionsObject::undefinedOrNull):
+        (WebCore::OptionsObject::getKeyBool):
+        (WebCore::OptionsObject::getKeyString):
+        (WebCore::OptionsObject::getKey):
+        * bindings/v8/OptionsObject.h:
+        * bindings/js/OptionsObject.h:
+        * storage/IDBDatabase.cpp:
+        (WebCore::IDBDatabase::createObjectStore):
+        * storage/IDBDatabase.h:
+        (WebCore::IDBDatabase::createObjectStore):
+        * storage/IDBDatabase.idl:
+
 2010-11-24  Pavel Podivilov  <podivilov at chromium.org>
 
         Reviewed by Yury Semikhatsky.
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 45a18e0..dbc8979 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -745,6 +745,8 @@
             'bindings/v8/ChildThreadDOMData.h',
             'bindings/v8/IDBBindingUtilities.cpp',
             'bindings/v8/IDBBindingUtilities.h',
+            'bindings/v8/OptionsObject.cpp',
+            'bindings/v8/OptionsObject.h',
             'bindings/v8/custom/V8CanvasPixelArrayCustom.cpp',
             'bindings/v8/custom/V8ArrayBufferViewCustom.h',
             'bindings/v8/custom/V8ArrayBufferCustom.cpp',
diff --git a/WebCore/bindings/js/OptionsObject.h b/WebCore/bindings/js/OptionsObject.h
new file mode 100644
index 0000000..34910c0
--- /dev/null
+++ b/WebCore/bindings/js/OptionsObject.h
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ *
+ * 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 OptionsObject_h
+#define OptionsObject_h
+
+// FIXME: Implement.
+
+#endif // OptionsObject_h
diff --git a/WebCore/bindings/scripts/CodeGeneratorV8.pm b/WebCore/bindings/scripts/CodeGeneratorV8.pm
index dc04e45..922da15 100644
--- a/WebCore/bindings/scripts/CodeGeneratorV8.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorV8.pm
@@ -2805,6 +2805,7 @@ sub GetNativeType
     return "Node*" if $type eq "EventTarget" and $isParameter;
     return "double" if $type eq "Date";
     return "ScriptValue" if $type eq "DOMObject";
+    return "OptionsObject" if $type eq "OptionsObject";
 
     return "String" if $type eq "DOMUserData";  # FIXME: Temporary hack?
 
@@ -2888,6 +2889,11 @@ sub JSValueToNative
         return "createIDBKeyFromValue($value)";
     }
 
+    if ($type eq "OptionsObject") {
+        $implIncludes{"OptionsObject.h"} = 1;
+        return $value;
+    }
+
     if ($type eq "DOMObject") {
         $implIncludes{"ScriptValue.h"} = 1;
         return "ScriptValue($value)";
@@ -3033,6 +3039,7 @@ my %non_wrapper_types = (
     'NodeFilter' => 1,
     'EventListener' => 1,
     'IDBKey' => 1,
+    'OptionsObject' => 1,
     'Date' => 1,
     'MediaQueryListListener' => 1
 );
diff --git a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp
index 9a8d909..819c7cf 100644
--- a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp
+++ b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp
@@ -24,9 +24,11 @@
 #include "HTMLNames.h"
 #include "IDBKey.h"
 #include "KURL.h"
+#include "OptionsObject.h"
 #include "SerializedScriptValue.h"
 #include "TestObj.h"
 #include "WebDOMIDBKey.h"
+#include "WebDOMOptionsObject.h"
 #include "WebDOMString.h"
 #include "WebExceptionHandler.h"
 #include "WebNativeEventListener.h"
@@ -662,6 +664,14 @@ void WebDOMTestObj::idbKey(const WebDOMIDBKey& key)
     impl()->idbKey(toWebCore(key));
 }
 
+void WebDOMTestObj::optionsObject(const WebDOMOptionsObject& oo, const WebDOMOptionsObject& ooo)
+{
+    if (!impl())
+        return;
+
+    impl()->optionsObject(toWebCore(oo), toWebCore(ooo));
+}
+
 void WebDOMTestObj::methodWithException()
 {
     if (!impl())
diff --git a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
index f29b7dc..0b3593d 100644
--- a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
+++ b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
@@ -32,6 +32,7 @@ class TestObj;
 
 class WebDOMEventListener;
 class WebDOMIDBKey;
+class WebDOMOptionsObject;
 class WebDOMString;
 class WebDOMTestObj;
 
@@ -136,6 +137,7 @@ public:
     WebDOMTestObj methodThatRequiresAllArgsAndThrows(const WebDOMString& strArg, const WebDOMTestObj& objArg);
     void serializedValue(const WebDOMString& serializedArg);
     void idbKey(const WebDOMIDBKey& key);
+    void optionsObject(const WebDOMOptionsObject& oo, const WebDOMOptionsObject& ooo);
     void methodWithException();
     void customMethod();
     void customMethodWithArgs(int intArg, const WebDOMString& strArg, const WebDOMTestObj& objArg);
diff --git a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp
index 19ff166..554cc15 100644
--- a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp
+++ b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp
@@ -25,6 +25,7 @@
 
 #include <wtf/GetPtr.h>
 #include <wtf/RefPtr.h>
+#include "DOMObjectCache.h"
 #include "ExceptionCode.h"
 #include "JSMainThreadExecState.h"
 #include "TestCallback.h"
diff --git a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp
index a13da45..6c906e4 100644
--- a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp
+++ b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp
@@ -25,6 +25,7 @@
 
 #include <wtf/GetPtr.h>
 #include <wtf/RefPtr.h>
+#include "DOMObjectCache.h"
 #include "ExceptionCode.h"
 #include "JSMainThreadExecState.h"
 #include "TestInterface.h"
diff --git a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.cpp b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.cpp
index f5ded79..a7d364c 100644
--- a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.cpp
+++ b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestMediaQueryListListener.cpp
@@ -23,6 +23,7 @@
 
 #include <wtf/GetPtr.h>
 #include <wtf/RefPtr.h>
+#include "DOMObjectCache.h"
 #include "ExceptionCode.h"
 #include "JSMainThreadExecState.h"
 #include "TestMediaQueryListListener.h"
diff --git a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp
index 1bf9983..ec2c6dc 100644
--- a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp
+++ b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp
@@ -23,6 +23,7 @@
 
 #include <wtf/GetPtr.h>
 #include <wtf/RefPtr.h>
+#include "DOMObjectCache.h"
 #include "ExceptionCode.h"
 #include "HTMLNames.h"
 #include "JSMainThreadExecState.h"
@@ -31,6 +32,8 @@
 #include "gobject/ConvertToUTF8String.h"
 #include "webkit/WebKitDOMIDBKey.h"
 #include "webkit/WebKitDOMIDBKeyPrivate.h"
+#include "webkit/WebKitDOMOptionsObject.h"
+#include "webkit/WebKitDOMOptionsObjectPrivate.h"
 #include "webkit/WebKitDOMSerializedScriptValue.h"
 #include "webkit/WebKitDOMSerializedScriptValuePrivate.h"
 #include "webkit/WebKitDOMTestObj.h"
@@ -211,6 +214,27 @@ webkit_dom_test_obj_idb_key(WebKitDOMTestObj* self, WebKitDOMIDBKey* key)
 }
 
 void
+webkit_dom_test_obj_options_object(WebKitDOMTestObj* self, WebKitDOMOptionsObject* oo, WebKitDOMOptionsObject* ooo)
+{
+    g_return_if_fail(self);
+    WebCore::JSMainThreadNullState state;
+    WebCore::TestObj * item = WebKit::core(self);
+    g_return_if_fail(oo);
+    g_return_if_fail(ooo);
+    WebCore::OptionsObject * converted_oo = NULL;
+    if (oo != NULL) {
+        converted_oo = WebKit::core(oo);
+        g_return_if_fail(converted_oo);
+    }
+    WebCore::OptionsObject * converted_ooo = NULL;
+    if (ooo != NULL) {
+        converted_ooo = WebKit::core(ooo);
+        g_return_if_fail(converted_ooo);
+    }
+    item->optionsObject(converted_oo, converted_ooo);
+}
+
+void
 webkit_dom_test_obj_method_with_exception(WebKitDOMTestObj* self, GError **error)
 {
     g_return_if_fail(self);
diff --git a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h
index 2eebdb1..42d1fcd 100644
--- a/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h
+++ b/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h
@@ -77,6 +77,9 @@ WEBKIT_API void
 webkit_dom_test_obj_idb_key(WebKitDOMTestObj* self, WebKitDOMIDBKey* key);
 
 WEBKIT_API void
+webkit_dom_test_obj_options_object(WebKitDOMTestObj* self, WebKitDOMOptionsObject* oo, WebKitDOMOptionsObject* ooo);
+
+WEBKIT_API void
 webkit_dom_test_obj_method_with_exception(WebKitDOMTestObj* self, GError **error);
 
 
diff --git a/WebCore/bindings/scripts/test/JS/JSTestObj.cpp b/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
index 9820fab..d8bf67e 100644
--- a/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
+++ b/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
@@ -27,6 +27,7 @@
 #include "IDBKey.h"
 #include "JSDOMBinding.h"
 #include "JSEventListener.h"
+#include "JSOptionsObject.h"
 #include "JSTestCallback.h"
 #include "JSTestObj.h"
 #include "JSlog.h"
@@ -181,7 +182,7 @@ bool JSTestObjConstructor::getOwnPropertyDescriptor(ExecState* exec, const Ident
 #define THUNK_GENERATOR(generator)
 #endif
 
-static const HashTableValue JSTestObjPrototypeTableValues[47] =
+static const HashTableValue JSTestObjPrototypeTableValues[48] =
 {
     { "CONST_VALUE_0", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_0), (intptr_t)0 THUNK_GENERATOR(0) },
     { "CONST_VALUE_1", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCONST_VALUE_1), (intptr_t)0 THUNK_GENERATOR(0) },
@@ -204,6 +205,7 @@ static const HashTableValue JSTestObjPrototypeTableValues[47] =
     { "methodThatRequiresAllArgsAndThrows", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows), (intptr_t)2 THUNK_GENERATOR(0) },
     { "serializedValue", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionSerializedValue), (intptr_t)1 THUNK_GENERATOR(0) },
     { "idbKey", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionIdbKey), (intptr_t)1 THUNK_GENERATOR(0) },
+    { "optionsObject", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionOptionsObject), (intptr_t)2 THUNK_GENERATOR(0) },
     { "methodWithException", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionMethodWithException), (intptr_t)0 THUNK_GENERATOR(0) },
     { "customMethod", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionCustomMethod), (intptr_t)0 THUNK_GENERATOR(0) },
     { "customMethodWithArgs", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionCustomMethodWithArgs), (intptr_t)3 THUNK_GENERATOR(0) },
@@ -233,7 +235,7 @@ static const HashTableValue JSTestObjPrototypeTableValues[47] =
 };
 
 #undef THUNK_GENERATOR
-static JSC_CONST_HASHTABLE HashTable JSTestObjPrototypeTable = { 135, 127, JSTestObjPrototypeTableValues, 0 };
+static JSC_CONST_HASHTABLE HashTable JSTestObjPrototypeTable = { 136, 127, JSTestObjPrototypeTableValues, 0 };
 const ClassInfo JSTestObjPrototype::s_info = { "TestObjPrototype", 0, &JSTestObjPrototypeTable, 0 };
 
 JSObject* JSTestObjPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
@@ -990,6 +992,31 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionIdbKey(ExecState* exec)
     return JSValue::encode(jsUndefined());
 }
 
+EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOptionsObject(ExecState* exec)
+{
+    JSValue thisValue = exec->hostThisValue();
+    if (!thisValue.inherits(&JSTestObj::s_info))
+        return throwVMTypeError(exec);
+    JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(thisValue));
+    TestObj* imp = static_cast<TestObj*>(castedThis->impl());
+    OptionsObject* oo = toOptionsObject(exec->argument(0));
+    if (exec->hadException())
+        return JSValue::encode(jsUndefined());
+
+    int argsCount = exec->argumentCount();
+    if (argsCount <= 1) {
+        imp->optionsObject(oo);
+        return JSValue::encode(jsUndefined());
+    }
+
+    OptionsObject* ooo = toOptionsObject(exec->argument(1));
+    if (exec->hadException())
+        return JSValue::encode(jsUndefined());
+
+    imp->optionsObject(oo, ooo);
+    return JSValue::encode(jsUndefined());
+}
+
 EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithException(ExecState* exec)
 {
     JSValue thisValue = exec->hostThisValue();
diff --git a/WebCore/bindings/scripts/test/JS/JSTestObj.h b/WebCore/bindings/scripts/test/JS/JSTestObj.h
index 6014f7a..c27444a 100644
--- a/WebCore/bindings/scripts/test/JS/JSTestObj.h
+++ b/WebCore/bindings/scripts/test/JS/JSTestObj.h
@@ -96,6 +96,7 @@ JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodThatRequiresAl
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionSerializedValue(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionIdbKey(JSC::ExecState*);
+JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionOptionsObject(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithException(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomMethod(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionCustomMethodWithArgs(JSC::ExecState*);
diff --git a/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h b/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
index fd40095..766d31f 100644
--- a/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
+++ b/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
@@ -29,6 +29,7 @@
 #if WEBKIT_VERSION_MAX_ALLOWED >= WEBKIT_VERSION_LATEST
 
 @class DOMIDBKey;
+ at class DOMOptionsObject;
 @class DOMTestObj;
 @class DOMlog;
 @class NSString;
@@ -127,6 +128,7 @@ enum {
 - (DOMTestObj *)methodThatRequiresAllArgsAndThrows:(NSString *)strArg objArg:(DOMTestObj *)objArg;
 - (void)serializedValue:(NSString *)serializedArg;
 - (void)idbKey:(DOMIDBKey *)key;
+- (void)optionsObject:(DOMOptionsObject *)oo ooo:(DOMOptionsObject *)ooo;
 - (void)methodWithException;
 - (void)customMethod;
 - (void)customMethodWithArgs:(int)intArg strArg:(NSString *)strArg objArg:(DOMTestObj *)objArg;
diff --git a/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm b/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm
index 612597f..ac04235 100644
--- a/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm
+++ b/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm
@@ -35,6 +35,7 @@
 #import "DOMEventInternal.h"
 #import "DOMIDBKeyInternal.h"
 #import "DOMNodeInternal.h"
+#import "DOMOptionsObjectInternal.h"
 #import "DOMStyleSheetInternal.h"
 #import "DOMTestObjInternal.h"
 #import "DOMlogInternal.h"
@@ -45,6 +46,7 @@
 #import "JSMainThreadExecState.h"
 #import "KURL.h"
 #import "ObjCEventListener.h"
+#import "OptionsObject.h"
 #import "SerializedScriptValue.h"
 #import "TestObj.h"
 #import "ThreadCheck.h"
@@ -533,6 +535,12 @@
     IMPL->idbKey(core(key));
 }
 
+- (void)optionsObject:(DOMOptionsObject *)oo ooo:(DOMOptionsObject *)ooo
+{
+    WebCore::JSMainThreadNullState state;
+    IMPL->optionsObject(core(oo), core(ooo));
+}
+
 - (void)methodWithException
 {
     WebCore::JSMainThreadNullState state;
diff --git a/WebCore/bindings/scripts/test/TestObj.idl b/WebCore/bindings/scripts/test/TestObj.idl
index 537534b..c0d0e88 100644
--- a/WebCore/bindings/scripts/test/TestObj.idl
+++ b/WebCore/bindings/scripts/test/TestObj.idl
@@ -74,6 +74,7 @@ module test {
 
         void serializedValue(in SerializedScriptValue serializedArg);
         void idbKey(in IDBKey key);
+        void optionsObject(in OptionsObject oo, in [Optional] OptionsObject ooo);
 
         // Exceptions
         void methodWithException() raises(DOMException);
diff --git a/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp b/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp
index f1c4e2b..ab9e6db 100644
--- a/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp
+++ b/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp
@@ -57,7 +57,7 @@ static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestMediaQueryListListene
 {
     v8::Local<v8::Signature> defaultSignature = configureTemplate(desc, "TestMediaQueryListListener", v8::Persistent<v8::FunctionTemplate>(), V8TestMediaQueryListListener::internalFieldCount,
         0, 0,
-        TestMediaQueryListListenerCallbacks, sizeof(TestMediaQueryListListenerCallbacks) / sizeof(*TestMediaQueryListListenerCallbacks));
+        TestMediaQueryListListenerCallbacks, WTF_ARRAY_LENGTH(TestMediaQueryListListenerCallbacks));
     v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
     v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
     
diff --git a/WebCore/bindings/scripts/test/V8/V8TestObj.cpp b/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
index c4a76ac..e06d3f2 100644
--- a/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
+++ b/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
@@ -25,6 +25,7 @@
 #include "HTMLNames.h"
 #include "IDBBindingUtilities.h"
 #include "IDBKey.h"
+#include "OptionsObject.h"
 #include "RuntimeEnabledFeatures.h"
 #include "ScriptArguments.h"
 #include "ScriptCallStack.h"
@@ -727,6 +728,20 @@ static v8::Handle<v8::Value> idbKeyCallback(const v8::Arguments& args)
     return v8::Handle<v8::Value>();
 }
 
+static v8::Handle<v8::Value> optionsObjectCallback(const v8::Arguments& args)
+{
+    INC_STATS("DOM.TestObj.optionsObject");
+    TestObj* imp = V8TestObj::toNative(args.Holder());
+    EXCEPTION_BLOCK(OptionsObject, oo, args[0]);
+    if (args.Length() <= 1) {
+        imp->optionsObject(oo);
+        return v8::Handle<v8::Value>();
+    }
+    EXCEPTION_BLOCK(OptionsObject, ooo, args[1]);
+    imp->optionsObject(oo, ooo);
+    return v8::Handle<v8::Value>();
+}
+
 static v8::Handle<v8::Value> methodWithExceptionCallback(const v8::Arguments& args)
 {
     INC_STATS("DOM.TestObj.methodWithException");
@@ -1201,6 +1216,7 @@ static const BatchedCallback TestObjCallbacks[] = {
     {"objMethod", TestObjInternal::objMethodCallback},
     {"serializedValue", TestObjInternal::serializedValueCallback},
     {"idbKey", TestObjInternal::idbKeyCallback},
+    {"optionsObject", TestObjInternal::optionsObjectCallback},
     {"methodWithException", TestObjInternal::methodWithExceptionCallback},
     {"customMethod", V8TestObj::customMethodCallback},
     {"customMethodWithArgs", V8TestObj::customMethodWithArgsCallback},
diff --git a/WebCore/bindings/v8/OptionsObject.cpp b/WebCore/bindings/v8/OptionsObject.cpp
new file mode 100644
index 0000000..dde511a
--- /dev/null
+++ b/WebCore/bindings/v8/OptionsObject.cpp
@@ -0,0 +1,102 @@
+/*
+ * 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.
+ *
+ * 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 "OptionsObject.h"
+#include "V8Binding.h"
+
+namespace WebCore {
+
+OptionsObject::OptionsObject()
+{
+}
+
+OptionsObject::OptionsObject(const v8::Local<v8::Value>& options)
+    : m_options(options)
+{
+}
+
+OptionsObject::~OptionsObject()
+{
+}
+
+OptionsObject& OptionsObject::operator=(const OptionsObject& optionsObject)
+{
+    m_options = optionsObject.m_options;
+    return *this;
+}
+
+bool OptionsObject::isUndefinedOrNull() const
+{
+    if (m_options.IsEmpty())
+        return true;
+    return WebCore::isUndefinedOrNull(m_options);
+}
+
+bool OptionsObject::getKeyBool(const String& key, bool& value) const
+{
+    v8::Local<v8::Value> v8Value;
+    if (!getKey(key, v8Value))
+        return false;
+
+    if (!v8Value->IsBoolean())
+        return false;
+    v8::Local<v8::Boolean> v8Bool = v8Value->ToBoolean();
+    ASSERT(!v8Bool.IsEmpty());
+
+    value = v8Bool->Value();
+    return true;
+}
+
+bool OptionsObject::getKeyString(const String& key, String& value) const
+{
+    v8::Local<v8::Value> v8Value;
+    if (!getKey(key, v8Value))
+        return false;
+
+    if (!v8Value->IsString())
+        return false;
+
+    value = v8ValueToWebCoreString(v8Value);
+    ASSERT(!value.isEmpty());
+    return true;
+}
+
+bool OptionsObject::getKey(const String& key, v8::Local<v8::Value>& value) const
+{
+    if (isUndefinedOrNull())
+        return false;
+    v8::Local<v8::Object> options = m_options->ToObject();
+    ASSERT(!options.IsEmpty());
+
+    v8::Handle<v8::String> v8Key = v8String(key);
+    if (!options->Has(v8Key))
+        return false;
+    value = options->Get(v8Key);
+    ASSERT(!value.IsEmpty());
+    return true;
+}
+
+} // namespace WebCore
diff --git a/WebCore/bindings/v8/OptionsObject.h b/WebCore/bindings/v8/OptionsObject.h
new file mode 100644
index 0000000..de2f821
--- /dev/null
+++ b/WebCore/bindings/v8/OptionsObject.h
@@ -0,0 +1,60 @@
+/*
+ * 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.
+ *
+ * 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 OptionsObject_h
+#define OptionsObject_h
+
+#include "PlatformString.h"
+#include <v8.h>
+#include <wtf/NonCopyable.h>
+
+namespace WebCore {
+
+class OptionsObject {
+public:
+    OptionsObject();
+    OptionsObject(const v8::Local<v8::Value>& options);
+    ~OptionsObject();
+
+    OptionsObject& operator=(const OptionsObject&);
+
+    bool isUndefinedOrNull() const;
+    bool getKeyBool(const String& key, bool& value) const;
+    bool getKeyString(const String& key, String& value) const;
+
+private:
+    bool getKey(const String& key, v8::Local<v8::Value>&) const;
+
+    // This object can only be used safely when stack allocated because of v8::Local.
+    static void* operator new(size_t);
+    static void* operator new[](size_t);
+    static void operator delete(void *);
+
+    v8::Local<v8::Value> m_options;
+};
+
+}
+
+#endif // OptionsObject_h
diff --git a/WebCore/storage/IDBDatabase.cpp b/WebCore/storage/IDBDatabase.cpp
index 1536ba7..72ff17d 100644
--- a/WebCore/storage/IDBDatabase.cpp
+++ b/WebCore/storage/IDBDatabase.cpp
@@ -56,13 +56,19 @@ void IDBDatabase::setSetVersionTransaction(IDBTransactionBackendInterface* trans
     m_setVersionTransaction = transaction;
 }
 
-PassRefPtr<IDBObjectStore> IDBDatabase::createObjectStore(const String& name, const String& keyPath, bool autoIncrement, ExceptionCode& ec)
+PassRefPtr<IDBObjectStore> IDBDatabase::createObjectStore(const String& name, const OptionsObject& options, ExceptionCode& ec)
 {
     if (!m_setVersionTransaction) {
         ec = IDBDatabaseException::NOT_ALLOWED_ERR;
         return 0;
     }
 
+    String keyPath;
+    options.getKeyString("keyPath", keyPath);
+    bool autoIncrement = false;
+    options.getKeyBool("autoIncrement", autoIncrement);
+    // FIXME: Look up evictable and pass that on as well.
+
     RefPtr<IDBObjectStoreBackendInterface> objectStore = m_backend->createObjectStore(name, keyPath, autoIncrement, m_setVersionTransaction.get(), ec);
     if (!objectStore) {
         // FIXME: ASSERT(ec) once UNKNOWN_ERR is not 0.
diff --git a/WebCore/storage/IDBDatabase.h b/WebCore/storage/IDBDatabase.h
index df56f46..3e33472 100644
--- a/WebCore/storage/IDBDatabase.h
+++ b/WebCore/storage/IDBDatabase.h
@@ -31,6 +31,7 @@
 #include "IDBDatabaseBackendInterface.h"
 #include "IDBObjectStore.h"
 #include "IDBTransaction.h"
+#include "OptionsObject.h"
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
@@ -59,13 +60,12 @@ public:
     PassRefPtr<DOMStringList> objectStores() const { return m_backend->objectStores(); }
 
     // FIXME: Try to modify the code generator so this is unneeded.
-    PassRefPtr<IDBObjectStore> createObjectStore(const String& name, ExceptionCode& ec) { return createObjectStore(name, String(), ec); }
-    PassRefPtr<IDBObjectStore> createObjectStore(const String& name, const String& keyPath, ExceptionCode& ec) { return createObjectStore(name, keyPath, false, ec); }
+    PassRefPtr<IDBObjectStore> createObjectStore(const String& name, ExceptionCode& ec) { return createObjectStore(name, OptionsObject(), ec); }
     PassRefPtr<IDBTransaction> transaction(ScriptExecutionContext* context, ExceptionCode& ec) { return transaction(context, 0, ec); }
     PassRefPtr<IDBTransaction> transaction(ScriptExecutionContext* context, DOMStringList* storeNames, ExceptionCode& ec) { return transaction(context, storeNames, IDBTransaction::READ_ONLY, ec); }
     PassRefPtr<IDBTransaction> transaction(ScriptExecutionContext* context, DOMStringList* storeNames, unsigned short mode, ExceptionCode& ec) { return transaction(context, storeNames, mode, 0, ec); } // FIXME: what should the default timeout be?
 
-    PassRefPtr<IDBObjectStore> createObjectStore(const String& name, const String& keyPath, bool autoIncrement, ExceptionCode&);
+    PassRefPtr<IDBObjectStore> createObjectStore(const String& name, const OptionsObject&, ExceptionCode&);
     void removeObjectStore(const String& name, ExceptionCode&);
     PassRefPtr<IDBRequest> setVersion(ScriptExecutionContext*, const String& version, ExceptionCode&);
     PassRefPtr<IDBTransaction> transaction(ScriptExecutionContext*, DOMStringList*, unsigned short mode, unsigned long timeout, ExceptionCode&);
diff --git a/WebCore/storage/IDBDatabase.idl b/WebCore/storage/IDBDatabase.idl
index 1ab5b0b..b08d459 100644
--- a/WebCore/storage/IDBDatabase.idl
+++ b/WebCore/storage/IDBDatabase.idl
@@ -32,7 +32,7 @@ module storage {
         readonly attribute DOMString version;
         readonly attribute DOMStringList objectStores;
 
-        IDBObjectStore createObjectStore(in DOMString name, in [Optional, ConvertNullToNullString] DOMString keyPath, in [Optional] boolean autoIncrement)
+        IDBObjectStore createObjectStore(in DOMString name, in [Optional] OptionsObject options)
             raises (IDBDatabaseException);
         void removeObjectStore(in DOMString name)
             raises (IDBDatabaseException);
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 4ecd19a..b084c21 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,13 @@
+2010-11-25  Jeremy Orlow  <jorlow at chromium.org>
+
+        Reviewed by Steve Block.
+
+        Add exception code to WebIDBTransaction::objectStore
+        https://bugs.webkit.org/show_bug.cgi?id=50030
+
+        * public/WebIDBTransaction.h:
+        (WebKit::WebIDBTransaction::objectStore):
+
 2010-11-24  MORITA Hajime  <morrita at google.com>
 
         Reviewed by Kent Tamura.
diff --git a/WebKit/chromium/public/WebIDBTransaction.h b/WebKit/chromium/public/WebIDBTransaction.h
index e75de3c..584b67a 100644
--- a/WebKit/chromium/public/WebIDBTransaction.h
+++ b/WebKit/chromium/public/WebIDBTransaction.h
@@ -26,6 +26,7 @@
 #ifndef WebIDBTransaction_h
 #define WebIDBTransaction_h
 
+#include "WebExceptionCode.h"
 #include "WebString.h"
 
 namespace WebCore { class IDBTransactionBackendInterface; }
@@ -45,10 +46,15 @@ public:
         WEBKIT_ASSERT_NOT_REACHED();
         return 0;
     }
+    virtual WebIDBObjectStore* objectStore(const WebString& name, WebExceptionCode&)
+    {
+        return objectStore(name);
+    }
+    // FIXME: Remove this after WebKit roll.
     virtual WebIDBObjectStore* objectStore(const WebString& name)
     {
-        WEBKIT_ASSERT_NOT_REACHED();
-        return 0;
+        WebExceptionCode ec;
+        return objectStore(name, ec);
     }
     virtual void abort() { WEBKIT_ASSERT_NOT_REACHED(); }
     virtual void didCompleteTaskEvents() { WEBKIT_ASSERT_NOT_REACHED(); }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list