[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198
hans at chromium.org
hans at chromium.org
Sun Feb 20 23:24:14 UTC 2011
The following commit has been merged in the webkit-1.3 branch:
commit 60e43f0b360b15d5897747d1554ee9d8e8287b8b
Author: hans at chromium.org <hans at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Jan 20 09:39:44 2011 +0000
2011-01-20 Hans Wennborg <hans at chromium.org>
Reviewed by Jeremy Orlow.
IndexedDB: IDBObjectStore.get should fire onsuccess rather than onerror
https://bugs.webkit.org/show_bug.cgi?id=52725
Update layout tests to expect the onsuccess handler to be fired
when looking up non-existing objects.
* storage/indexeddb/create-and-remove-object-store-expected.txt:
* storage/indexeddb/create-and-remove-object-store.html:
* storage/indexeddb/cursor-delete-expected.txt:
* storage/indexeddb/cursor-delete.html:
* storage/indexeddb/objectstore-removeobjectstore-expected.txt:
* storage/indexeddb/objectstore-removeobjectstore.html:
2011-01-20 Hans Wennborg <hans at chromium.org>
Reviewed by Jeremy Orlow.
IndexedDB: IDBObjectStore.get should fire onsuccess rather than onerror
https://bugs.webkit.org/show_bug.cgi?id=52725
Let IDBObjectStore.get() fire the onsuccess handler with the value
'undefined' for when an object does not exist in the store.
Update SerializedScriptValue to provide such an undefined value.
* bindings/v8/SerializedScriptValue.cpp:
(WebCore::SerializedScriptValue::nullValue):
(WebCore::SerializedScriptValue::undefinedValue):
* bindings/v8/SerializedScriptValue.h:
* storage/IDBObjectStoreBackendImpl.cpp:
(WebCore::IDBObjectStoreBackendImpl::getInternal):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76217 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 263c9da..c60e69c 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,20 @@
+2011-01-20 Hans Wennborg <hans at chromium.org>
+
+ Reviewed by Jeremy Orlow.
+
+ IndexedDB: IDBObjectStore.get should fire onsuccess rather than onerror
+ https://bugs.webkit.org/show_bug.cgi?id=52725
+
+ Update layout tests to expect the onsuccess handler to be fired
+ when looking up non-existing objects.
+
+ * storage/indexeddb/create-and-remove-object-store-expected.txt:
+ * storage/indexeddb/create-and-remove-object-store.html:
+ * storage/indexeddb/cursor-delete-expected.txt:
+ * storage/indexeddb/cursor-delete.html:
+ * storage/indexeddb/objectstore-removeobjectstore-expected.txt:
+ * storage/indexeddb/objectstore-removeobjectstore.html:
+
2010-12-27 Yury Semikhatsky <yurys at chromium.org>
Reviewed by Pavel Feldman.
diff --git a/LayoutTests/storage/indexeddb/create-and-remove-object-store-expected.txt b/LayoutTests/storage/indexeddb/create-and-remove-object-store-expected.txt
index fd14c83..21f7d8d 100644
--- a/LayoutTests/storage/indexeddb/create-and-remove-object-store-expected.txt
+++ b/LayoutTests/storage/indexeddb/create-and-remove-object-store-expected.txt
@@ -50,6 +50,18 @@ Adding 'tmp' again
PASS code is webkitIDBDatabaseException.CONSTRAINT_ERR
trans = db.transaction({mode: webkitIDBTransaction.READ_WRITE})
trans.objectStore('tmp').get(0)
+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
+
+PASS event.result is undefined
Trying create
PASS code is webkitIDBDatabaseException.NOT_ALLOWED_ERR
Trying remove
diff --git a/LayoutTests/storage/indexeddb/create-and-remove-object-store.html b/LayoutTests/storage/indexeddb/create-and-remove-object-store.html
index c5284af..7bde468 100644
--- a/LayoutTests/storage/indexeddb/create-and-remove-object-store.html
+++ b/LayoutTests/storage/indexeddb/create-and-remove-object-store.html
@@ -76,12 +76,15 @@ function cleaned()
}
trans = evalAndLog("trans = db.transaction({mode: webkitIDBTransaction.READ_WRITE})");
req = evalAndLog("trans.objectStore('tmp').get(0)");
- req.onsuccess = unexpectedSuccessCallback;
- req.onerror = tryOnceMore;
+ req.onsuccess = tryOnceMore;
+ req.onerror = unexpectedErrorCallback;
}
function tryOnceMore()
{
+ verifySuccessEvent(event);
+ shouldBe("event.result", "undefined");
+
testCreateAndRemove();
done();
diff --git a/LayoutTests/storage/indexeddb/cursor-delete-expected.txt b/LayoutTests/storage/indexeddb/cursor-delete-expected.txt
index 8d1bba2..bed1d0d 100644
--- a/LayoutTests/storage/indexeddb/cursor-delete-expected.txt
+++ b/LayoutTests/storage/indexeddb/cursor-delete-expected.txt
@@ -115,10 +115,10 @@ PASS event.target.readyState is event.target.DONE
PASS [object IDBCursor] is non-null.
event.result.delete()
objectStore.get('myKey1')
-Error event fired:
-PASS 'result' in event is false
-PASS 'code' in event is true
-PASS 'message' in event is true
+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
@@ -126,6 +126,7 @@ PASS 'onerror' in event.target is true
PASS 'readyState' in event.target is true
PASS event.target.readyState is event.target.DONE
+PASS event.result is undefined
PASS successfullyParsed is true
TEST COMPLETE
diff --git a/LayoutTests/storage/indexeddb/cursor-delete.html b/LayoutTests/storage/indexeddb/cursor-delete.html
index 9e1ddc3..a3290b9 100644
--- a/LayoutTests/storage/indexeddb/cursor-delete.html
+++ b/LayoutTests/storage/indexeddb/cursor-delete.html
@@ -115,13 +115,14 @@ function deleteObject()
shouldBeNonNull(event.result);
evalAndLog("event.result.delete()");
result = evalAndLog("objectStore.get('myKey1')");
- result.onsuccess = unexpectedSuccessCallback;
- result.onerror = verifyObjectDeleted;
+ result.onsuccess = verifyObjectDeleted;
+ result.onerror = unexpectedErrorCallback;
}
function verifyObjectDeleted()
{
- verifyErrorEvent(event);
+ verifySuccessEvent(event);
+ shouldBe("event.result", "undefined");
done();
}
diff --git a/LayoutTests/storage/indexeddb/objectstore-removeobjectstore-expected.txt b/LayoutTests/storage/indexeddb/objectstore-removeobjectstore-expected.txt
index 37492db..45f0708 100644
--- a/LayoutTests/storage/indexeddb/objectstore-removeobjectstore-expected.txt
+++ b/LayoutTests/storage/indexeddb/objectstore-removeobjectstore-expected.txt
@@ -110,10 +110,10 @@ PASS 'onerror' in result is true
PASS 'readyState' in result is true
An event should fire shortly...
-Error event fired:
-PASS 'result' in event is false
-PASS 'code' in event is true
-PASS 'message' in event is true
+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
@@ -121,7 +121,7 @@ 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.NOT_FOUND_ERR
+PASS event.result is undefined
PASS event.source.indexNames.contains('indexName') is false
PASS successfullyParsed is true
diff --git a/LayoutTests/storage/indexeddb/objectstore-removeobjectstore.html b/LayoutTests/storage/indexeddb/objectstore-removeobjectstore.html
index a08f071..f9b1e78 100644
--- a/LayoutTests/storage/indexeddb/objectstore-removeobjectstore.html
+++ b/LayoutTests/storage/indexeddb/objectstore-removeobjectstore.html
@@ -105,14 +105,14 @@ function getValueAgain()
result = evalAndLog("store.get('key')");
verifyResult(result);
- result.onsuccess = unexpectedSuccessCallback;
- result.onerror = verifyError;
+ result.onsuccess = verifyNotFound;
+ result.onerror = unexpectedErrorCallback;
}
-function verifyError()
+function verifyNotFound()
{
- verifyErrorEvent(event);
- shouldBe("event.code", "webkitIDBDatabaseException.NOT_FOUND_ERR");
+ verifySuccessEvent(event);
+ shouldBe("event.result", "undefined");
shouldBeFalse("event.source.indexNames.contains('indexName')");
done();
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 3a06a2e..465cf43 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,22 @@
+2011-01-20 Hans Wennborg <hans at chromium.org>
+
+ Reviewed by Jeremy Orlow.
+
+ IndexedDB: IDBObjectStore.get should fire onsuccess rather than onerror
+ https://bugs.webkit.org/show_bug.cgi?id=52725
+
+ Let IDBObjectStore.get() fire the onsuccess handler with the value
+ 'undefined' for when an object does not exist in the store.
+
+ Update SerializedScriptValue to provide such an undefined value.
+
+ * bindings/v8/SerializedScriptValue.cpp:
+ (WebCore::SerializedScriptValue::nullValue):
+ (WebCore::SerializedScriptValue::undefinedValue):
+ * bindings/v8/SerializedScriptValue.h:
+ * storage/IDBObjectStoreBackendImpl.cpp:
+ (WebCore::IDBObjectStoreBackendImpl::getInternal):
+
2010-12-27 Yury Semikhatsky <yurys at chromium.org>
Reviewed by Pavel Feldman.
diff --git a/Source/WebCore/bindings/v8/SerializedScriptValue.cpp b/Source/WebCore/bindings/v8/SerializedScriptValue.cpp
index 6ac4a65..e050bfc 100644
--- a/Source/WebCore/bindings/v8/SerializedScriptValue.cpp
+++ b/Source/WebCore/bindings/v8/SerializedScriptValue.cpp
@@ -1129,12 +1129,18 @@ PassRefPtr<SerializedScriptValue> SerializedScriptValue::create()
return adoptRef(new SerializedScriptValue());
}
-SerializedScriptValue* SerializedScriptValue::nullValue()
+SerializedScriptValue* SerializedScriptValue::nullValue()
{
DEFINE_STATIC_LOCAL(RefPtr<SerializedScriptValue>, nullValue, (SerializedScriptValue::create()));
return nullValue.get();
}
+SerializedScriptValue* SerializedScriptValue::undefinedValue()
+{
+ DEFINE_STATIC_LOCAL(RefPtr<SerializedScriptValue>, undefinedValue, (SerializedScriptValue::create(v8::Undefined())));
+ return undefinedValue.get();
+}
+
PassRefPtr<SerializedScriptValue> SerializedScriptValue::release()
{
RefPtr<SerializedScriptValue> result = adoptRef(new SerializedScriptValue(m_data, WireData));
diff --git a/Source/WebCore/bindings/v8/SerializedScriptValue.h b/Source/WebCore/bindings/v8/SerializedScriptValue.h
index b534a57..ead9511 100644
--- a/Source/WebCore/bindings/v8/SerializedScriptValue.h
+++ b/Source/WebCore/bindings/v8/SerializedScriptValue.h
@@ -52,8 +52,9 @@ public:
static PassRefPtr<SerializedScriptValue> createFromWire(String data);
static PassRefPtr<SerializedScriptValue> create(String data);
static PassRefPtr<SerializedScriptValue> create();
-
- static SerializedScriptValue* nullValue();
+
+ static SerializedScriptValue* nullValue();
+ static SerializedScriptValue* undefinedValue();
PassRefPtr<SerializedScriptValue> release();
diff --git a/Source/WebCore/storage/IDBObjectStoreBackendImpl.cpp b/Source/WebCore/storage/IDBObjectStoreBackendImpl.cpp
index 240ea8a..6b162ef 100644
--- a/Source/WebCore/storage/IDBObjectStoreBackendImpl.cpp
+++ b/Source/WebCore/storage/IDBObjectStoreBackendImpl.cpp
@@ -110,7 +110,7 @@ void IDBObjectStoreBackendImpl::getInternal(ScriptExecutionContext*, PassRefPtr<
bindWhereClause(query, objectStore->id(), key.get());
if (query.step() != SQLResultRow) {
- callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::NOT_FOUND_ERR, "Key does not exist in the object store."));
+ callbacks->onSuccess(SerializedScriptValue::undefinedValue());
return;
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list