<?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>88287</bug_id>
          
          <creation_ts>2012-06-04 20:54:41 -0700</creation_ts>
          <short_desc>JSC: need to implement IDBKeyPathBackendImpl to make indexedDB for JSC.</short_desc>
          <delta_ts>2013-01-04 00:47:50 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore JavaScript</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>96614</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>94023</dependson>
    
    <dependson>95409</dependson>
          <blocked>45110</blocked>
    
    <blocked>92828</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Charles Wei">charles.wei</reporter>
          <assigned_to name="Charles Wei">charles.wei</assigned_to>
          <cc>abarth</cc>
    
    <cc>alecflett</cc>
    
    <cc>cdumez</cc>
    
    <cc>dglazkov</cc>
    
    <cc>donggwan.kim</cc>
    
    <cc>efidler</cc>
    
    <cc>ggaren</cc>
    
    <cc>haraken</cc>
    
    <cc>jiyeon0402.kim</cc>
    
    <cc>jochen</cc>
    
    <cc>jorlow</cc>
    
    <cc>jrogers</cc>
    
    <cc>jsbell</cc>
    
    <cc>leo.yang</cc>
    
    <cc>oliver</cc>
    
    <cc>rwlbuis</cc>
    
    <cc>s.choi</cc>
    
    <cc>staikos</cc>
    
    <cc>tonikitoo</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>641157</commentid>
    <comment_count>0</comment_count>
    <who name="Charles Wei">charles.wei</who>
    <bug_when>2012-06-04 20:54:41 -0700</bug_when>
    <thetext>Need to implement IDBKeyPathBackendImpl::createIDBKeysFromSerializedValuesAndKeyPath(), IDBKeyPathBackendImpl::injectIDBKeyIntoSerializedValue() for JSC binding.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>652240</commentid>
    <comment_count>1</comment_count>
      <attachid>148289</attachid>
    <who name="Charles Wei">charles.wei</who>
    <bug_when>2012-06-19 02:09:50 -0700</bug_when>
    <thetext>Created attachment 148289
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>652261</commentid>
    <comment_count>2</comment_count>
      <attachid>148289</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2012-06-19 02:33:19 -0700</bug_when>
    <thetext>Comment on attachment 148289
Patch

Attachment 148289 did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/12974686</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>652357</commentid>
    <comment_count>3</comment_count>
      <attachid>148289</attachid>
    <who name="Charles Wei">charles.wei</who>
    <bug_when>2012-06-19 06:02:57 -0700</bug_when>
    <thetext>Comment on attachment 148289
Patch

Sorry,  my local repository is a bit out of date. I will rebase to the latest code and will submit a new patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>652364</commentid>
    <comment_count>4</comment_count>
      <attachid>148320</attachid>
    <who name="Charles Wei">charles.wei</who>
    <bug_when>2012-06-19 06:15:26 -0700</bug_when>
    <thetext>Created attachment 148320
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>652502</commentid>
    <comment_count>5</comment_count>
      <attachid>148320</attachid>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2012-06-19 08:59:13 -0700</bug_when>
    <thetext>Comment on attachment 148320
Patch

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

&gt; Source/WebCore/bindings/js/IDBBindingUtilities.cpp:43
&gt; +        m_context = JSGlobalContextCreate(0);

Just an aside, context creation ended up being expensive in V8 so we recycle a utility context across the IDBKey create/inject calls. Not urgent, but you may want to profile to see if that&apos;ll be a performance issue for JSC.

&gt; Source/WebCore/bindings/js/IDBBindingUtilities.cpp:74
&gt; +void createIDBKeysFromSerializedScriptValuesAndKeyPath(const Vector&lt;RefPtr&lt;SerializedScriptValue&gt;, 0&gt;&amp; values, const IDBKeyPath&amp; keyPath, Vector&lt;RefPtr&lt;IDBKey&gt;, 0&gt;&amp; keys)

You may have noticed the multiple values/multiple keys. I don&apos;t think that functionality of the API is being used at the moment, but we may start to. In the Chromium port this is often run in a different process, and for bulk operations (like creating an index with an already populated store) we will want to avoid the IPC overhead when iterating over the entire store, so we could use this to compute the index keys in batches.

Basically, there&apos;s a lot of cleanup work to do. :) Keep these patches coming, it&apos;s awesome.

&gt; Source/WebCore/bindings/js/IDBBindingUtilities.cpp:118
&gt; +        // FIXME: we might need to support ArrayType

The only key type that injectXXX() needs to support is NumberType (as a result of using a key generator and key path). You can safely ASSERT on that; we should be able to simplify the V8 version too. Support for other types in this API probably dates from earlier versions of the spec.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>652575</commentid>
    <comment_count>6</comment_count>
      <attachid>148320</attachid>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2012-06-19 10:37:15 -0700</bug_when>
    <thetext>Comment on attachment 148320
Patch

You shouldn&apos;t be using a temporary context --  why are we serializing to one form when we want another?  Alternatively why are we deserializing?

If it&apos;s absolutely critical we should either add logic to deserialize directly to IDB types, or not be serializing to an unrelated format in the first place.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>653132</commentid>
    <comment_count>7</comment_count>
    <who name="Charles Wei">charles.wei</who>
    <bug_when>2012-06-19 20:26:16 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; (From update of attachment 148320 [details])
&gt; You shouldn&apos;t be using a temporary context --  why are we serializing to one form when we want another?  Alternatively why are we deserializing?
&gt; 
&gt; If it&apos;s absolutely critical we should either add logic to deserialize directly to IDB types, or not be serializing to an unrelated format in the first place.

Oliver:  thanks for the comments.

Let me explain why this design -- using a temporary context to deserialize the SerializedScriptValue to JSValue.

1. For IndexedDB, we need to access a certain property of an object before putting to the database or after we read from the database. We need to do that again the SerializedScriptValue. If you doubt the justification of this, the existing code in Modules/indexeddb is expecting for that.  

2. To do that , there are multiple-ways.  

     2.1  -- directly parsing and manipulating the SerializedScriptValue, to get property of the object, or to inject a new property and value to the object.

    Theoratically this is possible,  but a) It&apos;s a lot of coding; b) we need to invent another data structure to represent the object; c) we are not re-using the JSValue (JSObject) and the serialization/deserialization code between JS &lt;==&gt; SerializedScriptValue.

    2.2  --  SerializedScriptValue is just a string representation of an JSObject for cross-boder passing (cross-process, persistence, etc.), it&apos;s not good at object property accessing.   But it can be easily converted to/from an JSValue/JSObject, which has very easy way to manipulate the object properties. So it&apos;s good to deserialize it to a temporary JSValue/JSObject for property manipulation and then convert back to a SerializedScriptValue.

        To deserialize the SerializedScriptValue to JSValue,  we need an Javascript Context.  There are 2 ways to get an Javascript Context:
 
        2.2.1  --- Re-using the JavaScriptContext that initialized the indexedDB operation.  This not only requires a lot of code change to pass the JavaScript Context from class to class, object to object, function to function ( please have a look at bug: 45110, most of which is trying to do this JavaScript Context passing ),  but also not work well because it&apos;s shared code between JSC and V8 porting, while V8 porting is not using them at all and the change might break Chromium/V8.

        2.2.2  ---  Create an temporary JavaScript Context,  same as V8, which also creates a temporary JavaScript Context for this.  This makes little code change, the code looks cleaner and easier to maintain.
 

2.2.2 is now the approach this patch is pursuing.

Oliver:  what negative impacts do you see with a temporary JavaScript Context except potential performance hits pointed out at comment #5, which I am going to make the temporary JavaScript context recyclable among IndexedDB operations?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>653255</commentid>
    <comment_count>8</comment_count>
      <attachid>148516</attachid>
    <who name="Charles Wei">charles.wei</who>
    <bug_when>2012-06-20 00:05:30 -0700</bug_when>
    <thetext>Created attachment 148516
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>653545</commentid>
    <comment_count>9</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2012-06-20 09:25:13 -0700</bug_when>
    <thetext>(In reply to comment #7)
&gt; (In reply to comment #6)
&gt; &gt; (From update of attachment 148320 [details] [details])
&gt; &gt; You shouldn&apos;t be using a temporary context --  why are we serializing to one form when we want another?  Alternatively why are we deserializing?
&gt; &gt; 
&gt; &gt; If it&apos;s absolutely critical we should either add logic to deserialize directly to IDB types, or not be serializing to an unrelated format in the first place.
&gt; 
&gt; Oliver:  thanks for the comments.
&gt; 
&gt; Let me explain why this design -- using a temporary context to deserialize the SerializedScriptValue to JSValue.
&gt; 
&gt; 1. For IndexedDB, we need to access a certain property of an object before putting to the database or after we read from the database. We need to do that again the SerializedScriptValue. If you doubt the justification of this, the existing code in Modules/indexeddb is expecting for that.  
&gt;
Can you clarify this?  What property are you trying to access?  Why can&apos;t you just access it off of the unserialised object? serialising and then deserialising an entire object just to access a single property could be horrendously painful, so why aren&apos;t we just reading off the deserialised object (on read) or the unserialised object (for writes)?

That&apos;s what is confusing me.

I agree whole heartedly that you don&apos;t want to try and do individual property reads from the serialised form.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>654119</commentid>
    <comment_count>10</comment_count>
    <who name="Charles Wei">charles.wei</who>
    <bug_when>2012-06-20 18:41:36 -0700</bug_when>
    <thetext>
&gt; &gt; 
&gt; &gt; 1. For IndexedDB, we need to access a certain property of an object before putting to the database or after we read from the database. We need to do that again the SerializedScriptValue. If you doubt the justification of this, the existing code in Modules/indexeddb is expecting for that.  
&gt; &gt;
&gt; Can you clarify this?  What property are you trying to access?  Why can&apos;t you just access it off of the unserialised object? serialising and then deserialising an entire object just to access a single property could be horrendously painful, so why aren&apos;t we just reading off the deserialised object (on read) or the unserialised object (for writes)?
&gt; 
&gt; That&apos;s what is confusing me.
&gt; 
&gt; I agree whole heartedly that you don&apos;t want to try and do individual property reads from the serialised form.


Oliver:  The IDBObjectStore.idl definition explains this:

      interface IDBObjectStore {
 
        readonly attribute [TreatReturnedNullStringAs=Null] DOMString keyPath;

        [CallWith=ScriptExecutionContext] IDBRequest put(in SerializedScriptValue value, in [Optional] IDBKey key)   raises (IDBDatabaseException);
        [CallWith=ScriptExecutionContext] IDBRequest add(in SerializedScriptValue value, in [Optional] IDBKey key)  raises (IDBDatabaseException);
        ......
      };

From which you can see,  the put() and add() methods ( put or add a record to the indexedDB)  are taking SerializedScriptValue as inputs, that means, the JSValue will be automatically converted to the native SerializeScriptValue,  and all following operations (putting to the database) are operated against this SerializedScriptValue.   Before putting to the database,  we might need to get the key from the SerializedScriptValue, the key is the property indicated by the keyPath of the object.  That&apos;s why we need to access the property of an object in SerializedScriptValue format.

Joshua Bell might be able to give a more convincible explanation since they designed the IndexedDB initially for V8.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>654197</commentid>
    <comment_count>11</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2012-06-20 20:41:59 -0700</bug_when>
    <thetext>(In reply to comment #10)
&gt; &gt; &gt; 
&gt; &gt; &gt; 1. For IndexedDB, we need to access a certain property of an object before putting to the database or after we read from the database. We need to do that again the SerializedScriptValue. If you doubt the justification of this, the existing code in Modules/indexeddb is expecting for that.  
&gt; &gt; &gt;
&gt; &gt; Can you clarify this?  What property are you trying to access?  Why can&apos;t you just access it off of the unserialised object? serialising and then deserialising an entire object just to access a single property could be horrendously painful, so why aren&apos;t we just reading off the deserialised object (on read) or the unserialised object (for writes)?
&gt; &gt; 
&gt; &gt; That&apos;s what is confusing me.
&gt; &gt; 
&gt; &gt; I agree whole heartedly that you don&apos;t want to try and do individual property reads from the serialised form.
&gt; 
&gt; 
&gt; Oliver:  The IDBObjectStore.idl definition explains this:
&gt; 
&gt;       interface IDBObjectStore {
&gt; 
&gt;         readonly attribute [TreatReturnedNullStringAs=Null] DOMString keyPath;
&gt; 
&gt;         [CallWith=ScriptExecutionContext] IDBRequest put(in SerializedScriptValue value, in [Optional] IDBKey key)   raises (IDBDatabaseException);
&gt;         [CallWith=ScriptExecutionContext] IDBRequest add(in SerializedScriptValue value, in [Optional] IDBKey key)  raises (IDBDatabaseException);
&gt;         ......
&gt;       };
&gt; 
&gt; From which you can see,  the put() and add() methods ( put or add a record to the indexedDB)  are taking SerializedScriptValue as inputs, that means, the JSValue will be automatically converted to the native SerializeScriptValue,  and all following operations (putting to the database) are operated against this SerializedScriptValue.   Before putting to the database,  we might need to get the key from the SerializedScriptValue, the key is the property indicated by the keyPath of the object.  That&apos;s why we need to access the property of an object in SerializedScriptValue format.
&gt; 
&gt; Joshua Bell might be able to give a more convincible explanation since they designed the IndexedDB initially for V8.

I think a better interface would be to take any rather than serialized value.

IIRC that should give you a ScriptValue.

You can then introspect the ScriptValue (ask for properties, etc) without the need for the [de]serialise shenanigans, and only serialise once you go to store the value.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>654206</commentid>
    <comment_count>12</comment_count>
    <who name="Charles Wei">charles.wei</who>
    <bug_when>2012-06-20 21:01:29 -0700</bug_when>
    <thetext>.
&gt; 
&gt; I think a better interface would be to take any rather than serialized value.
&gt; 
&gt; IIRC that should give you a ScriptValue.
&gt; 
&gt; You can then introspect the ScriptValue (ask for properties, etc) without the need for the [de]serialise shenanigans, and only serialise once you go to store the value.

That seems a fundamental Change,and  requires almost re-write of Modules/indexeddb,  which is centered around SerializedScriptValue instead of ScriptValue.  Further,  will replace SerialiedScriptValue with ScriptValue will make things better ?  Can we easily access attributes of a ScriptValue object without converting to/from JSValue ?  

I am looking at Chromium guys who initially implemented indexeddb for v8 binding. We need a consensus on this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>654209</commentid>
    <comment_count>13</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2012-06-20 21:09:40 -0700</bug_when>
    <thetext>(In reply to comment #12)
&gt; .
&gt; &gt; 
&gt; &gt; I think a better interface would be to take any rather than serialized value.
&gt; &gt; 
&gt; &gt; IIRC that should give you a ScriptValue.
&gt; &gt; 
&gt; &gt; You can then introspect the ScriptValue (ask for properties, etc) without the need for the [de]serialise shenanigans, and only serialise once you go to store the value.
&gt; 
&gt; That seems a fundamental Change,and  requires almost re-write of Modules/indexeddb,  which is centered around SerializedScriptValue instead of ScriptValue.  Further,  will replace SerialiedScriptValue with ScriptValue will make things better ?  Can we easily access attributes of a ScriptValue object without converting to/from JSValue ?  
&gt; 
&gt; I am looking at Chromium guys who initially implemented indexeddb for v8 binding. We need a consensus on this.

ScriptValue (and ScriptObject) are WebCore&apos;s abstraction over the JS engine&apos;s value types.  There is no conversion cost.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>654211</commentid>
    <comment_count>14</comment_count>
    <who name="Charles Wei">charles.wei</who>
    <bug_when>2012-06-20 21:12:10 -0700</bug_when>
    <thetext>(In reply to comment #13)
&gt; (In reply to comment #12)
&gt; &gt; .
&gt; &gt; &gt; 
&gt; &gt; &gt; I think a better interface would be to take any rather than serialized value.
&gt; &gt; &gt; 
&gt; &gt; &gt; IIRC that should give you a ScriptValue.
&gt; &gt; &gt; 
&gt; &gt; &gt; You can then introspect the ScriptValue (ask for properties, etc) without the need for the [de]serialise shenanigans, and only serialise once you go to store the value.
&gt; &gt; 
&gt; &gt; That seems a fundamental Change,and  requires almost re-write of Modules/indexeddb,  which is centered around SerializedScriptValue instead of ScriptValue.  Further,  will replace SerialiedScriptValue with ScriptValue will make things better ?  Can we easily access attributes of a ScriptValue object without converting to/from JSValue ?  
&gt; &gt; 
&gt; &gt; I am looking at Chromium guys who initially implemented indexeddb for v8 binding. We need a consensus on this.
&gt; 
&gt; ScriptValue (and ScriptObject) are WebCore&apos;s abstraction over the JS engine&apos;s value types.  There is no conversion cost.

Ok,  but does that justify re-write the whole indexedDB code?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>654214</commentid>
    <comment_count>15</comment_count>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2012-06-20 21:16:54 -0700</bug_when>
    <thetext>(In reply to comment #14)
&gt; (In reply to comment #13)
&gt; &gt; (In reply to comment #12)
&gt; &gt; &gt; .
&gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; I think a better interface would be to take any rather than serialized value.
&gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; IIRC that should give you a ScriptValue.
&gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; You can then introspect the ScriptValue (ask for properties, etc) without the need for the [de]serialise shenanigans, and only serialise once you go to store the value.
&gt; &gt; &gt; 
&gt; &gt; &gt; That seems a fundamental Change,and  requires almost re-write of Modules/indexeddb,  which is centered around SerializedScriptValue instead of ScriptValue.  Further,  will replace SerialiedScriptValue with ScriptValue will make things better ?  Can we easily access attributes of a ScriptValue object without converting to/from JSValue ?  
&gt; &gt; &gt; 
&gt; &gt; &gt; I am looking at Chromium guys who initially implemented indexeddb for v8 binding. We need a consensus on this.
&gt; &gt; 
&gt; &gt; ScriptValue (and ScriptObject) are WebCore&apos;s abstraction over the JS engine&apos;s value types.  There is no conversion cost.
&gt; 
&gt; Ok,  but does that justify re-write the whole indexedDB code?

1) If a feature has been implemented with a bad design, we should not be worrying about the annoyance of re-implementing it.
2) You keep saying that IDB is built entirely around SerializedScriptValue, but I don&apos;t understand how that can be the case -- serializedscriptvalue is not a queryable type.  It&apos;s intended for serialisation (hence the name), so should only be being used for actual storage and nothing else.  What is the usage that makes IDB fundamentally tied to serializedscriptvalue being the in memory object representation?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>654221</commentid>
    <comment_count>16</comment_count>
    <who name="Charles Wei">charles.wei</who>
    <bug_when>2012-06-20 21:30:52 -0700</bug_when>
    <thetext>
&gt; &gt; (In reply to comment #13)
&gt; &gt; &gt; (In reply to comment #12)
&gt; &gt; &gt; &gt; .
&gt; &gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; &gt; I think a better interface would be to take any rather than serialized value.
&gt; &gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; &gt; IIRC that should give you a ScriptValue.
&gt; &gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; &gt; You can then introspect the ScriptValue (ask for properties, etc) without the need for the [de]serialise shenanigans, and only serialise once you go to store the value.
&gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; That seems a fundamental Change,and  requires almost re-write of Modules/indexeddb,  which is centered around SerializedScriptValue instead of ScriptValue.  Further,  will replace SerialiedScriptValue with ScriptValue will make things better ?  Can we easily access attributes of a ScriptValue object without converting to/from JSValue ?  
&gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; I am looking at Chromium guys who initially implemented indexeddb for v8 binding. We need a consensus on this.
&gt; &gt; &gt; 
&gt; &gt; &gt; ScriptValue (and ScriptObject) are WebCore&apos;s abstraction over the JS engine&apos;s value types.  There is no conversion cost.
&gt; &gt; 
&gt; &gt; Ok,  but does that justify re-write the whole indexedDB code?
&gt; 
&gt; 1) If a feature has been implemented with a bad design, we should not be worrying about the annoyance of re-implementing it.
&gt; 2) You keep saying that IDB is built entirely around SerializedScriptValue, but I don&apos;t understand how that can be the case -- serializedscriptvalue is not a queryable type.  It&apos;s intended for serialisation (hence the name), so should only be being used for actual storage and nothing else.  What is the usage that makes IDB fundamentally tied to serializedscriptvalue being the in memory object representation?

For 1),  I agree that a bad-designed feature should not worry about re-implementing.  I would like to leave that to the original author to comment about the design for using SerializedScriptValue as the input parameter and in-memory representation of the object, instead of ScriptValue.

For 2),  I am talking about the fact that now idb implementation is build around SerializedScriptValue instead of ScriptValue, I am not saying that idb SHOULD be bond to SerializedScriptValue instead of the other one.

This patch tries to adapt to the current design and makes it work for JSC,  it&apos;s  not trying to re-write the design and implementation already there.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>654582</commentid>
    <comment_count>17</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2012-06-21 09:10:57 -0700</bug_when>
    <thetext>(In reply to comment #16)
&gt; 
&gt; For 1),  I agree that a bad-designed feature should not worry about re-implementing.  I would like to leave that to the original author to comment about the design for using SerializedScriptValue as the input parameter and in-memory representation of the object, instead of ScriptValue.

Unfortunately, the original authors are no longer active on the project. I&apos;ll try to fill in rationale as I understand it.

The original implementation - which was based on very early iterations of the spec - needed to support the multi-process model. This was done by using sqlite as the backing store, and giving each process a handle to the store. This was deemed undesirable for security, performance, and maintainability reasons. So the implementation changed to use leveldb as a backing store, but only one process can speak to leveldb at a time. So the implementation was effectively split into &quot;front end&quot; objects that (in Chromium) live in the renderer processes and &quot;back end&quot; objects that (in Chromium) live in the browser process. The &quot;front end&quot; objects had very little intelligence, and most of the logic implementing the spec was present in the &quot;back end&quot;.

This meant that as soon as an API call was made from script the object would immediately be serialized for transmission across an IPC boundary to the back end. In some cases, the back end object would need to reason about the object (e.g. &quot;extract a key&quot; given the object and a key path, or &quot;inject a key&quot; given the object and a key path); in the Chromium port this requires other IPC hops.

As an aside, the data stored in the backing store is a serialization of the script object. The IDB spec requires support for storing objects following the rules of the HTML5 &quot;structured clone algorithm&quot;; handily, these match (although Blobs are extra work and as yet unsupported in WebKit IDB)

These &quot;key&quot; objects are a dramatic subset of what is permitted by script (number, string, date, or array-of key), and are stored and used independently of script objects (e.g. when walking over indexes to analyze keys, even without extracting the objects they refer to).

Keys arise in two main places - explicitly passed from script, e.g. IDBObjectStore.get(key), where the WebIDL does indeed specify &quot;any&quot;, and implicitly e.g. IDBObjectStore.put(object) where the object store has a &quot;key path&quot;. The evaluation of the key path with the script object may occur directly during the API call, or may occur later and asynchronously - e.g. if the IDBObjectStore has an IDBIndex with a key path, then the key path is evaluated when the put() task is executed by the transaction to determine the index key. 

The cases where keys are explicitly passed in is currently handled by the binding layer, with WebKit IDL specifying IDBKey (a construct that does not exist in the spec). Custom binding logic is used to do the V8Value-&gt;IDBKey conversion. 

Although I&apos;m not familiar with ScriptValue/ScriptObject, it sounds like this could be changed so that the IDL/binding layer specifies &quot;any&quot; and the value-&gt;IDBKey conversion is done at in the method instead. I&apos;m agnostic to that change. However, it wouldn&apos;t change the need for the conversion functions, or obviate the use of SerializedScriptValue elsewhere in the current implementation.

&gt; For 2),  I am talking about the fact that now idb implementation is build around SerializedScriptValue instead of ScriptValue, I am not saying that idb SHOULD be bond to SerializedScriptValue instead of the other one.
&gt; 
&gt; This patch tries to adapt to the current design and makes it work for JSC,  it&apos;s  not trying to re-write the design and implementation already there.

IMHO that&apos;s the right way to go.

Those of us working on IDB with an eye towards the Chromium port are working on two fronts at the moment: highest priority is to get the implementation up to match the spec (our implementation was first, so has many old crufty bits that changed in the spec) so we&apos;re not introducing incompatibility to the Web; second priority is to untangle the &quot;front end&quot; / &quot;back end&quot; design specified above. 

It turns out that with an IPC jump in the middle that making changes to the code is incredibly time consuming (multi-sided patches) and performance is poor. We hope to get the WebKit implementation to the point where nearly all spec-specific logic resides in the &quot;front end&quot; and the &quot;back end&quot; is merely an async caching/write-batch system for arbitrary binary key/value pairs. This is a huge refactor - and especially exciting while other ports are attempting to implement the code, so we can&apos;t break them. It sounds like a move from SSV to SV would be most feasible once we&apos;re further along in this refactor, when the IDB spec logic isn&apos;t straddling an IPC barrier that requires SSVs in the middle.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>657062</commentid>
    <comment_count>18</comment_count>
    <who name="Charles Wei">charles.wei</who>
    <bug_when>2012-06-25 17:33:21 -0700</bug_when>
    <thetext>(In reply to comment #17)
&gt; (In reply to comment #16)
&gt; &gt; 
&gt; &gt; For 1),  I agree that a bad-designed feature should not worry about re-implementing.  I would like to leave that to the original author to comment about the design for using SerializedScriptValue as the input parameter and in-memory representation of the object, instead of ScriptValue.
&gt; 
&gt; Unfortunately, the original authors are no longer active on the project. I&apos;ll try to fill in rationale as I understand it.
&gt; 
&gt; The original implementation - which was based on very early iterations of the spec - needed to support the multi-process model. This was done by using sqlite as the backing store, and giving each process a handle to the store. This was deemed undesirable for security, performance, and maintainability reasons. So the implementation changed to use leveldb as a backing store, but only one process can speak to leveldb at a time. So the implementation was effectively split into &quot;front end&quot; objects that (in Chromium) live in the renderer processes and &quot;back end&quot; objects that (in Chromium) live in the browser process. The &quot;front end&quot; objects had very little intelligence, and most of the logic implementing the spec was present in the &quot;back end&quot;.
&gt; 
&gt; This meant that as soon as an API call was made from script the object would immediately be serialized for transmission across an IPC boundary to the back end. In some cases, the back end object would need to reason about the object (e.g. &quot;extract a key&quot; given the object and a key path, or &quot;inject a key&quot; given the object and a key path); in the Chromium port this requires other IPC hops.
&gt; 
&gt; As an aside, the data stored in the backing store is a serialization of the script object. The IDB spec requires support for storing objects following the rules of the HTML5 &quot;structured clone algorithm&quot;; handily, these match (although Blobs are extra work and as yet unsupported in WebKit IDB)
&gt; 
&gt; These &quot;key&quot; objects are a dramatic subset of what is permitted by script (number, string, date, or array-of key), and are stored and used independently of script objects (e.g. when walking over indexes to analyze keys, even without extracting the objects they refer to).
&gt; 
&gt; Keys arise in two main places - explicitly passed from script, e.g. IDBObjectStore.get(key), where the WebIDL does indeed specify &quot;any&quot;, and implicitly e.g. IDBObjectStore.put(object) where the object store has a &quot;key path&quot;. The evaluation of the key path with the script object may occur directly during the API call, or may occur later and asynchronously - e.g. if the IDBObjectStore has an IDBIndex with a key path, then the key path is evaluated when the put() task is executed by the transaction to determine the index key. 
&gt; 
&gt; The cases where keys are explicitly passed in is currently handled by the binding layer, with WebKit IDL specifying IDBKey (a construct that does not exist in the spec). Custom binding logic is used to do the V8Value-&gt;IDBKey conversion. 
&gt; 
&gt; Although I&apos;m not familiar with ScriptValue/ScriptObject, it sounds like this could be changed so that the IDL/binding layer specifies &quot;any&quot; and the value-&gt;IDBKey conversion is done at in the method instead. I&apos;m agnostic to that change. However, it wouldn&apos;t change the need for the conversion functions, or obviate the use of SerializedScriptValue elsewhere in the current implementation.
&gt; 
&gt; &gt; For 2),  I am talking about the fact that now idb implementation is build around SerializedScriptValue instead of ScriptValue, I am not saying that idb SHOULD be bond to SerializedScriptValue instead of the other one.
&gt; &gt; 
&gt; &gt; This patch tries to adapt to the current design and makes it work for JSC,  it&apos;s  not trying to re-write the design and implementation already there.
&gt; 
&gt; IMHO that&apos;s the right way to go.
&gt; 
&gt; Those of us working on IDB with an eye towards the Chromium port are working on two fronts at the moment: highest priority is to get the implementation up to match the spec (our implementation was first, so has many old crufty bits that changed in the spec) so we&apos;re not introducing incompatibility to the Web; second priority is to untangle the &quot;front end&quot; / &quot;back end&quot; design specified above. 
&gt; 
&gt; It turns out that with an IPC jump in the middle that making changes to the code is incredibly time consuming (multi-sided patches) and performance is poor. We hope to get the WebKit implementation to the point where nearly all spec-specific logic resides in the &quot;front end&quot; and the &quot;back end&quot; is merely an async caching/write-batch system for arbitrary binary key/value pairs. This is a huge refactor - and especially exciting while other ports are attempting to implement the code, so we can&apos;t break them. It sounds like a move from SSV to SV would be most feasible once we&apos;re further along in this refactor, when the IDB spec logic isn&apos;t straddling an IPC barrier that requires SSVs in the middle.


Joshua, thanks for the detailed explanation of the design and implementation background of IDB.

Oliver:  Any comments on this  ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>661245</commentid>
    <comment_count>19</comment_count>
    <who name="Charles Wei">charles.wei</who>
    <bug_when>2012-07-01 21:13:05 -0700</bug_when>
    <thetext>Anyone can comment how to proceed ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>696232</commentid>
    <comment_count>20</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2012-08-15 11:59:26 -0700</bug_when>
    <thetext>FYI, added https://bugs.webkit.org/show_bug.cgi?id=94023 to track moving the IDB code from using SerializedScriptValue everywhere to using ScriptValue (etc) where possible, marked it as blocking this issue.

I still think it would be okay to land this as-is then do the rework in 94023, even though it will likely obsolete much of this patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>696606</commentid>
    <comment_count>21</comment_count>
    <who name="Charles Wei">charles.wei</who>
    <bug_when>2012-08-15 18:41:05 -0700</bug_when>
    <thetext>(In reply to comment #20)
&gt; FYI, added https://bugs.webkit.org/show_bug.cgi?id=94023 to track moving the IDB code from using SerializedScriptValue everywhere to using ScriptValue (etc) where possible, marked it as blocking this issue.
&gt; 
&gt; I still think it would be okay to land this as-is then do the rework in 94023, even though it will likely obsolete much of this patch.

Thanks for pushing for this, Joshua, and good to see that you filed 94023 to move SSV to SV as the data in the IDB code.  I agree we can push this for now while 94023 will try to overwrite some of the code.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>718863</commentid>
    <comment_count>22</comment_count>
    <who name="Alec Flett">alecflett</who>
    <bug_when>2012-09-12 16:22:56 -0700</bug_when>
    <thetext>we&apos;re almost ready for this - plus there is no more IDBKeyPathBackendImpl. The only thing left is some of the IDBBindingUtilities stuff. hold off any work there until that is implemented in bug 95409</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>722152</commentid>
    <comment_count>23</comment_count>
    <who name="Alec Flett">alecflett</who>
    <bug_when>2012-09-17 12:12:56 -0700</bug_when>
    <thetext>Charles, we are ready to go on this - IDB has been totally converted over. Some of the test cases that came out of this were interesting though - in particular your port has to make sure that you use a consistent serialization format. JSC has one, but I don&apos;t know if it&apos;s an issue that it&apos;s likely not (currently) compatible with the V8 one.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>724058</commentid>
    <comment_count>24</comment_count>
    <who name="Jiyeon Kim">jiyeon0402.kim</who>
    <bug_when>2012-09-19 18:43:11 -0700</bug_when>
    <thetext>After Bug 88287 fix, I&apos;ll continue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>724571</commentid>
    <comment_count>25</comment_count>
    <who name="Alec Flett">alecflett</who>
    <bug_when>2012-09-20 09:33:55 -0700</bug_when>
    <thetext>jiyeon: this bug, as it is described, isn&apos;t quite what you need to implement now.

Instead, you need to implement JSC versions of the methods described in Source/WebCore/bindings/v8/IDBBindingUtilities.h</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>724960</commentid>
    <comment_count>26</comment_count>
    <who name="Jiyeon Kim">jiyeon0402.kim</who>
    <bug_when>2012-09-20 16:17:33 -0700</bug_when>
    <thetext>(In reply to comment #25)
&gt; jiyeon: this bug, as it is described, isn&apos;t quite what you need to implement now.
&gt; Instead, you need to implement JSC versions of the methods described in Source/WebCore/bindings/v8/IDBBindingUtilities.h

Sorry Alec for confusing. I have to write #24 comment in 92832 bugs.
I just waiting finish this patch. After this patch finish, I&apos;ll continue 92828, 92832 bugs.
You can ignore my comment #24.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>783841</commentid>
    <comment_count>27</comment_count>
    <who name="Alec Flett">alecflett</who>
    <bug_when>2012-12-05 09:38:26 -0800</bug_when>
    <thetext>I think this bug is now invalid - all the other stuff mentioned here was implemented in bug 103484, and sounds like details are being worked out in bug 96614

*** This bug has been marked as a duplicate of bug 96614 ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>799993</commentid>
    <comment_count>28</comment_count>
      <attachid>148516</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2013-01-04 00:47:50 -0800</bug_when>
    <thetext>Comment on attachment 148516
Patch

Cleared review? from attachment 148516 so that this bug does not appear in http://webkit.org/pending-review.  If you would like this patch reviewed, please attach it to a new bug (or re-open this bug before marking it for review again).</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>148289</attachid>
            <date>2012-06-19 02:09:50 -0700</date>
            <delta_ts>2012-06-19 06:15:16 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-88287-20120619170949.patch</filename>
            <type>text/plain</type>
            <size>9101</size>
            <attacher name="Charles Wei">charles.wei</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTIwNjY3CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9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NvbnN0IFN0cmluZyYga2V5UGF0aCwgVmVjdG9yPFJlZlB0cjxJREJL
ZXk+LCAwPiYga2V5cyk7CitQYXNzUmVmUHRyPFNlcmlhbGl6ZWRTY3JpcHRWYWx1ZT4gaW5qZWN0
SURCS2V5SW50b1NlcmlhbGl6ZWRTY3JpcHRWYWx1ZShQYXNzUmVmUHRyPElEQktleT4sIFBhc3NS
ZWZQdHI8U2VyaWFsaXplZFNjcmlwdFZhbHVlPiwgY29uc3QgU3RyaW5nJiBrZXlQYXRoKTsKIH0K
IAogI2VuZGlmIC8vIEVOQUJMRShJTkRFWEVEX0RBVEFCQVNFKQo=
</data>

          </attachment>
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>148320</attachid>
            <date>2012-06-19 06:15:26 -0700</date>
            <delta_ts>2012-06-20 00:05:08 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-88287-20120619211524.patch</filename>
            <type>text/plain</type>
            <size>7945</size>
            <attacher name="Charles Wei">charles.wei</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTIwNzA2CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXggMjMwYWYxYzlmNGQ5NjI3
ZmIxMmNhOWMxN2U0M2JlMDhkYTcxZjE5NS4uMDYwYjgxOTFhZjljOTIxYzFjMmI2N2M0MzJkM2Vk
NDZiZGJlZjNhZSAxMDA2NDQKLS0tIGEvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCisrKyBiL1Nv
dXJjZS9XZWJDb3JlL0NoYW5nZUxvZwpAQCAtMSwzICsxLDI5IEBACisyMDEyLTA2LTE5ICBDaGFy
bGVzIFdlaSAgPGNoYXJsZXMud2VpQHRvcmNobW9iaWxlLmNvbS5jbj4KKworICAgICAgICBKU0M6
IG5lZWQgdG8gaW1wbGVtZW50IElEQ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S2V5
PiBjcmVhdGVJREJLZXlGcm9tVmFsdWUoSlNDOjpFeGVjU3RhdGUqLCBKU0M6OkpTVmFsdWUpOwor
dm9pZCBjcmVhdGVJREJLZXlzRnJvbVNlcmlhbGl6ZWRTY3JpcHRWYWx1ZXNBbmRLZXlQYXRoKGNv
bnN0IFZlY3RvcjxSZWZQdHI8U2VyaWFsaXplZFNjcmlwdFZhbHVlPiwgMD4mLCBjb25zdCBJREJL
ZXlQYXRoJiwgVmVjdG9yPFJlZlB0cjxJREJLZXk+LCAwPiYpOworUGFzc1JlZlB0cjxTZXJpYWxp
emVkU2NyaXB0VmFsdWU+IGluamVjdElEQktleUludG9TZXJpYWxpemVkU2NyaXB0VmFsdWUoUGFz
c1JlZlB0cjxJREJLZXk+LCBQYXNzUmVmUHRyPFNlcmlhbGl6ZWRTY3JpcHRWYWx1ZT4sIGNvbnN0
IElEQktleVBhdGgmKTsKIAogfQogCg==
</data>

          </attachment>
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>148516</attachid>
            <date>2012-06-20 00:05:30 -0700</date>
            <delta_ts>2013-01-04 00:47:50 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-88287-20120620150525.patch</filename>
            <type>text/plain</type>
            <size>8269</size>
            <attacher name="Charles Wei">charles.wei</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTIwODA5CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXggMWRkMGVmODI3Mzc5N2Qz
ZTIxODVkYmQ3ZDkyYjNiNTgzMzhlZTQ2Yy4uNGY5Y2QzYzI5NjBiMzAxMjA2NWU5NWUxZWY0M2Ew
ODYxODY0ZWZkYSAxMDA2NDQKLS0tIGEvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCisrKyBiL1Nv
dXJjZS9XZWJDb3JlL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orI2luY2x1ZGUgPEpTQ29udGV4dFJlZi5oPgorCiBuYW1lc3BhY2UgV2ViQ29yZSB7CiAK
K2NsYXNzIElEQlRlbXBvcmFyeUpTQ29udGV4dDsKKworc3RhdGljIElEQlRlbXBvcmFyeUpTQ29u
dGV4dCogc19pbnN0YW5jZSA9IDA7CisKK2NsYXNzIElEQlRlbXBvcmFyeUpTQ29udGV4dCB7Citw
dWJsaWM6CisgICAgc3RhdGljIElEQlRlbXBvcmFyeUpTQ29udGV4dCogaW5zdGFuY2UoKQorICAg
IHsKKyAgICAgICAgaWYgKCFzX2luc3RhbmNlKQorICAgICAgICAgICAgc19pbnN0YW5jZSA9IG5l
dyBJREJUZW1wb3JhcnlKU0NvbnRleHQoKTsKKworICAgICAgICByZXR1cm4gc19pbnN0YW5jZTsK
KyAgICB9CisKKyAgICBKU0M6OkV4ZWNTdGF0ZSogZXhlYygpCisgICAgeworICAgICAgICByZXR1
cm4gdG9KUyhtX2NvbnRleHQpOworICAgIH0KKworcHJpdmF0ZToKKyAgICBJREJUZW1wb3JhcnlK
U0NvbnRleHQoKQorICAgIHsKKyAgICAgICAgbV9jb250ZXh0ID0gSlNHbG9iYWxDb250ZXh0Q3Jl
YXRlKDApOworICAgICAgICBKU0dsb2JhbENvbnRleHRSZXRhaW4obV9jb250ZXh0KTsKKyAgICB9
CisKKyAgICB+SURCVGVtcG9yYXJ5SlNDb250ZXh0KCkKKyAgICB7CisgICAgICAgIEpTR2xvYmFs
Q29udGV4dFJlbGVhc2UobV9jb250ZXh0KTsKKyAgICB9CisKKyAgICBKU0dsb2JhbENvbnRleHRS
ZWYgbV9jb250ZXh0OworfTsKKwogUGFzc1JlZlB0cjxJREJLZXk+IGNyZWF0ZUlEQktleUZyb21W
YWx1ZShKU0M6OkV4ZWNTdGF0ZSogZXhlYywgSlNDOjpKU1ZhbHVlIHZhbHVlKQogewogICAgIGlm
ICh2YWx1ZS5pc051bGwoKSkKICAgICAgICAgcmV0dXJuIElEQktleTo6Y3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