[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198
hans at chromium.org
hans at chromium.org
Mon Feb 21 00:37:21 UTC 2011
The following commit has been merged in the webkit-1.3 branch:
commit 0ddd12d309fcda5fc65ae634d468e0e5495fb5b9
Author: hans at chromium.org <hans at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Feb 2 10:10:54 2011 +0000
2011-02-02 Hans Wennborg <hans at chromium.org>
Reviewed by Jeremy Orlow.
IndexedDB: Implement support for cursor updates
https://bugs.webkit.org/show_bug.cgi?id=53421
Layout test for cursor updates.
* storage/indexeddb/cursor-update-expected.txt: Added.
* storage/indexeddb/cursor-update.html: Added.
2011-02-02 Hans Wennborg <hans at chromium.org>
Reviewed by Jeremy Orlow.
IndexedDB: Implement support for cursor updates
https://bugs.webkit.org/show_bug.cgi?id=53421
Implement support for cursor updates using the same pattern as cursor
deletes: forward the calls to the IDBObjectStoreBackend::put().
The put() function's signature needs to be changed to allow for a
"cursor update mode". This makes the signature more clear anyway,
since it replaces the boolean parameter.
Test: storage/indexeddb/cursor-update.html
* storage/IDBCursor.idl:
* storage/IDBCursorBackendImpl.cpp:
(WebCore::IDBCursorBackendImpl::key):
(WebCore::IDBCursorBackendImpl::update):
* storage/IDBCursorBackendImpl.h:
* storage/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::add):
(WebCore::IDBObjectStore::put):
* storage/IDBObjectStoreBackendImpl.cpp:
(WebCore::IDBObjectStoreBackendImpl::put):
(WebCore::IDBObjectStoreBackendImpl::putInternal):
* storage/IDBObjectStoreBackendImpl.h:
* storage/IDBObjectStoreBackendInterface.h:
2011-02-02 Hans Wennborg <hans at chromium.org>
Reviewed by Jeremy Orlow.
IndexedDB: Implement support for cursor updates
https://bugs.webkit.org/show_bug.cgi?id=53421
Mirror the update to the IDBObjectStoreInterface::put() signature in
the WebKit layer wrappers.
* public/WebIDBObjectStore.h:
(WebKit::WebIDBObjectStore::put):
* src/IDBObjectStoreProxy.cpp:
(WebCore::IDBObjectStoreProxy::put):
* src/IDBObjectStoreProxy.h:
* src/WebIDBObjectStoreImpl.cpp:
(WebKit::WebIDBObjectStoreImpl::put):
* src/WebIDBObjectStoreImpl.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77371 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index e803038..c06b7e7 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2011-02-02 Hans Wennborg <hans at chromium.org>
+
+ Reviewed by Jeremy Orlow.
+
+ IndexedDB: Implement support for cursor updates
+ https://bugs.webkit.org/show_bug.cgi?id=53421
+
+ Layout test for cursor updates.
+
+ * storage/indexeddb/cursor-update-expected.txt: Added.
+ * storage/indexeddb/cursor-update.html: Added.
+
2011-02-01 James Robinson <jamesr at chromium.org>
Reviewed by Adam Barth.
diff --git a/LayoutTests/storage/indexeddb/cursor-update-expected.txt b/LayoutTests/storage/indexeddb/cursor-update-expected.txt
new file mode 100644
index 0000000..87d3bca
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/cursor-update-expected.txt
@@ -0,0 +1,279 @@
+Test IndexedDB's cursor update.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+webkitIndexedDB.open('name')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+db = event.result
+db.setVersion('new version')
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+setVersionSuccess():
+Success event fired:
+PASS 'result' in event is true
+PASS 'code' in event is false
+PASS 'message' in event is false
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+trans = event.result
+PASS trans !== null is true
+Deleted all object stores.
+createAndPopulateObjectStore():
+objectStore = db.createObjectStore('basicStore')
+objectStore.add('myValue1', 'myKey1').onerror = unexpectedErrorCallback
+objectStore.add('myValue2', 'myKey2').onerror = unexpectedErrorCallback
+objectStore.add('myValue3', 'myKey3').onerror = unexpectedErrorCallback
+objectStore.add('myValue4', 'myKey4').onerror = unexpectedErrorCallback
+objectStore = db.createObjectStore('autoIncrementStore', {autoIncrement: true})
+objectStore.add('foo1').onerror = unexpectedErrorCallback
+objectStore.add('foo2').onerror = unexpectedErrorCallback
+objectStore.add('foo3').onerror = unexpectedErrorCallback
+objectStore.add('foo4').onerror = unexpectedErrorCallback
+objectStore = db.createObjectStore('keyPathStore', {keyPath: 'id'})
+objectStore.createIndex('numberIndex', 'number')
+objectStore.add({number: 1, id: 1}).onerror = unexpectedErrorCallback
+objectStore.add({number: 2, id: 2}).onerror = unexpectedErrorCallback
+objectStore.add({number: 3, id: 3}).onerror = unexpectedErrorCallback
+objectStore.add({number: 4, id: 4}).onerror = unexpectedErrorCallback
+openBasicCursor()
+trans = db.transaction([], webkitIDBTransaction.READ_WRITE)
+trans.objectStore('basicStore').openCursor(keyRange)
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+basicUpdateCursor()
+event.result.update('myUpdatedValue' + counter++)
+event.source.continue()
+basicUpdateCursor()
+event.result.update('myUpdatedValue' + counter++)
+event.source.continue()
+basicUpdateCursor()
+event.result.update('myUpdatedValue' + counter++)
+event.source.continue()
+basicUpdateCursor()
+event.result.update('myUpdatedValue' + counter++)
+event.source.continue()
+basicUpdateCursor()
+PASS counter is 5
+trans.objectStore('basicStore').openCursor(keyRange)
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+basicCheckCursor()
+PASS event.result.key is "myKey1"
+PASS event.result.value is "myUpdatedValue1"
+event.result.continue()
+basicCheckCursor()
+PASS event.result.key is "myKey2"
+PASS event.result.value is "myUpdatedValue2"
+event.result.continue()
+basicCheckCursor()
+PASS event.result.key is "myKey3"
+PASS event.result.value is "myUpdatedValue3"
+event.result.continue()
+basicCheckCursor()
+PASS event.result.key is "myKey4"
+PASS event.result.value is "myUpdatedValue4"
+event.result.continue()
+basicCheckCursor()
+PASS counter is 5
+trans.objectStore('autoIncrementStore').openCursor(keyRange)
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+autoIncrementUpdateCursor()
+event.result.update('myUpdatedFoo' + counter++)
+event.source.continue()
+autoIncrementUpdateCursor()
+event.result.update('myUpdatedFoo' + counter++)
+event.source.continue()
+autoIncrementUpdateCursor()
+event.result.update('myUpdatedFoo' + counter++)
+event.source.continue()
+autoIncrementUpdateCursor()
+event.result.update('myUpdatedFoo' + counter++)
+event.source.continue()
+autoIncrementUpdateCursor()
+PASS counter is 5
+trans.objectStore('autoIncrementStore').openCursor(keyRange)
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+autoIncrementCheckCursor()
+PASS event.result.key is counter
+PASS event.result.value is "myUpdatedFoo1"
+event.result.continue()
+autoIncrementCheckCursor()
+PASS event.result.key is counter
+PASS event.result.value is "myUpdatedFoo2"
+event.result.continue()
+autoIncrementCheckCursor()
+PASS event.result.key is counter
+PASS event.result.value is "myUpdatedFoo3"
+event.result.continue()
+autoIncrementCheckCursor()
+PASS event.result.key is counter
+PASS event.result.value is "myUpdatedFoo4"
+event.result.continue()
+autoIncrementCheckCursor()
+PASS counter is 5
+trans.objectStore('keyPathStore').openCursor(keyRange)
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+keyPathUpdateCursor()
+event.result.update({id: 100 + counter, number: 100 + counter})
+Error event fired:
+PASS 'result' in event is false
+PASS 'code' in event is true
+PASS 'message' in event is true
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.code is webkitIDBDatabaseException.DATA_ERR
+event.source.update({id: counter, number: 100 + counter++})
+event.source.continue()
+keyPathUpdateCursor()
+event.result.update({id: 100 + counter, number: 100 + counter})
+Error event fired:
+PASS 'result' in event is false
+PASS 'code' in event is true
+PASS 'message' in event is true
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.code is webkitIDBDatabaseException.DATA_ERR
+event.source.update({id: counter, number: 100 + counter++})
+event.source.continue()
+keyPathUpdateCursor()
+event.result.update({id: 100 + counter, number: 100 + counter})
+Error event fired:
+PASS 'result' in event is false
+PASS 'code' in event is true
+PASS 'message' in event is true
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.code is webkitIDBDatabaseException.DATA_ERR
+event.source.update({id: counter, number: 100 + counter++})
+event.source.continue()
+keyPathUpdateCursor()
+event.result.update({id: 100 + counter, number: 100 + counter})
+Error event fired:
+PASS 'result' in event is false
+PASS 'code' in event is true
+PASS 'message' in event is true
+PASS 'source' in event is true
+PASS event.source != null is true
+PASS 'onsuccess' in event.target is true
+PASS 'onerror' in event.target is true
+PASS 'readyState' in event.target is true
+PASS event.target.readyState is event.target.DONE
+
+PASS event.code is webkitIDBDatabaseException.DATA_ERR
+event.source.update({id: counter, number: 100 + counter++})
+event.source.continue()
+keyPathUpdateCursor()
+PASS counter is 5
+trans.objectStore('keyPathStore').openCursor(keyRange)
+PASS 'onsuccess' in result is true
+PASS 'onerror' in result is true
+PASS 'readyState' in result is true
+An event should fire shortly...
+
+keyPathCheckCursor()
+PASS event.result.key is counter
+PASS event.result.value.id is counter
+PASS event.result.value.number is 101
+event.result.continue()
+keyPathCheckCursor()
+PASS event.result.key is counter
+PASS event.result.value.id is counter
+PASS event.result.value.number is 102
+event.result.continue()
+keyPathCheckCursor()
+PASS event.result.key is counter
+PASS event.result.value.id is counter
+PASS event.result.value.number is 103
+event.result.continue()
+keyPathCheckCursor()
+PASS event.result.key is counter
+PASS event.result.value.id is counter
+PASS event.result.value.number is 104
+event.result.continue()
+keyPathCheckCursor()
+PASS counter is 5
+trans.objectStore('keyPathStore').index('numberIndex').openKeyCursor(keyRange)
+keyCursor()
+PASS event.result.key is counter + 100
+PASS event.result.value is counter
+event.result.update({id: counter, number: counter + 200})
+PASS code is webkitIDBDatabaseException.NOT_ALLOWED_ERR
+keyCursor()
+PASS event.result.key is counter + 100
+PASS event.result.value is counter
+event.result.update({id: counter, number: counter + 200})
+PASS code is webkitIDBDatabaseException.NOT_ALLOWED_ERR
+keyCursor()
+PASS event.result.key is counter + 100
+PASS event.result.value is counter
+event.result.update({id: counter, number: counter + 200})
+PASS code is webkitIDBDatabaseException.NOT_ALLOWED_ERR
+keyCursor()
+PASS event.result.key is counter + 100
+PASS event.result.value is counter
+event.result.update({id: counter, number: counter + 200})
+PASS code is webkitIDBDatabaseException.NOT_ALLOWED_ERR
+keyCursor()
+PASS counter is 5
+transactionComplete()
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/storage/indexeddb/cursor-update.html b/LayoutTests/storage/indexeddb/cursor-update.html
new file mode 100644
index 0000000..edc01e7
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/cursor-update.html
@@ -0,0 +1,247 @@
+<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 cursor update.");
+if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
+
+test();
+
+function test()
+{
+ result = evalAndLog("webkitIndexedDB.open('name')");
+ verifyResult(result);
+ result.onsuccess = openSuccess;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function openSuccess()
+{
+ verifySuccessEvent(event);
+ var db = evalAndLog("db = event.result");
+
+ result = evalAndLog("db.setVersion('new version')");
+ verifyResult(result);
+ result.onsuccess = setVersionSuccess;
+ result.onerror = unexpectedErrorCallback;
+}
+
+function setVersionSuccess()
+{
+ debug("setVersionSuccess():");
+ verifySuccessEvent(event);
+ window.trans = evalAndLog("trans = event.result");
+ shouldBeTrue("trans !== null");
+ trans.onabort = unexpectedAbortCallback;
+ trans.oncomplete = openBasicCursor;
+
+ deleteAllObjectStores(db, createAndPopulateObjectStore);
+}
+
+function createAndPopulateObjectStore()
+{
+ debug("createAndPopulateObjectStore():");
+ var objectStore = evalAndLog("objectStore = db.createObjectStore('basicStore')");
+ evalAndLog("objectStore.add('myValue1', 'myKey1').onerror = unexpectedErrorCallback");
+ evalAndLog("objectStore.add('myValue2', 'myKey2').onerror = unexpectedErrorCallback");
+ evalAndLog("objectStore.add('myValue3', 'myKey3').onerror = unexpectedErrorCallback");
+ evalAndLog("objectStore.add('myValue4', 'myKey4').onerror = unexpectedErrorCallback");
+
+ var objectStore = evalAndLog("objectStore = db.createObjectStore('autoIncrementStore', {autoIncrement: true})");
+ evalAndLog("objectStore.add('foo1').onerror = unexpectedErrorCallback");
+ evalAndLog("objectStore.add('foo2').onerror = unexpectedErrorCallback");
+ evalAndLog("objectStore.add('foo3').onerror = unexpectedErrorCallback");
+ evalAndLog("objectStore.add('foo4').onerror = unexpectedErrorCallback");
+
+ var objectStore = evalAndLog("objectStore = db.createObjectStore('keyPathStore', {keyPath: 'id'})");
+ evalAndLog("objectStore.createIndex('numberIndex', 'number')");
+ evalAndLog("objectStore.add({number: 1, id: 1}).onerror = unexpectedErrorCallback");
+ evalAndLog("objectStore.add({number: 2, id: 2}).onerror = unexpectedErrorCallback");
+ evalAndLog("objectStore.add({number: 3, id: 3}).onerror = unexpectedErrorCallback");
+ evalAndLog("objectStore.add({number: 4, id: 4}).onerror = unexpectedErrorCallback");
+}
+
+function openBasicCursor()
+{
+ debug("openBasicCursor()");
+ evalAndLog("trans = db.transaction([], webkitIDBTransaction.READ_WRITE)");
+ trans.onabort = unexpectedAbortCallback;
+ trans.oncomplete = transactionComplete;
+
+ keyRange = webkitIDBKeyRange.lowerBound("myKey1");
+ result = evalAndLog("trans.objectStore('basicStore').openCursor(keyRange)");
+ verifyResult(result);
+ result.onsuccess = basicUpdateCursor;
+ result.onerror = unexpectedErrorCallback;
+ counter = 1;
+}
+
+function basicUpdateCursor()
+{
+ debug("basicUpdateCursor()");
+ if (event.result == null) {
+ shouldBe("counter", "5");
+ counter = 1;
+
+ result = evalAndLog("trans.objectStore('basicStore').openCursor(keyRange)");
+ verifyResult(result);
+ result.onsuccess = basicCheckCursor;
+ result.onerror = unexpectedErrorCallback;
+ return;
+ }
+
+ result = evalAndLog("event.result.update('myUpdatedValue' + counter++)");
+ result.onsuccess = function() { evalAndLog("event.source.continue()"); }
+ result.onerror = unexpectedErrorCallback;
+}
+
+function basicCheckCursor()
+{
+ debug("basicCheckCursor()");
+ if (event.result == null) {
+ shouldBe("counter", "5");
+ counter = 1;
+
+ keyRange = webkitIDBKeyRange.lowerBound(1);
+ result = evalAndLog("trans.objectStore('autoIncrementStore').openCursor(keyRange)");
+ verifyResult(result);
+ result.onsuccess = autoIncrementUpdateCursor;
+ result.onerror = unexpectedErrorCallback;
+ return;
+ }
+
+ shouldBeEqualToString("event.result.key", "myKey" + counter);
+ shouldBeEqualToString("event.result.value", "myUpdatedValue" + counter++);
+ evalAndLog("event.result.continue()");
+}
+
+function autoIncrementUpdateCursor()
+{
+ debug("autoIncrementUpdateCursor()");
+ if (event.result == null) {
+ shouldBe("counter", "5");
+ counter = 1;
+
+ result = evalAndLog("trans.objectStore('autoIncrementStore').openCursor(keyRange)");
+ verifyResult(result);
+ result.onsuccess = autoIncrementCheckCursor;
+ result.onerror = unexpectedErrorCallback;
+ return;
+ }
+
+ result = evalAndLog("event.result.update('myUpdatedFoo' + counter++)");
+ result.onsuccess = function() { evalAndLog("event.source.continue()"); }
+ result.onerror = unexpectedErrorCallback;
+}
+
+function autoIncrementCheckCursor()
+{
+ debug("autoIncrementCheckCursor()");
+ if (event.result == null) {
+ shouldBe("counter", "5");
+ counter = 1;
+
+ keyRange = webkitIDBKeyRange.lowerBound(1);
+ result = evalAndLog("trans.objectStore('keyPathStore').openCursor(keyRange)");
+ verifyResult(result);
+ result.onsuccess = keyPathUpdateCursor;
+ result.onerror = unexpectedErrorCallback;
+ return;
+ }
+
+ shouldBe("event.result.key", "counter");
+ shouldBeEqualToString("event.result.value", "myUpdatedFoo" + counter++);
+ evalAndLog("event.result.continue()");
+}
+
+function keyPathUpdateCursor()
+{
+ debug("keyPathUpdateCursor()");
+ if (event.result == null) {
+ shouldBe("counter", "5");
+ counter = 1;
+
+ result = evalAndLog("trans.objectStore('keyPathStore').openCursor(keyRange)");
+ verifyResult(result);
+ result.onsuccess = keyPathCheckCursor;
+ result.onerror = unexpectedErrorCallback;
+ return;
+ }
+
+ result = evalAndLog("event.result.update({id: 100 + counter, number: 100 + counter})");
+ result.onsuccess = unexpectedSuccessCallback;
+ result.onerror = function() {
+ verifyErrorEvent(event);
+ shouldBe("event.code", "webkitIDBDatabaseException.DATA_ERR");
+
+ result = evalAndLog("event.source.update({id: counter, number: 100 + counter++})");
+ result.onsuccess = function() { evalAndLog("event.source.continue()") };
+ result.onerror = unexpectedErrorCallback;
+ }
+}
+
+function keyPathCheckCursor()
+{
+ debug("keyPathCheckCursor()");
+ if (event.result == null) {
+ shouldBe("counter", "5");
+ counter = 1;
+
+ keyRange = webkitIDBKeyRange.lowerBound(101);
+ result = evalAndLog("trans.objectStore('keyPathStore').index('numberIndex').openKeyCursor(keyRange)");
+ result.onsuccess = keyCursor;
+ result.onerror = unexpectedErrorCallback;
+ return;
+ }
+
+ shouldBe("event.result.key", "counter");
+ shouldBe("event.result.value.id", "counter");
+ shouldBe("event.result.value.number", (counter + 100).toString());
+ counter++;
+ evalAndLog("event.result.continue()");
+}
+
+function keyCursor()
+{
+ debug("keyCursor()");
+ if (event.result == null) {
+ shouldBe("counter", "5");
+ return;
+ }
+
+ shouldBe("event.result.key", "counter + 100");
+ shouldBe("event.result.value", "counter");
+
+ try {
+ debug("event.result.update({id: counter, number: counter + 200})");
+ event.result.update({id: counter, number: counter + 200});
+ testFailed("Expected exception.");
+ } catch (e) {
+ code = e.code;
+ shouldBe("code", "webkitIDBDatabaseException.NOT_ALLOWED_ERR");
+ }
+
+ counter++;
+ event.result.continue();
+}
+
+function transactionComplete()
+{
+ debug("transactionComplete()");
+ done();
+}
+
+var successfullyParsed = true;
+
+</script>
+</body>
+</html>
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 5ad01a9..03f44dc 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,32 @@
+2011-02-02 Hans Wennborg <hans at chromium.org>
+
+ Reviewed by Jeremy Orlow.
+
+ IndexedDB: Implement support for cursor updates
+ https://bugs.webkit.org/show_bug.cgi?id=53421
+
+ Implement support for cursor updates using the same pattern as cursor
+ deletes: forward the calls to the IDBObjectStoreBackend::put().
+ The put() function's signature needs to be changed to allow for a
+ "cursor update mode". This makes the signature more clear anyway,
+ since it replaces the boolean parameter.
+
+ Test: storage/indexeddb/cursor-update.html
+
+ * storage/IDBCursor.idl:
+ * storage/IDBCursorBackendImpl.cpp:
+ (WebCore::IDBCursorBackendImpl::key):
+ (WebCore::IDBCursorBackendImpl::update):
+ * storage/IDBCursorBackendImpl.h:
+ * storage/IDBObjectStore.cpp:
+ (WebCore::IDBObjectStore::add):
+ (WebCore::IDBObjectStore::put):
+ * storage/IDBObjectStoreBackendImpl.cpp:
+ (WebCore::IDBObjectStoreBackendImpl::put):
+ (WebCore::IDBObjectStoreBackendImpl::putInternal):
+ * storage/IDBObjectStoreBackendImpl.h:
+ * storage/IDBObjectStoreBackendInterface.h:
+
2011-02-02 Naoki Takano <takano.naoki at gmail.com>
Reviewed by Kent Tamura.
diff --git a/Source/WebCore/storage/IDBCursor.idl b/Source/WebCore/storage/IDBCursor.idl
index 12d0baf..2e1459f 100644
--- a/Source/WebCore/storage/IDBCursor.idl
+++ b/Source/WebCore/storage/IDBCursor.idl
@@ -37,9 +37,8 @@ module storage {
readonly attribute IDBKey key;
readonly attribute IDBAny value;
- // FIXME: Implement.
- //[CallWith=ScriptExecutionContext] IDBRequest update(in SerializedScriptValue value)
- // raises (IDBDatabaseException);
+ [CallWith=ScriptExecutionContext] IDBRequest update(in SerializedScriptValue value)
+ raises (IDBDatabaseException);
[ImplementationFunction=continueFunction] void continue(in [Optional] IDBKey key)
raises (IDBDatabaseException);
[CallWith=ScriptExecutionContext, ImplementationFunction=deleteFunction] IDBRequest delete()
diff --git a/Source/WebCore/storage/IDBCursorBackendImpl.cpp b/Source/WebCore/storage/IDBCursorBackendImpl.cpp
index 4135101..fcfcf3a 100644
--- a/Source/WebCore/storage/IDBCursorBackendImpl.cpp
+++ b/Source/WebCore/storage/IDBCursorBackendImpl.cpp
@@ -68,7 +68,6 @@ unsigned short IDBCursorBackendImpl::direction() const
PassRefPtr<IDBKey> IDBCursorBackendImpl::key() const
{
-
return m_currentKey;
}
@@ -79,43 +78,15 @@ PassRefPtr<IDBAny> IDBCursorBackendImpl::value() const
return IDBAny::create(m_currentIDBKeyValue.get());
}
-void IDBCursorBackendImpl::update(PassRefPtr<SerializedScriptValue> prpValue, PassRefPtr<IDBCallbacks> prpCallbacks, ExceptionCode& ec)
+void IDBCursorBackendImpl::update(PassRefPtr<SerializedScriptValue> value, PassRefPtr<IDBCallbacks> callbacks, ExceptionCode& ec)
{
- RefPtr<IDBCursorBackendImpl> cursor = this;
- RefPtr<SerializedScriptValue> value = prpValue;
- RefPtr<IDBCallbacks> callbacks = prpCallbacks;
- // FIXME: Throw DATA_ERR and SERIAL_ERR when appropriate.
- if (!m_transaction->scheduleTask(createCallbackTask(&IDBCursorBackendImpl::updateInternal, cursor, value, callbacks)))
+ if (!m_query || m_currentId == InvalidId || !m_isSerializedScriptValueCursor) {
ec = IDBDatabaseException::NOT_ALLOWED_ERR;
-}
-
-void IDBCursorBackendImpl::updateInternal(ScriptExecutionContext*, PassRefPtr<IDBCursorBackendImpl> cursor, PassRefPtr<SerializedScriptValue> prpValue, PassRefPtr<IDBCallbacks> callbacks)
-{
- // FIXME: This method doesn't update indexes. It's dangerous to call in its current state.
- callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Not implemented."));
- return;
-
- RefPtr<SerializedScriptValue> value = prpValue;
-
- if (!cursor->m_query || cursor->m_currentId == InvalidId) {
- // FIXME: Use the proper error code when it's specced.
- callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Operation not possible."));
return;
}
- String sql = "UPDATE ObjectStoreData SET value = ? WHERE id = ?";
- SQLiteStatement updateQuery(cursor->database(), sql);
-
- bool ok = updateQuery.prepare() == SQLResultOk;
- ASSERT_UNUSED(ok, ok); // FIXME: Better error handling.
- updateQuery.bindText(1, value->toWireString());
- updateQuery.bindInt64(2, cursor->m_currentId);
- ok = updateQuery.step() == SQLResultDone;
- ASSERT_UNUSED(ok, ok); // FIXME: Better error handling.
-
- if (cursor->m_isSerializedScriptValueCursor)
- cursor->m_currentSerializedScriptValue = value.release();
- callbacks->onSuccess(SerializedScriptValue::nullValue());
+ RefPtr<IDBKey> key = m_currentIDBKeyValue ? m_currentIDBKeyValue : m_currentKey;
+ m_objectStore->put(value, key.release(), IDBObjectStoreBackendInterface::CursorUpdate, callbacks, m_transaction.get(), ec);
}
void IDBCursorBackendImpl::continueFunction(PassRefPtr<IDBKey> prpKey, PassRefPtr<IDBCallbacks> prpCallbacks, ExceptionCode& ec)
diff --git a/Source/WebCore/storage/IDBCursorBackendImpl.h b/Source/WebCore/storage/IDBCursorBackendImpl.h
index e3a8995..919f153 100644
--- a/Source/WebCore/storage/IDBCursorBackendImpl.h
+++ b/Source/WebCore/storage/IDBCursorBackendImpl.h
@@ -68,7 +68,6 @@ private:
void loadCurrentRow();
SQLiteDatabase& database() const;
- static void updateInternal(ScriptExecutionContext*, PassRefPtr<IDBCursorBackendImpl>, PassRefPtr<SerializedScriptValue>, PassRefPtr<IDBCallbacks>);
static void continueFunctionInternal(ScriptExecutionContext*, PassRefPtr<IDBCursorBackendImpl>, PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>);
static const int64_t InvalidId = -1;
@@ -80,11 +79,15 @@ private:
OwnPtr<SQLiteStatement> m_query;
bool m_isSerializedScriptValueCursor;
int64_t m_currentId;
+
+ // The key in the objectStore or index that this cursor iterates over.
RefPtr<IDBKey> m_currentKey;
// m_isSerializedScriptValueCursor will only be available for object cursors.
RefPtr<SerializedScriptValue> m_currentSerializedScriptValue;
+
// FIXME: make the primary key available via script for all types of cursors.
+ // For cursors on indices, this is the key in the objectstore that corresponds to the current entry in the index.
RefPtr<IDBKey> m_currentIDBKeyValue;
RefPtr<IDBTransactionBackendInterface> m_transaction;
diff --git a/Source/WebCore/storage/IDBObjectStore.cpp b/Source/WebCore/storage/IDBObjectStore.cpp
index db33a4e..ac860a2 100644
--- a/Source/WebCore/storage/IDBObjectStore.cpp
+++ b/Source/WebCore/storage/IDBObjectStore.cpp
@@ -79,7 +79,7 @@ PassRefPtr<IDBRequest> IDBObjectStore::get(ScriptExecutionContext* context, Pass
PassRefPtr<IDBRequest> IDBObjectStore::add(ScriptExecutionContext* context, PassRefPtr<SerializedScriptValue> value, PassRefPtr<IDBKey> key, ExceptionCode& ec)
{
RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
- m_objectStore->put(value, key, true, request, m_transaction.get(), ec);
+ m_objectStore->put(value, key, IDBObjectStoreBackendInterface::AddOnly, request, m_transaction.get(), ec);
if (ec)
return 0;
return request;
@@ -88,7 +88,7 @@ PassRefPtr<IDBRequest> IDBObjectStore::add(ScriptExecutionContext* context, Pass
PassRefPtr<IDBRequest> IDBObjectStore::put(ScriptExecutionContext* context, PassRefPtr<SerializedScriptValue> value, PassRefPtr<IDBKey> key, ExceptionCode& ec)
{
RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
- m_objectStore->put(value, key, false, request, m_transaction.get(), ec);
+ m_objectStore->put(value, key, IDBObjectStoreBackendInterface::AddOrUpdate, request, m_transaction.get(), ec);
if (ec)
return 0;
return request;
diff --git a/Source/WebCore/storage/IDBObjectStoreBackendImpl.cpp b/Source/WebCore/storage/IDBObjectStoreBackendImpl.cpp
index ca47e64..213f5d0 100644
--- a/Source/WebCore/storage/IDBObjectStoreBackendImpl.cpp
+++ b/Source/WebCore/storage/IDBObjectStoreBackendImpl.cpp
@@ -179,7 +179,7 @@ static bool putIndexData(SQLiteDatabase& db, IDBKey* key, int64_t indexId, int64
return putQuery.step() == SQLResultDone;
}
-void IDBObjectStoreBackendImpl::put(PassRefPtr<SerializedScriptValue> prpValue, PassRefPtr<IDBKey> prpKey, bool addOnly, PassRefPtr<IDBCallbacks> prpCallbacks, IDBTransactionBackendInterface* transactionPtr, ExceptionCode& ec)
+void IDBObjectStoreBackendImpl::put(PassRefPtr<SerializedScriptValue> prpValue, PassRefPtr<IDBKey> prpKey, PutMode putMode, PassRefPtr<IDBCallbacks> prpCallbacks, IDBTransactionBackendInterface* transactionPtr, ExceptionCode& ec)
{
if (transactionPtr->mode() == IDBTransaction::READ_ONLY) {
ec = IDBDatabaseException::READ_ONLY_ERR;
@@ -193,26 +193,29 @@ void IDBObjectStoreBackendImpl::put(PassRefPtr<SerializedScriptValue> prpValue,
RefPtr<IDBTransactionBackendInterface> transaction = transactionPtr;
// FIXME: This should throw a SERIAL_ERR on structured clone problems.
// FIXME: This should throw a DATA_ERR when the wrong key/keyPath data is supplied.
- if (!transaction->scheduleTask(createCallbackTask(&IDBObjectStoreBackendImpl::putInternal, objectStore, value, key, addOnly, callbacks, transaction)))
+ if (!transaction->scheduleTask(createCallbackTask(&IDBObjectStoreBackendImpl::putInternal, objectStore, value, key, putMode, callbacks, transaction)))
ec = IDBDatabaseException::NOT_ALLOWED_ERR;
}
-void IDBObjectStoreBackendImpl::putInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<SerializedScriptValue> prpValue, PassRefPtr<IDBKey> prpKey, bool addOnly, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendInterface> transaction)
+void IDBObjectStoreBackendImpl::putInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl> objectStore, PassRefPtr<SerializedScriptValue> prpValue, PassRefPtr<IDBKey> prpKey, PutMode putMode, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<IDBTransactionBackendInterface> transaction)
{
RefPtr<SerializedScriptValue> value = prpValue;
RefPtr<IDBKey> key = prpKey;
- if (!objectStore->m_keyPath.isNull() && key) {
+ if (putMode == CursorUpdate)
+ ASSERT(key);
+
+ if (!objectStore->m_keyPath.isNull() && key && putMode != CursorUpdate) {
callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::DATA_ERR, "A key was supplied for an objectStore that has a keyPath."));
return;
}
- if (objectStore->autoIncrement() && key) {
+ if (objectStore->autoIncrement() && key && putMode != CursorUpdate) {
callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::DATA_ERR, "A key was supplied for an objectStore that is using auto increment."));
return;
}
- if (objectStore->autoIncrement()) {
+ if (objectStore->autoIncrement() && putMode != CursorUpdate) {
key = objectStore->genAutoIncrementKey();
if (!objectStore->m_keyPath.isNull()) {
@@ -221,12 +224,19 @@ void IDBObjectStoreBackendImpl::putInternal(ScriptExecutionContext*, PassRefPtr<
return;
}
} else if (!objectStore->m_keyPath.isNull()) {
- key = fetchKeyFromKeyPath(value.get(), objectStore->m_keyPath);
+ RefPtr<IDBKey> keyPathKey = fetchKeyFromKeyPath(value.get(), objectStore->m_keyPath);
- if (!key) {
+ if (!keyPathKey) {
callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::DATA_ERR, "The key could not be fetched from the keyPath."));
return;
}
+
+ if (putMode == CursorUpdate && !keyPathKey->isEqual(key.get())) {
+ callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::DATA_ERR, "The key fetched from the keyPath does not match the key of the cursor."));
+ return;
+ }
+
+ key = keyPathKey;
} else if (!key) {
callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::DATA_ERR, "No key supplied."));
return;
@@ -261,7 +271,7 @@ void IDBObjectStoreBackendImpl::putInternal(ScriptExecutionContext*, PassRefPtr<
bindWhereClause(getQuery, objectStore->id(), key.get());
bool isExistingValue = getQuery.step() == SQLResultRow;
- if (addOnly && isExistingValue) {
+ if (putMode == AddOnly && isExistingValue) {
callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::CONSTRAINT_ERR, "Key already exists in the object store."));
return;
}
diff --git a/Source/WebCore/storage/IDBObjectStoreBackendImpl.h b/Source/WebCore/storage/IDBObjectStoreBackendImpl.h
index 9fb1b7c..d51302f 100644
--- a/Source/WebCore/storage/IDBObjectStoreBackendImpl.h
+++ b/Source/WebCore/storage/IDBObjectStoreBackendImpl.h
@@ -67,7 +67,7 @@ public:
virtual bool autoIncrement() const { return m_autoIncrement; }
virtual void get(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&);
- virtual void put(PassRefPtr<SerializedScriptValue> value, PassRefPtr<IDBKey> key, bool addOnly, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&);
+ virtual void put(PassRefPtr<SerializedScriptValue>, PassRefPtr<IDBKey>, PutMode, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&);
virtual void deleteFunction(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&);
virtual PassRefPtr<IDBIndexBackendInterface> createIndex(const String& name, const String& keyPath, bool unique, IDBTransactionBackendInterface*, ExceptionCode&);
@@ -85,7 +85,7 @@ private:
PassRefPtr<IDBKey> genAutoIncrementKey();
static void getInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks>);
- static void putInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<SerializedScriptValue> value, PassRefPtr<IDBKey> key, bool addOnly, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBTransactionBackendInterface>);
+ static void putInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<SerializedScriptValue>, PassRefPtr<IDBKey>, PutMode, PassRefPtr<IDBCallbacks>, PassRefPtr<IDBTransactionBackendInterface>);
static void deleteInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks>);
static void createIndexInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBIndexBackendImpl>, PassRefPtr<IDBTransactionBackendInterface>);
static void deleteIndexInternal(ScriptExecutionContext*, PassRefPtr<IDBObjectStoreBackendImpl>, PassRefPtr<IDBIndexBackendImpl>, PassRefPtr<IDBTransactionBackendInterface>);
diff --git a/Source/WebCore/storage/IDBObjectStoreBackendInterface.h b/Source/WebCore/storage/IDBObjectStoreBackendInterface.h
index 02ceb27..fa28416 100644
--- a/Source/WebCore/storage/IDBObjectStoreBackendInterface.h
+++ b/Source/WebCore/storage/IDBObjectStoreBackendInterface.h
@@ -51,7 +51,13 @@ public:
virtual PassRefPtr<DOMStringList> indexNames() const = 0;
virtual void get(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&) = 0;
- virtual void put(PassRefPtr<SerializedScriptValue>, PassRefPtr<IDBKey>, bool addOnly, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&) = 0;
+
+ enum PutMode {
+ AddOrUpdate,
+ AddOnly,
+ CursorUpdate
+ };
+ virtual void put(PassRefPtr<SerializedScriptValue>, PassRefPtr<IDBKey>, PutMode, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&) = 0;
virtual void deleteFunction(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&) = 0;
virtual PassRefPtr<IDBIndexBackendInterface> createIndex(const String& name, const String& keyPath, bool unique, IDBTransactionBackendInterface*, ExceptionCode&) = 0;
@@ -66,4 +72,3 @@ public:
#endif
#endif // IDBObjectStoreBackendInterface_h
-
diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog
index 3f738cd..13a68df 100644
--- a/Source/WebKit/chromium/ChangeLog
+++ b/Source/WebKit/chromium/ChangeLog
@@ -1,3 +1,22 @@
+2011-02-02 Hans Wennborg <hans at chromium.org>
+
+ Reviewed by Jeremy Orlow.
+
+ IndexedDB: Implement support for cursor updates
+ https://bugs.webkit.org/show_bug.cgi?id=53421
+
+ Mirror the update to the IDBObjectStoreInterface::put() signature in
+ the WebKit layer wrappers.
+
+ * public/WebIDBObjectStore.h:
+ (WebKit::WebIDBObjectStore::put):
+ * src/IDBObjectStoreProxy.cpp:
+ (WebCore::IDBObjectStoreProxy::put):
+ * src/IDBObjectStoreProxy.h:
+ * src/WebIDBObjectStoreImpl.cpp:
+ (WebKit::WebIDBObjectStoreImpl::put):
+ * src/WebIDBObjectStoreImpl.h:
+
2011-02-02 Chris Evans <cevans at chromium.org>
Reviewed by Adam Barth.
diff --git a/Source/WebKit/chromium/public/WebIDBObjectStore.h b/Source/WebKit/chromium/public/WebIDBObjectStore.h
index 8f2247f..5b7fa99 100755
--- a/Source/WebKit/chromium/public/WebIDBObjectStore.h
+++ b/Source/WebKit/chromium/public/WebIDBObjectStore.h
@@ -60,7 +60,25 @@ public:
}
virtual void get(const WebIDBKey&, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&) { WEBKIT_ASSERT_NOT_REACHED(); }
- virtual void put(const WebSerializedScriptValue&, const WebIDBKey&, bool addOnly, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&) { WEBKIT_ASSERT_NOT_REACHED(); }
+
+ enum PutMode {
+ AddOrUpdate,
+ AddOnly,
+ CursorUpdate
+ };
+
+ // FIXME: Remove once Chromium side is updated to call the new put function.
+ virtual void put(const WebSerializedScriptValue& value, const WebIDBKey& key, bool addOnly, WebIDBCallbacks* callbacks, const WebIDBTransaction& transaction, WebExceptionCode& ec)
+ {
+ put(value, key, addOnly ? AddOnly : AddOrUpdate, callbacks, transaction, ec);
+ }
+
+ // FIXME: Assert not reached once Chromium side overrides this properly.
+ virtual void put(const WebSerializedScriptValue& value, const WebIDBKey& key, PutMode putMode, WebIDBCallbacks* callbacks, const WebIDBTransaction& transaction, WebExceptionCode& ec)
+ {
+ put(value, key, putMode == AddOnly, callbacks, transaction, ec);
+ }
+
virtual void deleteFunction(const WebIDBKey& key, WebIDBCallbacks* callbacks, const WebIDBTransaction& transaction, WebExceptionCode& ec) { WEBKIT_ASSERT_NOT_REACHED(); }
virtual WebIDBIndex* createIndex(const WebString& name, const WebString& keyPath, bool unique, const WebIDBTransaction&, WebExceptionCode&)
{
diff --git a/Source/WebKit/chromium/src/IDBObjectStoreProxy.cpp b/Source/WebKit/chromium/src/IDBObjectStoreProxy.cpp
index e03cdc8..c57fba6 100755
--- a/Source/WebKit/chromium/src/IDBObjectStoreProxy.cpp
+++ b/Source/WebKit/chromium/src/IDBObjectStoreProxy.cpp
@@ -80,12 +80,12 @@ void IDBObjectStoreProxy::get(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks> c
m_webIDBObjectStore->get(key, new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec);
}
-void IDBObjectStoreProxy::put(PassRefPtr<SerializedScriptValue> value, PassRefPtr<IDBKey> key, bool addOnly, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec)
+void IDBObjectStoreProxy::put(PassRefPtr<SerializedScriptValue> value, PassRefPtr<IDBKey> key, PutMode putMode, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec)
{
// The transaction pointer is guaranteed to be a pointer to a proxy object as, in the renderer,
// all implementations of IDB interfaces are proxy objects.
IDBTransactionBackendProxy* transactionProxy = static_cast<IDBTransactionBackendProxy*>(transaction);
- m_webIDBObjectStore->put(value, key, addOnly, new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec);
+ m_webIDBObjectStore->put(value, key, static_cast<WebKit::WebIDBObjectStore::PutMode>(putMode), new WebIDBCallbacksImpl(callbacks), *transactionProxy->getWebIDBTransaction(), ec);
}
void IDBObjectStoreProxy::deleteFunction(PassRefPtr<IDBKey> key, PassRefPtr<IDBCallbacks> callbacks, IDBTransactionBackendInterface* transaction, ExceptionCode& ec)
diff --git a/Source/WebKit/chromium/src/IDBObjectStoreProxy.h b/Source/WebKit/chromium/src/IDBObjectStoreProxy.h
index 348c794..498bc57 100755
--- a/Source/WebKit/chromium/src/IDBObjectStoreProxy.h
+++ b/Source/WebKit/chromium/src/IDBObjectStoreProxy.h
@@ -47,7 +47,7 @@ public:
virtual PassRefPtr<DOMStringList> indexNames() const;
virtual void get(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&);
- virtual void put(PassRefPtr<SerializedScriptValue>, PassRefPtr<IDBKey>, bool addOnly, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&);
+ virtual void put(PassRefPtr<SerializedScriptValue>, PassRefPtr<IDBKey>, PutMode, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&);
virtual void deleteFunction(PassRefPtr<IDBKey>, PassRefPtr<IDBCallbacks>, IDBTransactionBackendInterface*, ExceptionCode&);
PassRefPtr<IDBIndexBackendInterface> createIndex(const String& name, const String& keyPath, bool unique, IDBTransactionBackendInterface*, ExceptionCode&);
@@ -67,4 +67,3 @@ private:
#endif
#endif // IDBObjectStoreProxy_h
-
diff --git a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp
index 0503ede..498eb76 100755
--- a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp
+++ b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.cpp
@@ -71,9 +71,9 @@ void WebIDBObjectStoreImpl::get(const WebIDBKey& key, WebIDBCallbacks* callbacks
m_objectStore->get(key, IDBCallbacksProxy::create(callbacks), transaction.getIDBTransactionBackendInterface(), ec);
}
-void WebIDBObjectStoreImpl::put(const WebSerializedScriptValue& value, const WebIDBKey& key, bool addOnly, WebIDBCallbacks* callbacks, const WebIDBTransaction& transaction, WebExceptionCode& ec)
+void WebIDBObjectStoreImpl::put(const WebSerializedScriptValue& value, const WebIDBKey& key, PutMode putMode, WebIDBCallbacks* callbacks, const WebIDBTransaction& transaction, WebExceptionCode& ec)
{
- m_objectStore->put(value, key, addOnly, IDBCallbacksProxy::create(callbacks), transaction.getIDBTransactionBackendInterface(), ec);
+ m_objectStore->put(value, key, static_cast<IDBObjectStoreBackendInterface::PutMode>(putMode), IDBCallbacksProxy::create(callbacks), transaction.getIDBTransactionBackendInterface(), ec);
}
void WebIDBObjectStoreImpl::deleteFunction(const WebIDBKey& key, WebIDBCallbacks* callbacks, const WebIDBTransaction& transaction, WebExceptionCode& ec)
diff --git a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h
index f9cd776..7316f9a 100755
--- a/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h
+++ b/Source/WebKit/chromium/src/WebIDBObjectStoreImpl.h
@@ -48,7 +48,7 @@ public:
WebDOMStringList indexNames() const;
void get(const WebIDBKey& key, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&);
- void put(const WebSerializedScriptValue&, const WebIDBKey& key, bool addOnly, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&);
+ void put(const WebSerializedScriptValue&, const WebIDBKey&, PutMode, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&);
void deleteFunction(const WebIDBKey& key, WebIDBCallbacks*, const WebIDBTransaction&, WebExceptionCode&);
WebIDBIndex* createIndex(const WebString& name, const WebString& keyPath, bool unique, const WebIDBTransaction&, WebExceptionCode&);
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list