<?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>100292</bug_id>
          
          <creation_ts>2012-10-24 14:52:46 -0700</creation_ts>
          <short_desc>IndexedDB: Remove IDBAny from WebKitIDL</short_desc>
          <delta_ts>2013-04-11 09:13:17 -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>WebCore Misc.</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</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>
          <dependson>97375</dependson>
    
    <dependson>111002</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Joshua Bell">jsbell</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>alecflett</cc>
    
    <cc>dgrogan</cc>
    
    <cc>haraken</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>750073</commentid>
    <comment_count>0</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2012-10-24 14:52:46 -0700</bug_when>
    <thetext>Similar to https://bugs.webkit.org/show_bug.cgi?id=97375 

IDBAny is used for attributes of type &quot;any&quot;, and these should be replaceable with ScriptValue:

IDBCursor.idl:    readonly attribute IDBAny source;
IDBRequest.idl:    readonly attribute IDBAny source;

^^^ Another IDB type (IDBObjectStore, IDBIndex, etc) - would just need a neutral way to call ScriptValue(to[V8|JS](object))

IDBDatabase.idl:    readonly attribute IDBAny version;

^^^ Number or String - would need a way to initialize ScriptValue from a number/string

IDBIndex.idl:    readonly attribute IDBAny keyPath;
IDBObjectStore.idl:    readonly attribute IDBAny keyPath;

^^^ Null, String or DOMStringList

IDBRequest.idl:    readonly attribute IDBAny result

^^^ All of the above, or arbitrary script value.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>850449</commentid>
    <comment_count>1</comment_count>
    <who name="Joshua Bell">jsbell</who>
    <bug_when>2013-03-07 13:38:53 -0800</bug_when>
    <thetext>IDBVersionChangeEvent.idl:    readonly attribute IDBAny oldVersion;
IDBVersionChangeEvent.idl:    readonly attribute IDBAny newVersion;

^^^ Number or String

...

I&apos;ve been thinking about doing this in three parts:

(1) Remove IntegerType/StringType/NullType/KeyPathType in favor of just ScriptValueType + the various IDB*Types

(2) Reduce the IDBAny type set down to ScriptValue, and have a binding helper that does (RefPtr&lt;T&gt;) -&gt; ScriptValue via toV8/toJS().

(3) Eliminate IDBAny itself

IMHO #1 is valuable on its own as it removes the need to create scratch SerializedScriptValues which then are deserialized into ScriptValues.

I&apos;ve started #1 then abandoned this change about 5 times so far. The crux of it is that we need a ScriptExecutionContext at the point where the ScriptValue is created to get an isolate. Right now this easily done in IDBRequest but requires &quot;dirtying&quot; some of the other call sites - adding [CallWith=ScriptExecutionContext] IDL annotations here and there.

I&apos;ve toyed with several API variations, e.g.:

* Require a ScriptExecutionContext to be passed to IDBAny constructors - callers need to are otherwise unchanged.
* Add IDBBindingUtilities functions for stringToScriptValue(isolate, str), numberToStringValue(isolate, double), etc; IDBAny creators pass in the ScriptValue
* Add constructors to ScriptValue: ScriptValue(isolate, double), ScriptValue(isolate, string), ScriptValue::null(isolate), 

Opinions?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>850471</commentid>
    <comment_count>2</comment_count>
    <who name="Alec Flett">alecflett</who>
    <bug_when>2013-03-07 14:06:03 -0800</bug_when>
    <thetext>I vote for constructors on ScriptValue, the same way SerializedScriptValue already has intValue() and such.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>850611</commentid>
    <comment_count>3</comment_count>
    <who name="Kentaro Hara">haraken</who>
    <bug_when>2013-03-07 16:32:51 -0800</bug_when>
    <thetext>(In reply to comment #2)
&gt; I vote for constructors on ScriptValue, the same way SerializedScriptValue already has intValue() and such.

Agreed.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>