<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[163020] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/163020">163020</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2014-01-29 08:17:51 -0800 (Wed, 29 Jan 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>IDB: Serialize IDBKeyDatas to disk, not IDBKeys
https://bugs.webkit.org/show_bug.cgi?id=127829

Reviewed by Tim Horton.

Source/WebCore:

Move encode/decode from IDBKey to IDBKeyData.

* Modules/indexeddb/IDBKey.cpp:
* Modules/indexeddb/IDBKey.h:

* Modules/indexeddb/IDBKeyData.cpp:
(WebCore::IDBKeyData::IDBKeyData):
(WebCore::IDBKeyData::encode):
(WebCore::IDBKeyData::decode):
* Modules/indexeddb/IDBKeyData.h:

* WebCore.exp.in:

Source/WebKit2:

Serialize IDBKeyDatas, not IDBKeys.

* DatabaseProcess/IndexedDB/IDBSerialization.cpp:
(WebKit::deserializeIDBKeyPath):
(WebKit::serializeIDBKeyData):
* DatabaseProcess/IndexedDB/IDBSerialization.h:

* DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::extractExistingMetadata):
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::putRecord):
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::getKeyRecordFromObjectStore):
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::getKeyRangeRecordFromObjectStore):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBKeycpp">trunk/Source/WebCore/Modules/indexeddb/IDBKey.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBKeyh">trunk/Source/WebCore/Modules/indexeddb/IDBKey.h</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBKeyDatacpp">trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesindexeddbIDBKeyDatah">trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.h</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2DatabaseProcessIndexedDBIDBSerializationcpp">trunk/Source/WebKit2/DatabaseProcess/IndexedDB/IDBSerialization.cpp</a></li>
<li><a href="#trunkSourceWebKit2DatabaseProcessIndexedDBIDBSerializationh">trunk/Source/WebKit2/DatabaseProcess/IndexedDB/IDBSerialization.h</a></li>
<li><a href="#trunkSourceWebKit2DatabaseProcessIndexedDBsqliteUniqueIDBDatabaseBackingStoreSQLitecpp">trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (163019 => 163020)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-01-29 16:11:47 UTC (rev 163019)
+++ trunk/Source/WebCore/ChangeLog        2014-01-29 16:17:51 UTC (rev 163020)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2014-01-29  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        IDB: Serialize IDBKeyDatas to disk, not IDBKeys
+        https://bugs.webkit.org/show_bug.cgi?id=127829
+
+        Reviewed by Tim Horton.
+
+        Move encode/decode from IDBKey to IDBKeyData.
+
+        * Modules/indexeddb/IDBKey.cpp:
+        * Modules/indexeddb/IDBKey.h:
+
+        * Modules/indexeddb/IDBKeyData.cpp:
+        (WebCore::IDBKeyData::IDBKeyData):
+        (WebCore::IDBKeyData::encode):
+        (WebCore::IDBKeyData::decode):
+        * Modules/indexeddb/IDBKeyData.h:
+
+        * WebCore.exp.in:
+
</ins><span class="cx"> 2014-01-29  Antti Koivisto  &lt;antti@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION (r162947): css3/flexbox/multiline-justify-content.html and css3/flexbox/position-absolute-child.html are timing out
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBKeycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKey.cpp (163019 => 163020)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBKey.cpp        2014-01-29 16:11:47 UTC (rev 163019)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKey.cpp        2014-01-29 16:17:51 UTC (rev 163020)
</span><span class="lines">@@ -28,7 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><del>-#include &quot;KeyedCoding.h&quot;
</del><ins>+#include &quot;IDBKeyData.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -98,41 +98,6 @@
</span><span class="cx">     return !compare(other);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void IDBKey::encode(KeyedEncoder&amp; encoder) const
-{
-    encoder.encodeEnum(&quot;type&quot;, m_type);
-
-    switch (m_type) {
-    case InvalidType:
-        return;
-    case ArrayType:
-        encoder.encodeObjects(&quot;array&quot;, m_array.begin(), m_array.end(), [](WebCore::KeyedEncoder&amp; encoder, const RefPtr&lt;IDBKey&gt;&amp; key) {
-            encoder.encodeObject(&quot;idbKey&quot;, *key, [](KeyedEncoder&amp; encoder, const IDBKey&amp; key) {
-                key.encode(encoder);
-            });
-        });
-        return;
-    case StringType:
-        encoder.encodeString(&quot;string&quot;, m_string);
-        return;
-    case DateType:
-    case NumberType:
-        encoder.encodeDouble(&quot;number&quot;, m_number);
-        return;
-    case MinType:
-        ASSERT_NOT_REACHED();
-        return;
-    }
-
-    ASSERT_NOT_REACHED();
-}
-
-bool IDBKey::decode(KeyedDecoder&amp;, IDBKey&amp;)
-{
-    // FIXME: Implement when IDB Get support is implemented (&lt;rdar://problem/15779644&gt;)
-    return false;
-}
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBKeyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKey.h (163019 => 163020)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBKey.h        2014-01-29 16:11:47 UTC (rev 163019)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKey.h        2014-01-29 16:17:51 UTC (rev 163020)
</span><span class="lines">@@ -35,9 +35,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-class KeyedDecoder;
-class KeyedEncoder;
-
</del><span class="cx"> class IDBKey : public RefCounted&lt;IDBKey&gt; {
</span><span class="cx"> public:
</span><span class="cx">     typedef Vector&lt;RefPtr&lt;IDBKey&gt;&gt; KeyArray;
</span><span class="lines">@@ -150,9 +147,6 @@
</span><span class="cx">     using RefCounted&lt;IDBKey&gt;::ref;
</span><span class="cx">     using RefCounted&lt;IDBKey&gt;::deref;
</span><span class="cx"> 
</span><del>-    void encode(KeyedEncoder&amp;) const;
-    static bool decode(KeyedDecoder&amp;, IDBKey&amp;);
-
</del><span class="cx"> private:
</span><span class="cx">     IDBKey() : m_type(InvalidType), m_number(0), m_sizeEstimate(OverheadSize) { }
</span><span class="cx">     IDBKey(Type type, double number) : m_type(type), m_number(number), m_sizeEstimate(OverheadSize + sizeof(double)) { }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBKeyDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.cpp (163019 => 163020)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.cpp        2014-01-29 16:11:47 UTC (rev 163019)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.cpp        2014-01-29 16:17:51 UTC (rev 163020)
</span><span class="lines">@@ -28,9 +28,11 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> 
</span><ins>+#include &quot;KeyedCoding.h&quot;
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-IDBKeyData::IDBKeyData(IDBKey* key)
</del><ins>+IDBKeyData::IDBKeyData(const IDBKey* key)
</ins><span class="cx">     : type(IDBKey::InvalidType)
</span><span class="cx">     , numberValue(0)
</span><span class="cx">     , isNull(false)
</span><span class="lines">@@ -126,6 +128,45 @@
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void IDBKeyData::encode(KeyedEncoder&amp; encoder) const
+{
+    encoder.encodeBool(&quot;null&quot;, isNull);
+    if (isNull)
+        return;
+
+    encoder.encodeEnum(&quot;type&quot;, type);
+
+    switch (type) {
+    case IDBKey::InvalidType:
+        return;
+    case IDBKey::ArrayType:
+        encoder.encodeObjects(&quot;array&quot;, arrayValue.begin(), arrayValue.end(), [](KeyedEncoder&amp; encoder, const IDBKeyData&amp; key) {
+            encoder.encodeObject(&quot;idbKeyData&quot;, key, [](KeyedEncoder&amp; encoder, const IDBKeyData&amp; key) {
+                key.encode(encoder);
+            });
+        });
+        return;
+    case IDBKey::StringType:
+        encoder.encodeString(&quot;string&quot;, stringValue);
+        return;
+    case IDBKey::DateType:
+    case IDBKey::NumberType:
+        encoder.encodeDouble(&quot;number&quot;, numberValue);
+        return;
+    case IDBKey::MinType:
+        ASSERT_NOT_REACHED();
+        return;
+    }
+
+    ASSERT_NOT_REACHED();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool IDBKeyData::decode(KeyedDecoder&amp;, IDBKeyData&amp;)
+{
+    // FIXME: Implement when IDB Get support is implemented (&lt;rdar://problem/15779644&gt;)
+    return false;
+}
+
+}
+
</ins><span class="cx"> #endif // ENABLE(INDEXED_DATABASE)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesindexeddbIDBKeyDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.h (163019 => 163020)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.h        2014-01-29 16:11:47 UTC (rev 163019)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.h        2014-01-29 16:17:51 UTC (rev 163020)
</span><span class="lines">@@ -32,6 +32,9 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+class KeyedDecoder;
+class KeyedEncoder;
+
</ins><span class="cx"> struct IDBKeyData {
</span><span class="cx">     IDBKeyData()
</span><span class="cx">         : type(IDBKey::InvalidType)
</span><span class="lines">@@ -40,12 +43,15 @@
</span><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    IDBKeyData(IDBKey*);
</del><ins>+    IDBKeyData(const IDBKey*);
</ins><span class="cx"> 
</span><span class="cx">     PassRefPtr&lt;IDBKey&gt; maybeCreateIDBKey() const;
</span><span class="cx"> 
</span><span class="cx">     IDBKeyData isolatedCopy() const;
</span><span class="cx"> 
</span><ins>+    void encode(KeyedEncoder&amp;) const;
+    static bool decode(KeyedDecoder&amp;, IDBKeyData&amp;);
+
</ins><span class="cx">     IDBKey::Type type;
</span><span class="cx">     Vector&lt;IDBKeyData&gt; arrayValue;
</span><span class="cx">     String stringValue;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (163019 => 163020)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2014-01-29 16:11:47 UTC (rev 163019)
+++ trunk/Source/WebCore/WebCore.exp.in        2014-01-29 16:17:51 UTC (rev 163020)
</span><span class="lines">@@ -3076,12 +3076,12 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(INDEXED_DATABASE)
</span><span class="cx"> __ZNK7WebCore10IDBKeyData17maybeCreateIDBKeyEv
</span><ins>+__ZNK7WebCore10IDBKeyData6encodeERNS_12KeyedEncoderE
</ins><span class="cx"> __ZNK7WebCore10IDBKeyPath6encodeERNS_12KeyedEncoderE
</span><span class="cx"> __ZNK7WebCore11IDBKeyRange9isOnlyKeyEv
</span><span class="cx"> __ZNK7WebCore15IDBKeyRangeData22maybeCreateIDBKeyRangeEv
</span><del>-__ZNK7WebCore6IDBKey6encodeERNS_12KeyedEncoderE
</del><span class="cx"> __ZNK7WebCore6IDBKey7isValidEv
</span><del>-__ZN7WebCore10IDBKeyDataC1EPNS_6IDBKeyE
</del><ins>+__ZN7WebCore10IDBKeyDataC1EPKNS_6IDBKeyE
</ins><span class="cx"> __ZN7WebCore10IDBKeyPathC1ERKN3WTF6StringE
</span><span class="cx"> __ZN7WebCore10IDBKeyPathC1ERKN3WTF6VectorINS1_6StringELm0ENS1_15CrashOnOverflowEEE
</span><span class="cx"> __ZN7WebCore10IDBKeyPath6decodeERNS_12KeyedDecoderERS0_
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (163019 => 163020)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-01-29 16:11:47 UTC (rev 163019)
+++ trunk/Source/WebKit2/ChangeLog        2014-01-29 16:17:51 UTC (rev 163020)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2014-01-29  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        IDB: Serialize IDBKeyDatas to disk, not IDBKeys
+        https://bugs.webkit.org/show_bug.cgi?id=127829
+
+        Reviewed by Tim Horton.
+
+        Serialize IDBKeyDatas, not IDBKeys.
+
+        * DatabaseProcess/IndexedDB/IDBSerialization.cpp:
+        (WebKit::deserializeIDBKeyPath):
+        (WebKit::serializeIDBKeyData):
+        * DatabaseProcess/IndexedDB/IDBSerialization.h:
+
+        * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
+        (WebKit::UniqueIDBDatabaseBackingStoreSQLite::extractExistingMetadata):
+        (WebKit::UniqueIDBDatabaseBackingStoreSQLite::putRecord):
+        (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getKeyRecordFromObjectStore):
+        (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getKeyRangeRecordFromObjectStore):
+
</ins><span class="cx"> 2014-01-29  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed. Fix GTK+ build after r162981.
</span></span></pre></div>
<a id="trunkSourceWebKit2DatabaseProcessIndexedDBIDBSerializationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/IDBSerialization.cpp (163019 => 163020)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/IDBSerialization.cpp        2014-01-29 16:11:47 UTC (rev 163019)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/IDBSerialization.cpp        2014-01-29 16:17:51 UTC (rev 163020)
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx"> #include &quot;ArgumentEncoder.h&quot;
</span><span class="cx"> #include &quot;KeyedDecoder.h&quot;
</span><span class="cx"> #include &quot;KeyedEncoder.h&quot;
</span><del>-#include &lt;WebCore/IDBKey.h&gt;
</del><ins>+#include &lt;WebCore/IDBKeyData.h&gt;
</ins><span class="cx"> #include &lt;WebCore/IDBKeyPath.h&gt;
</span><span class="cx"> 
</span><span class="cx"> using namespace WebCore;
</span><span class="lines">@@ -44,17 +44,13 @@
</span><span class="cx">     return encoder.finishEncoding();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-std::unique_ptr&lt;WebCore::IDBKeyPath&gt; deserializeIDBKeyPath(const uint8_t* data, size_t size)
</del><ins>+bool deserializeIDBKeyPath(const uint8_t* data, size_t size, IDBKeyPath&amp; result)
</ins><span class="cx"> {
</span><span class="cx">     KeyedDecoder decoder(data, size);
</span><del>-    std::unique_ptr&lt;IDBKeyPath&gt; result = std::make_unique&lt;IDBKeyPath&gt;();
-    if (!IDBKeyPath::decode(decoder, *result))
-        return nullptr;
-
-    return result;
</del><ins>+    return IDBKeyPath::decode(decoder, result);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;WebCore::SharedBuffer&gt; serializeIDBKey(const IDBKey&amp; key)
</del><ins>+RefPtr&lt;WebCore::SharedBuffer&gt; serializeIDBKeyData(const IDBKeyData&amp; key)
</ins><span class="cx"> {
</span><span class="cx">     KeyedEncoder encoder;
</span><span class="cx">     key.encode(encoder);
</span></span></pre></div>
<a id="trunkSourceWebKit2DatabaseProcessIndexedDBIDBSerializationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/IDBSerialization.h (163019 => 163020)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/IDBSerialization.h        2014-01-29 16:11:47 UTC (rev 163019)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/IDBSerialization.h        2014-01-29 16:17:51 UTC (rev 163020)
</span><span class="lines">@@ -32,17 +32,18 @@
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><del>-class IDBKey;
</del><span class="cx"> class IDBKeyPath;
</span><ins>+
+struct IDBKeyData;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;WebCore::SharedBuffer&gt; serializeIDBKeyPath(const WebCore::IDBKeyPath&amp;);
</span><del>-std::unique_ptr&lt;WebCore::IDBKeyPath&gt; deserializeIDBKeyPath(const uint8_t* buffer, size_t bufferSize);
</del><ins>+bool deserializeIDBKeyPath(const uint8_t* buffer, size_t bufferSize, WebCore::IDBKeyPath&amp;);
</ins><span class="cx"> 
</span><del>-RefPtr&lt;WebCore::SharedBuffer&gt; serializeIDBKey(const WebCore::IDBKey&amp;);
-PassRefPtr&lt;WebCore::IDBKey&gt; deserializeIDBKey(const uint8_t* buffer, size_t bufferSize);
</del><ins>+RefPtr&lt;WebCore::SharedBuffer&gt; serializeIDBKeyData(const WebCore::IDBKeyData&amp;);
+bool deserializeIDBKey(const uint8_t* buffer, size_t bufferSize, WebCore::IDBKeyData&amp;);
</ins><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2DatabaseProcessIndexedDBsqliteUniqueIDBDatabaseBackingStoreSQLitecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp (163019 => 163020)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp        2014-01-29 16:11:47 UTC (rev 163019)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp        2014-01-29 16:17:51 UTC (rev 163020)
</span><span class="lines">@@ -198,14 +198,12 @@
</span><span class="cx">             int keyPathSize;
</span><span class="cx">             const uint8_t* keyPathBuffer = static_cast&lt;const uint8_t*&gt;(sql.getColumnBlob(2, keyPathSize));
</span><span class="cx"> 
</span><del>-            std::unique_ptr&lt;IDBKeyPath&gt; keyPath = deserializeIDBKeyPath(keyPathBuffer, keyPathSize);
</del><span class="cx"> 
</span><del>-            if (!keyPath) {
</del><ins>+            if (!deserializeIDBKeyPath(keyPathBuffer, keyPathSize, metadata.keyPath)) {
</ins><span class="cx">                 LOG_ERROR(&quot;Unable to extract key path metadata from database&quot;);
</span><span class="cx">                 return nullptr;
</span><span class="cx">             }
</span><span class="cx"> 
</span><del>-            metadata.keyPath = *keyPath;
</del><span class="cx">             metadata.autoIncrement = sql.getColumnInt(3);
</span><span class="cx">             metadata.maxIndexId = sql.getColumnInt64(4);
</span><span class="cx"> 
</span><span class="lines">@@ -583,7 +581,7 @@
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    RefPtr&lt;SharedBuffer&gt; keyBuffer = serializeIDBKey(key);
</del><ins>+    RefPtr&lt;SharedBuffer&gt; keyBuffer = serializeIDBKeyData(IDBKeyData(&amp;key));
</ins><span class="cx">     if (!keyBuffer) {
</span><span class="cx">         LOG_ERROR(&quot;Unable to serialize IDBKey to be stored in the database&quot;);
</span><span class="cx">         return false;
</span><span class="lines">@@ -621,7 +619,7 @@
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    RefPtr&lt;SharedBuffer&gt; keyBuffer = serializeIDBKey(key);
</del><ins>+    RefPtr&lt;SharedBuffer&gt; keyBuffer = serializeIDBKeyData(IDBKeyData(&amp;key));
</ins><span class="cx">     if (!keyBuffer) {
</span><span class="cx">         LOG_ERROR(&quot;Unable to serialize IDBKey to be stored in the database&quot;);
</span><span class="cx">         return false;
</span><span class="lines">@@ -667,13 +665,13 @@
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    RefPtr&lt;SharedBuffer&gt; lowerBuffer = serializeIDBKey(*keyRange.lower());
</del><ins>+    RefPtr&lt;SharedBuffer&gt; lowerBuffer = serializeIDBKeyData(IDBKeyData(keyRange.lower().get()));
</ins><span class="cx">     if (!lowerBuffer) {
</span><span class="cx">         LOG_ERROR(&quot;Unable to serialize IDBKey to be stored in the database&quot;);
</span><span class="cx">         return false;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    RefPtr&lt;SharedBuffer&gt; upperBuffer = serializeIDBKey(*keyRange.upper());
</del><ins>+    RefPtr&lt;SharedBuffer&gt; upperBuffer = serializeIDBKeyData(IDBKeyData(keyRange.upper().get()));
</ins><span class="cx">     if (!upperBuffer) {
</span><span class="cx">         LOG_ERROR(&quot;Unable to serialize IDBKey to be stored in the database&quot;);
</span><span class="cx">         return false;
</span></span></pre>
</div>
</div>

</body>
</html>