<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>69131</bug_id>
          
          <creation_ts>2011-09-29 23:58:24 -0700</creation_ts>
          <short_desc>Return null for the value of IDB key cursors</short_desc>
          <delta_ts>2011-10-06 16:57:22 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>New Bugs</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="David Grogan">dgrogan</reporter>
          <assigned_to name="David Grogan">dgrogan</assigned_to>
          <cc>hans</cc>
    
    <cc>michaeln</cc>
    
    <cc>tony</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>475936</commentid>
    <comment_count>0</comment_count>
    <who name="David Grogan">dgrogan</who>
    <bug_when>2011-09-29 23:58:24 -0700</bug_when>
    <thetext>Return null for the value of IDB key cursors</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>475941</commentid>
    <comment_count>1</comment_count>
      <attachid>109259</attachid>
    <who name="David Grogan">dgrogan</who>
    <bug_when>2011-09-30 00:00:54 -0700</bug_when>
    <thetext>Created attachment 109259
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>475947</commentid>
    <comment_count>2</comment_count>
    <who name="David Grogan">dgrogan</who>
    <bug_when>2011-09-30 00:04:51 -0700</bug_when>
    <thetext>This is the webkit patch in support of http://codereview.chromium.org/7834006

Michael and/or Hans, could you take a look?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>476874</commentid>
    <comment_count>3</comment_count>
      <attachid>109259</attachid>
    <who name="Hans Wennborg">hans</who>
    <bug_when>2011-10-03 04:00:35 -0700</bug_when>
    <thetext>Comment on attachment 109259
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=109259&amp;action=review

&gt; Source/WebCore/storage/IDBCursorBackendImpl.cpp:-76
&gt; -    ASSERT(m_cursorType != IndexKeyCursor);

i&apos;m not sure I&apos;m following... if the cursor is an IndexKeyCursor, this shouldn&apos;t be called, because such cursors don&apos;t have a value</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>477036</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Nordman">michaeln</who>
    <bug_when>2011-10-03 09:40:11 -0700</bug_when>
    <thetext>lgtm (fwiw)

You have to look at the chrome CL to fully understand this webkit patch. When a cursor is created or stepped, the value is retrieved and sent to the renderer w/o regard for the cursorType. The branch to return null for IndexKeyCursor type has to be somewhere. IDBCursorBackendImpl.cpp is a fine place for that branch.

http://codereview.chromium.org/7834006/diff/13001/content/browser/in_process_webkit/indexed_db_callbacks.cc

+  dispatcher_host()-&gt;Send(new IndexedDBMsg_CallbacksSuccessIDBCursor(
+      response_id(), object_id, IndexedDBKey(idb_object-&gt;key()),
+      IndexedDBKey(idb_object-&gt;primaryKey()),
+      SerializedScriptValue(idb_object-&gt;value())));


Notice there is no &apos;type&apos; getter on WebIDBCursor. In the current design (where chrome doesn&apos;t have much insight into these datatypes) there doesn&apos;t need to be.

class WebIDBCursor {
public:
    virtual ~WebIDBCursor() { }

    virtual unsigned short direction() const
    {
        WEBKIT_ASSERT_NOT_REACHED();
        return 0;
    }
    virtual WebIDBKey key() const
    {
        WEBKIT_ASSERT_NOT_REACHED();
        return WebIDBKey::createInvalid();
    }
    virtual WebIDBKey primaryKey() const
    {
        WEBKIT_ASSERT_NOT_REACHED();
        return WebIDBKey::createInvalid();
    }
    virtual WebSerializedScriptValue value() const
    {
        WEBKIT_ASSERT_NOT_REACHED();
        return WebSerializedScriptValue();
    }

    virtual void update(const WebSerializedScriptValue&amp;, WebIDBCallbacks*, WebExceptionCode&amp;) { WEBKIT_ASSERT_NOT_REACHED(); }
    virtual void continueFunction(const WebIDBKey&amp;, WebIDBCallbacks*, WebExceptionCode&amp;) { WEBKIT_ASSERT_NOT_REACHED(); }
    virtual void deleteFunction(WebIDBCallbacks* callbacks, WebExceptionCode&amp; ec) { WEBKIT_ASSERT_NOT_REACHED(); }

protected:
    WebIDBCursor() { }
};</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>477224</commentid>
    <comment_count>5</comment_count>
    <who name="David Grogan">dgrogan</who>
    <bug_when>2011-10-03 13:55:39 -0700</bug_when>
    <thetext>Tony, could you review this two-line patch?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>478671</commentid>
    <comment_count>6</comment_count>
    <who name="David Grogan">dgrogan</who>
    <bug_when>2011-10-05 14:09:26 -0700</bug_when>
    <thetext>ping tc

Sorry for the flood of IDB patches lately.  Let me/us know if you need a break from them.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>478675</commentid>
    <comment_count>7</comment_count>
      <attachid>109259</attachid>
    <who name="Tony Chang">tony</who>
    <bug_when>2011-10-05 14:12:38 -0700</bug_when>
    <thetext>Comment on attachment 109259
Patch

Can we add a layout test for this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>479529</commentid>
    <comment_count>8</comment_count>
    <who name="David Grogan">dgrogan</who>
    <bug_when>2011-10-06 14:58:53 -0700</bug_when>
    <thetext>(In reply to comment #7)
&gt; (From update of attachment 109259 [details])
&gt; Can we add a layout test for this?

I don&apos;t think so.  DRT won&apos;t be able to exercise this code path - there&apos;s no javascript API to get the value of a key cursor.  It&apos;s only called by WebIDBCursorImpl (which is called by IndexedDBCallbacks in content/browser/in_process_webkit/indexed_db_callbacks.cc)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>479630</commentid>
    <comment_count>9</comment_count>
      <attachid>109259</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-10-06 16:57:18 -0700</bug_when>
    <thetext>Comment on attachment 109259
Patch

Clearing flags on attachment: 109259

Committed r96877: &lt;http://trac.webkit.org/changeset/96877&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>479631</commentid>
    <comment_count>10</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-10-06 16:57:22 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>109259</attachid>
            <date>2011-09-30 00:00:54 -0700</date>
            <delta_ts>2011-10-06 16:57:18 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-69131-20110930000053.patch</filename>
            <type>text/plain</type>
            <size>1528</size>
            <attacher name="David Grogan">dgrogan</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogOTYzNzgKZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJDb3JlL0No
YW5nZUxvZyBiL1NvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwppbmRleCBmNjUxNTUxYTBjNjVkZWIx
ZGE2NGJmOGNkMDRlZWZiMzA1Nzk2YTkwLi4yMTY1YmYyMjJjNTE4ZWEzN2M5OGM5ZTIxODNlNjhl
N2E1NDU2ODkyIDEwMDY0NAotLS0gYS9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKKysrIGIvU291
cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTYgQEAKKzIwMTEtMDktMjkgIERhdmlk
IEdyb2dhbiAgPGRncm9nYW5AY2hyb21pdW0ub3JnPgorCisg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