Title: [97450] trunk
Revision
97450
Author
[email protected]
Date
2011-10-14 01:34:05 -0700 (Fri, 14 Oct 2011)

Log Message

IndexedDB: Make IDBCursor.value() return an IDBAny object
https://bugs.webkit.org/show_bug.cgi?id=70024

Reviewed by Tony Chang.

Source/WebCore:

This is to work around the fact that the V8 bindings mechanism does
eager deserialization of SerializedScriptValue attributes. This means
that the value is fetched from the back-end only once, when the
IDBCursor is first wrapped. When the cursor's value changes, this is
not reflected.

We work around this by making IDBCursor.value() return the
SerializedScriptValue wrapped in an IDBAny object.

* storage/IDBCursor.cpp:
(WebCore::IDBCursor::value):
* storage/IDBCursor.h:
* storage/IDBCursorWithValue.idl:

LayoutTests:

Update test expectations since more of this test now passes.

* storage/indexeddb/cursor-inconsistency-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (97449 => 97450)


--- trunk/LayoutTests/ChangeLog	2011-10-14 08:12:59 UTC (rev 97449)
+++ trunk/LayoutTests/ChangeLog	2011-10-14 08:34:05 UTC (rev 97450)
@@ -1,3 +1,14 @@
+2011-10-13  Hans Wennborg  <[email protected]>
+
+        IndexedDB: Make IDBCursor.value() return an IDBAny object
+        https://bugs.webkit.org/show_bug.cgi?id=70024
+
+        Reviewed by Tony Chang.
+
+        Update test expectations since more of this test now passes.
+
+        * storage/indexeddb/cursor-inconsistency-expected.txt:
+
 2011-10-13  Andrew Scherkus  <[email protected]>
 
         Unreviewed, updating Chromium expectations for http/tests/media/video-play-stall.html.

Modified: trunk/LayoutTests/storage/indexeddb/cursor-inconsistency-expected.txt (97449 => 97450)


--- trunk/LayoutTests/storage/indexeddb/cursor-inconsistency-expected.txt	2011-10-14 08:12:59 UTC (rev 97449)
+++ trunk/LayoutTests/storage/indexeddb/cursor-inconsistency-expected.txt	2011-10-14 08:34:05 UTC (rev 97450)
@@ -33,7 +33,7 @@
 FAIL storedCursor === event.target.result should be true. Was false.
 PASS storedCursor.key is "someKey2"
 PASS event.target.result.key is "someKey2"
-FAIL storedCursor.value should be someValue2. Was someValue1.
+PASS storedCursor.value is "someValue2"
 PASS event.target.result.value is "someValue2"
 event.target.result.continue()
 
@@ -41,7 +41,7 @@
 FAIL storedCursor === event.target.result should be true. Was false.
 PASS storedCursor.key is "someKey3"
 PASS event.target.result.key is "someKey3"
-FAIL storedCursor.value should be someValue3. Was someValue1.
+PASS storedCursor.value is "someValue3"
 PASS event.target.result.value is "someValue3"
 event.target.result.continue()
 
@@ -49,7 +49,7 @@
 FAIL storedCursor === event.target.result should be true. Was false.
 PASS storedCursor.key is "someKey4"
 PASS event.target.result.key is "someKey4"
-FAIL storedCursor.value should be someValue4. Was someValue1.
+PASS storedCursor.value is "someValue4"
 PASS event.target.result.value is "someValue4"
 event.target.result.continue()
 

Modified: trunk/Source/WebCore/ChangeLog (97449 => 97450)


--- trunk/Source/WebCore/ChangeLog	2011-10-14 08:12:59 UTC (rev 97449)
+++ trunk/Source/WebCore/ChangeLog	2011-10-14 08:34:05 UTC (rev 97450)
@@ -1,3 +1,24 @@
+2011-10-13  Hans Wennborg  <[email protected]>
+
+        IndexedDB: Make IDBCursor.value() return an IDBAny object
+        https://bugs.webkit.org/show_bug.cgi?id=70024
+
+        Reviewed by Tony Chang.
+
+        This is to work around the fact that the V8 bindings mechanism does
+        eager deserialization of SerializedScriptValue attributes. This means
+        that the value is fetched from the back-end only once, when the
+        IDBCursor is first wrapped. When the cursor's value changes, this is
+        not reflected.
+
+        We work around this by making IDBCursor.value() return the
+        SerializedScriptValue wrapped in an IDBAny object.
+
+        * storage/IDBCursor.cpp:
+        (WebCore::IDBCursor::value):
+        * storage/IDBCursor.h:
+        * storage/IDBCursorWithValue.idl:
+
 2011-10-14  RĂ©mi Duraffort  <[email protected]>
 
         Fix compilation when the JS Debugger is disabled.

Modified: trunk/Source/WebCore/storage/IDBCursor.cpp (97449 => 97450)


--- trunk/Source/WebCore/storage/IDBCursor.cpp	2011-10-14 08:12:59 UTC (rev 97449)
+++ trunk/Source/WebCore/storage/IDBCursor.cpp	2011-10-14 08:34:05 UTC (rev 97450)
@@ -75,9 +75,9 @@
     return m_backend->primaryKey();
 }
 
-PassRefPtr<SerializedScriptValue> IDBCursor::value() const
+PassRefPtr<IDBAny> IDBCursor::value() const
 {
-    return m_backend->value();
+    return IDBAny::create(m_backend->value());
 }
 
 IDBAny* IDBCursor::source() const

Modified: trunk/Source/WebCore/storage/IDBCursor.h (97449 => 97450)


--- trunk/Source/WebCore/storage/IDBCursor.h	2011-10-14 08:12:59 UTC (rev 97449)
+++ trunk/Source/WebCore/storage/IDBCursor.h	2011-10-14 08:34:05 UTC (rev 97450)
@@ -62,7 +62,7 @@
     unsigned short direction() const;
     PassRefPtr<IDBKey> key() const;
     PassRefPtr<IDBKey> primaryKey() const;
-    PassRefPtr<SerializedScriptValue> value() const;
+    PassRefPtr<IDBAny> value() const;
     IDBAny* source() const;
 
     PassRefPtr<IDBRequest> update(ScriptExecutionContext*, PassRefPtr<SerializedScriptValue>, ExceptionCode&);

Modified: trunk/Source/WebCore/storage/IDBCursorWithValue.idl (97449 => 97450)


--- trunk/Source/WebCore/storage/IDBCursorWithValue.idl	2011-10-14 08:12:59 UTC (rev 97449)
+++ trunk/Source/WebCore/storage/IDBCursorWithValue.idl	2011-10-14 08:34:05 UTC (rev 97450)
@@ -28,6 +28,6 @@
     interface [
         Conditional=INDEXED_DATABASE
     ] IDBCursorWithValue : IDBCursor {
-        readonly attribute SerializedScriptValue value;
+        readonly attribute IDBAny value;
     };
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to