<!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 <beidson@apple.com>
+
+ 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 <antti@apple.com>
</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 "KeyedCoding.h"
</del><ins>+#include "IDBKeyData.h"
</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& encoder) const
-{
- encoder.encodeEnum("type", m_type);
-
- switch (m_type) {
- case InvalidType:
- return;
- case ArrayType:
- encoder.encodeObjects("array", m_array.begin(), m_array.end(), [](WebCore::KeyedEncoder& encoder, const RefPtr<IDBKey>& key) {
- encoder.encodeObject("idbKey", *key, [](KeyedEncoder& encoder, const IDBKey& key) {
- key.encode(encoder);
- });
- });
- return;
- case StringType:
- encoder.encodeString("string", m_string);
- return;
- case DateType:
- case NumberType:
- encoder.encodeDouble("number", m_number);
- return;
- case MinType:
- ASSERT_NOT_REACHED();
- return;
- }
-
- ASSERT_NOT_REACHED();
-}
-
-bool IDBKey::decode(KeyedDecoder&, IDBKey&)
-{
- // FIXME: Implement when IDB Get support is implemented (<rdar://problem/15779644>)
- 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<IDBKey> {
</span><span class="cx"> public:
</span><span class="cx"> typedef Vector<RefPtr<IDBKey>> KeyArray;
</span><span class="lines">@@ -150,9 +147,6 @@
</span><span class="cx"> using RefCounted<IDBKey>::ref;
</span><span class="cx"> using RefCounted<IDBKey>::deref;
</span><span class="cx">
</span><del>- void encode(KeyedEncoder&) const;
- static bool decode(KeyedDecoder&, IDBKey&);
-
</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 "KeyedCoding.h"
+
</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& encoder) const
+{
+ encoder.encodeBool("null", isNull);
+ if (isNull)
+ return;
+
+ encoder.encodeEnum("type", type);
+
+ switch (type) {
+ case IDBKey::InvalidType:
+ return;
+ case IDBKey::ArrayType:
+ encoder.encodeObjects("array", arrayValue.begin(), arrayValue.end(), [](KeyedEncoder& encoder, const IDBKeyData& key) {
+ encoder.encodeObject("idbKeyData", key, [](KeyedEncoder& encoder, const IDBKeyData& key) {
+ key.encode(encoder);
+ });
+ });
+ return;
+ case IDBKey::StringType:
+ encoder.encodeString("string", stringValue);
+ return;
+ case IDBKey::DateType:
+ case IDBKey::NumberType:
+ encoder.encodeDouble("number", 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&, IDBKeyData&)
+{
+ // FIXME: Implement when IDB Get support is implemented (<rdar://problem/15779644>)
+ 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<IDBKey> maybeCreateIDBKey() const;
</span><span class="cx">
</span><span class="cx"> IDBKeyData isolatedCopy() const;
</span><span class="cx">
</span><ins>+ void encode(KeyedEncoder&) const;
+ static bool decode(KeyedDecoder&, IDBKeyData&);
+
</ins><span class="cx"> IDBKey::Type type;
</span><span class="cx"> Vector<IDBKeyData> 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 <beidson@apple.com>
+
+ 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 <cgarcia@igalia.com>
</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 "ArgumentEncoder.h"
</span><span class="cx"> #include "KeyedDecoder.h"
</span><span class="cx"> #include "KeyedEncoder.h"
</span><del>-#include <WebCore/IDBKey.h>
</del><ins>+#include <WebCore/IDBKeyData.h>
</ins><span class="cx"> #include <WebCore/IDBKeyPath.h>
</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<WebCore::IDBKeyPath> deserializeIDBKeyPath(const uint8_t* data, size_t size)
</del><ins>+bool deserializeIDBKeyPath(const uint8_t* data, size_t size, IDBKeyPath& result)
</ins><span class="cx"> {
</span><span class="cx"> KeyedDecoder decoder(data, size);
</span><del>- std::unique_ptr<IDBKeyPath> result = std::make_unique<IDBKeyPath>();
- 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<WebCore::SharedBuffer> serializeIDBKey(const IDBKey& key)
</del><ins>+RefPtr<WebCore::SharedBuffer> serializeIDBKeyData(const IDBKeyData& 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 <wtf/Vector.h>
</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<WebCore::SharedBuffer> serializeIDBKeyPath(const WebCore::IDBKeyPath&);
</span><del>-std::unique_ptr<WebCore::IDBKeyPath> deserializeIDBKeyPath(const uint8_t* buffer, size_t bufferSize);
</del><ins>+bool deserializeIDBKeyPath(const uint8_t* buffer, size_t bufferSize, WebCore::IDBKeyPath&);
</ins><span class="cx">
</span><del>-RefPtr<WebCore::SharedBuffer> serializeIDBKey(const WebCore::IDBKey&);
-PassRefPtr<WebCore::IDBKey> deserializeIDBKey(const uint8_t* buffer, size_t bufferSize);
</del><ins>+RefPtr<WebCore::SharedBuffer> serializeIDBKeyData(const WebCore::IDBKeyData&);
+bool deserializeIDBKey(const uint8_t* buffer, size_t bufferSize, WebCore::IDBKeyData&);
</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<const uint8_t*>(sql.getColumnBlob(2, keyPathSize));
</span><span class="cx">
</span><del>- std::unique_ptr<IDBKeyPath> 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("Unable to extract key path metadata from database");
</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<SharedBuffer> keyBuffer = serializeIDBKey(key);
</del><ins>+ RefPtr<SharedBuffer> keyBuffer = serializeIDBKeyData(IDBKeyData(&key));
</ins><span class="cx"> if (!keyBuffer) {
</span><span class="cx"> LOG_ERROR("Unable to serialize IDBKey to be stored in the database");
</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<SharedBuffer> keyBuffer = serializeIDBKey(key);
</del><ins>+ RefPtr<SharedBuffer> keyBuffer = serializeIDBKeyData(IDBKeyData(&key));
</ins><span class="cx"> if (!keyBuffer) {
</span><span class="cx"> LOG_ERROR("Unable to serialize IDBKey to be stored in the database");
</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<SharedBuffer> lowerBuffer = serializeIDBKey(*keyRange.lower());
</del><ins>+ RefPtr<SharedBuffer> lowerBuffer = serializeIDBKeyData(IDBKeyData(keyRange.lower().get()));
</ins><span class="cx"> if (!lowerBuffer) {
</span><span class="cx"> LOG_ERROR("Unable to serialize IDBKey to be stored in the database");
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- RefPtr<SharedBuffer> upperBuffer = serializeIDBKey(*keyRange.upper());
</del><ins>+ RefPtr<SharedBuffer> upperBuffer = serializeIDBKeyData(IDBKeyData(keyRange.upper().get()));
</ins><span class="cx"> if (!upperBuffer) {
</span><span class="cx"> LOG_ERROR("Unable to serialize IDBKey to be stored in the database");
</span><span class="cx"> return false;
</span></span></pre>
</div>
</div>
</body>
</html>