<!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>[163076] trunk/Source/WebKit2</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/163076">163076</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2014-01-30 00:19:40 -0800 (Thu, 30 Jan 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>IDB: Key generator support
https://bugs.webkit.org/show_bug.cgi?id=127871
Reviewed by Tim Horton.
* DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
(WebKit::UniqueIDBDatabase::putRecordInBackingStore): Update for storing/retrieving integers instead of IDBKeys.
* DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h:
* DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::createAndPopulateInitialMetadata): Create a keygen table.
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::createObjectStore): Put a record in the keygen table for
this object store if necessary.
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteObjectStore): Delete the entry in the keygen table.
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::generateKeyNumber): Pull the current number from the table.
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::updateKeyGeneratorNumber): Update the number in the table.
* DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:
* WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
(WebKit::WebIDBServerConnection::put): Null keys are acceptable for autoIncrement object stores.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2DatabaseProcessIndexedDBUniqueIDBDatabasecpp">trunk/Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp</a></li>
<li><a href="#trunkSourceWebKit2DatabaseProcessIndexedDBUniqueIDBDatabaseBackingStoreh">trunk/Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h</a></li>
<li><a href="#trunkSourceWebKit2DatabaseProcessIndexedDBsqliteUniqueIDBDatabaseBackingStoreSQLitecpp">trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp</a></li>
<li><a href="#trunkSourceWebKit2DatabaseProcessIndexedDBsqliteUniqueIDBDatabaseBackingStoreSQLiteh">trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessDatabasesIndexedDBWebIDBServerConnectioncpp">trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (163075 => 163076)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-01-30 08:16:56 UTC (rev 163075)
+++ trunk/Source/WebKit2/ChangeLog        2014-01-30 08:19:40 UTC (rev 163076)
</span><span class="lines">@@ -1,5 +1,28 @@
</span><span class="cx"> 2014-01-30 Brady Eidson <beidson@apple.com>
</span><span class="cx">
</span><ins>+ IDB: Key generator support
+ https://bugs.webkit.org/show_bug.cgi?id=127871
+
+ Reviewed by Tim Horton.
+
+ * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
+ (WebKit::UniqueIDBDatabase::putRecordInBackingStore): Update for storing/retrieving integers instead of IDBKeys.
+ * DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h:
+
+ * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
+ (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createAndPopulateInitialMetadata): Create a keygen table.
+ (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createObjectStore): Put a record in the keygen table for
+ this object store if necessary.
+ (WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteObjectStore): Delete the entry in the keygen table.
+ (WebKit::UniqueIDBDatabaseBackingStoreSQLite::generateKeyNumber): Pull the current number from the table.
+ (WebKit::UniqueIDBDatabaseBackingStoreSQLite::updateKeyGeneratorNumber): Update the number in the table.
+ * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:
+
+ * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
+ (WebKit::WebIDBServerConnection::put): Null keys are acceptable for autoIncrement object stores.
+
+2014-01-30 Brady Eidson <beidson@apple.com>
+
</ins><span class="cx"> IDB: Implement IDBObjectStore.count()
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=127888
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2DatabaseProcessIndexedDBUniqueIDBDatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp (163075 => 163076)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp        2014-01-30 08:16:56 UTC (rev 163075)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp        2014-01-30 08:19:40 UTC (rev 163076)
</span><span class="lines">@@ -753,9 +753,14 @@
</span><span class="cx">
</span><span class="cx"> bool keyWasGenerated = false;
</span><span class="cx"> RefPtr<IDBKey> key;
</span><ins>+ int64_t keyNumber = 0;
</ins><span class="cx">
</span><span class="cx"> if (putMode != IDBDatabaseBackend::CursorUpdate && objectStoreMetadata.autoIncrement && keyData.isNull) {
</span><del>- key = m_backingStore->generateKey(transaction, objectStoreMetadata.id);
</del><ins>+ if (!m_backingStore->generateKeyNumber(transaction, objectStoreMetadata.id, keyNumber)) {
+ postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didPutRecordInBackingStore, requestID, IDBKeyData(), IDBDatabaseException::UnknownError, ASCIILiteral("Internal backing store error checking for key existence")));
+ return;
+ }
+ key = IDBKey::createNumber(keyNumber);
</ins><span class="cx"> keyWasGenerated = true;
</span><span class="cx"> } else
</span><span class="cx"> key = keyData.maybeCreateIDBKey();
</span><span class="lines">@@ -785,7 +790,7 @@
</span><span class="cx"> // FIXME: The LevelDB port updates index keys here. Necessary?
</span><span class="cx">
</span><span class="cx"> if (putMode != IDBDatabaseBackend::CursorUpdate && objectStoreMetadata.autoIncrement && key->type() == IDBKey::NumberType) {
</span><del>- if (!m_backingStore->updateKeyGenerator(transaction, objectStoreMetadata.id, *key, keyWasGenerated)) {
</del><ins>+ if (!m_backingStore->updateKeyGeneratorNumber(transaction, objectStoreMetadata.id, keyNumber, keyWasGenerated)) {
</ins><span class="cx"> postMainThreadTask(createAsyncTask(*this, &UniqueIDBDatabase::didPutRecordInBackingStore, requestID, IDBKeyData(), IDBDatabaseException::UnknownError, ASCIILiteral("Internal backing store error updating key generator")));
</span><span class="cx"> return;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2DatabaseProcessIndexedDBUniqueIDBDatabaseBackingStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h (163075 => 163076)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h        2014-01-30 08:16:56 UTC (rev 163075)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h        2014-01-30 08:19:40 UTC (rev 163076)
</span><span class="lines">@@ -63,10 +63,11 @@
</span><span class="cx"> virtual bool createIndex(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, const WebCore::IDBIndexMetadata&) = 0;
</span><span class="cx"> virtual bool deleteIndex(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, int64_t indexID) = 0;
</span><span class="cx">
</span><del>- virtual PassRefPtr<WebCore::IDBKey> generateKey(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID) = 0;
</del><ins>+ virtual bool generateKeyNumber(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, int64_t& generatedKey) = 0;
+ virtual bool updateKeyGeneratorNumber(const IDBIdentifier& transactionIdentifier, int64_t objectStoreId, int64_t keyNumber, bool checkCurrent) = 0;
+
</ins><span class="cx"> virtual bool keyExistsInObjectStore(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, const WebCore::IDBKey&, bool& keyExists) = 0;
</span><span class="cx"> virtual bool putRecord(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, const WebCore::IDBKey&, const uint8_t* valueBuffer, size_t valueSize) = 0;
</span><del>- virtual bool updateKeyGenerator(const IDBIdentifier& transactionIdentifier, int64_t objectStoreId, const WebCore::IDBKey&, bool checkCurrent) = 0;
</del><span class="cx">
</span><span class="cx"> virtual bool getKeyRecordFromObjectStore(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, const WebCore::IDBKey&, RefPtr<WebCore::SharedBuffer>& result) = 0;
</span><span class="cx"> virtual bool getKeyRangeRecordFromObjectStore(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, const WebCore::IDBKeyRange&, RefPtr<WebCore::SharedBuffer>& result, RefPtr<WebCore::IDBKey>& resultKey) = 0;
</span></span></pre></div>
<a id="trunkSourceWebKit2DatabaseProcessIndexedDBsqliteUniqueIDBDatabaseBackingStoreSQLitecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp (163075 => 163076)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp        2014-01-30 08:16:56 UTC (rev 163075)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp        2014-01-30 08:19:40 UTC (rev 163076)
</span><span class="lines">@@ -98,6 +98,12 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ if (!m_sqliteDB->executeCommand("CREATE TABLE KeyGenerators (objectStoreID INTEGER NOT NULL ON CONFLICT FAIL UNIQUE ON CONFLICT REPLACE, currentKey INTEGER NOT NULL ON CONFLICT FAIL);")) {
+ LOG_ERROR("Could not create KeyGenerators table in database (%i) - %s", m_sqliteDB->lastError(), m_sqliteDB->lastErrorMsg());
+ m_sqliteDB = nullptr;
+ return nullptr;
+ }
+
</ins><span class="cx"> {
</span><span class="cx"> SQLiteStatement sql(*m_sqliteDB, ASCIILiteral("INSERT INTO IDBDatabaseInfo VALUES ('MetadataVersion', ?);"));
</span><span class="cx"> if (sql.prepare() != SQLResultOk
</span><span class="lines">@@ -381,18 +387,30 @@
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- SQLiteStatement sql(*m_sqliteDB, ASCIILiteral("INSERT INTO ObjectStoreInfo VALUES (?, ?, ?, ?, ?);"));
- if (sql.prepare() != SQLResultOk
- || sql.bindInt64(1, metadata.id) != SQLResultOk
- || sql.bindText(2, metadata.name) != SQLResultOk
- || sql.bindBlob(3, keyPathBlob->data(), keyPathBlob->size()) != SQLResultOk
- || sql.bindInt(4, metadata.autoIncrement) != SQLResultOk
- || sql.bindInt64(5, metadata.maxIndexId) != SQLResultOk
- || sql.step() != SQLResultDone) {
- LOG_ERROR("Could not add object store '%s' to ObjectStoreInfo table (%i) - %s", metadata.name.utf8().data(), m_sqliteDB->lastError(), m_sqliteDB->lastErrorMsg());
- return false;
</del><ins>+ {
+ SQLiteStatement sql(*m_sqliteDB, ASCIILiteral("INSERT INTO ObjectStoreInfo VALUES (?, ?, ?, ?, ?);"));
+ if (sql.prepare() != SQLResultOk
+ || sql.bindInt64(1, metadata.id) != SQLResultOk
+ || sql.bindText(2, metadata.name) != SQLResultOk
+ || sql.bindBlob(3, keyPathBlob->data(), keyPathBlob->size()) != SQLResultOk
+ || sql.bindInt(4, metadata.autoIncrement) != SQLResultOk
+ || sql.bindInt64(5, metadata.maxIndexId) != SQLResultOk
+ || sql.step() != SQLResultDone) {
+ LOG_ERROR("Could not add object store '%s' to ObjectStoreInfo table (%i) - %s", metadata.name.utf8().data(), m_sqliteDB->lastError(), m_sqliteDB->lastErrorMsg());
+ return false;
+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+ {
+ SQLiteStatement sql(*m_sqliteDB, ASCIILiteral("INSERT INTO KeyGenerators VALUES (?, 0);"));
+ if (sql.prepare() != SQLResultOk
+ || sql.bindInt64(1, metadata.id) != SQLResultOk
+ || sql.step() != SQLResultDone) {
+ LOG_ERROR("Could not seed initial key generator value for ObjectStoreInfo table (%i) - %s", m_sqliteDB->lastError(), m_sqliteDB->lastErrorMsg());
+ return false;
+ }
+ }
+
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -423,6 +441,17 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ // Delete the ObjectStore's key generator record if there is one.
+ {
+ SQLiteStatement sql(*m_sqliteDB, ASCIILiteral("DELETE FROM KeyGenerators WHERE objectStoreID = ?;"));
+ if (sql.prepare() != SQLResultOk
+ || sql.bindInt64(1, objectStoreID) != SQLResultOk
+ || sql.step() != SQLResultDone) {
+ LOG_ERROR("Could not delete object store from KeyGenerators table (%i) - %s", m_sqliteDB->lastError(), m_sqliteDB->lastErrorMsg());
+ return false;
+ }
+ }
+
</ins><span class="cx"> // Delete all associated Index records
</span><span class="cx"> {
</span><span class="cx"> Vector<int64_t> indexIDs;
</span><span class="lines">@@ -554,12 +583,79 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-PassRefPtr<IDBKey> UniqueIDBDatabaseBackingStoreSQLite::generateKey(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID)
</del><ins>+bool UniqueIDBDatabaseBackingStoreSQLite::generateKeyNumber(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, int64_t& generatedKey)
</ins><span class="cx"> {
</span><del>- // FIXME (<rdar://problem/15877909>): Implement
- return nullptr;
</del><ins>+ ASSERT(!isMainThread());
+ ASSERT(m_sqliteDB);
+ ASSERT(m_sqliteDB->isOpen());
+
+ // The IndexedDatabase spec defines the max key generator value as 2^53;
+ static const int64_t maxGeneratorValue = 9007199254740992LL;
+
+ SQLiteIDBTransaction* transaction = m_transactions.get(transactionIdentifier);
+ if (!transaction || !transaction->inProgress()) {
+ LOG_ERROR("Attempt to generate key in database without an established, in-progress transaction");
+ return false;
+ }
+ if (transaction->mode() == IndexedDB::TransactionMode::ReadOnly) {
+ LOG_ERROR("Attempt to generate key in database during read-only transaction");
+ return false;
+ }
+
+ int64_t currentValue;
+ {
+ SQLiteStatement sql(*m_sqliteDB, ASCIILiteral("SELECT currentKey FROM KeyGenerators WHERE objectStoreID = ?;"));
+ if (sql.prepare() != SQLResultOk
+ || sql.bindInt64(1, objectStoreID) != SQLResultOk) {
+ LOG_ERROR("Could not delete index id %lli from IndexInfo table (%i) - %s", objectStoreID, m_sqliteDB->lastError(), m_sqliteDB->lastErrorMsg());
+ return false;
+ }
+ int result = sql.step();
+ if (result != SQLResultRow) {
+ LOG_ERROR("Could not retreive key generator value for object store, but it should be there.");
+ return false;
+ }
+
+ currentValue = sql.getColumnInt64(0);
+ }
+
+ if (currentValue < 0 || currentValue > maxGeneratorValue)
+ return false;
+
+ generatedKey = currentValue + 1;
+ return true;
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+bool UniqueIDBDatabaseBackingStoreSQLite::updateKeyGeneratorNumber(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, int64_t keyNumber, bool)
+{
+ ASSERT(!isMainThread());
+ ASSERT(m_sqliteDB);
+ ASSERT(m_sqliteDB->isOpen());
+
+ SQLiteIDBTransaction* transaction = m_transactions.get(transactionIdentifier);
+ if (!transaction || !transaction->inProgress()) {
+ LOG_ERROR("Attempt to update key generator in database without an established, in-progress transaction");
+ return false;
+ }
+ if (transaction->mode() == IndexedDB::TransactionMode::ReadOnly) {
+ LOG_ERROR("Attempt to update key generator in database during read-only transaction");
+ return false;
+ }
+
+ {
+ SQLiteStatement sql(*m_sqliteDB, ASCIILiteral("INSERT INTO KeyGenerators VALUES (?, ?);"));
+ if (sql.prepare() != SQLResultOk
+ || sql.bindInt64(1, objectStoreID) != SQLResultOk
+ || sql.bindInt64(2, keyNumber) != SQLResultOk
+ || sql.step() != SQLResultDone) {
+ LOG_ERROR("Could not update key generator value (%i) - %s", m_sqliteDB->lastError(), m_sqliteDB->lastErrorMsg());
+ return false;
+ }
+ }
+
+ return true;
+}
+
</ins><span class="cx"> bool UniqueIDBDatabaseBackingStoreSQLite::keyExistsInObjectStore(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, const IDBKey&, bool& keyExists)
</span><span class="cx"> {
</span><span class="cx"> // FIXME: When Get support is implemented, we need to implement this also (<rdar://problem/15779644>)
</span><span class="lines">@@ -602,12 +698,6 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool UniqueIDBDatabaseBackingStoreSQLite::updateKeyGenerator(const IDBIdentifier& transactionIdentifier, int64_t objectStoreId, const IDBKey&, bool checkCurrent)
-{
- // FIXME (<rdar://problem/15877909>): Implement
- return false;
-}
-
</del><span class="cx"> bool UniqueIDBDatabaseBackingStoreSQLite::getKeyRecordFromObjectStore(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, const IDBKey& key, RefPtr<SharedBuffer>& result)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(!isMainThread());
</span></span></pre></div>
<a id="trunkSourceWebKit2DatabaseProcessIndexedDBsqliteUniqueIDBDatabaseBackingStoreSQLiteh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h (163075 => 163076)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h        2014-01-30 08:16:56 UTC (rev 163075)
+++ trunk/Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h        2014-01-30 08:19:40 UTC (rev 163076)
</span><span class="lines">@@ -67,10 +67,11 @@
</span><span class="cx"> virtual bool createIndex(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, const WebCore::IDBIndexMetadata&) override;
</span><span class="cx"> virtual bool deleteIndex(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, int64_t indexID) override;
</span><span class="cx">
</span><del>- virtual PassRefPtr<WebCore::IDBKey> generateKey(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID) override;
</del><ins>+ virtual bool generateKeyNumber(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, int64_t& generatedKey) override;
+ virtual bool updateKeyGeneratorNumber(const IDBIdentifier& transactionIdentifier, int64_t objectStoreId, int64_t keyNumber, bool checkCurrent) override;
+
</ins><span class="cx"> virtual bool keyExistsInObjectStore(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, const WebCore::IDBKey&, bool& keyExists) override;
</span><span class="cx"> virtual bool putRecord(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, const WebCore::IDBKey&, const uint8_t* valueBuffer, size_t valueSize) override;
</span><del>- virtual bool updateKeyGenerator(const IDBIdentifier& transactionIdentifier, int64_t objectStoreId, const WebCore::IDBKey&, bool checkCurrent) override;
</del><span class="cx">
</span><span class="cx"> virtual bool getKeyRecordFromObjectStore(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, const WebCore::IDBKey&, RefPtr<WebCore::SharedBuffer>& result) override;
</span><span class="cx"> virtual bool getKeyRangeRecordFromObjectStore(const IDBIdentifier& transactionIdentifier, int64_t objectStoreID, const WebCore::IDBKeyRange&, RefPtr<WebCore::SharedBuffer>& result, RefPtr<WebCore::IDBKey>& resultKey) override;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessDatabasesIndexedDBWebIDBServerConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp (163075 => 163076)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp        2014-01-30 08:16:56 UTC (rev 163075)
+++ trunk/Source/WebKit2/WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp        2014-01-30 08:19:40 UTC (rev 163076)
</span><span class="lines">@@ -381,7 +381,6 @@
</span><span class="cx">
</span><span class="cx"> LOG(IDB, "WebProcess put request ID %llu", requestID);
</span><span class="cx">
</span><del>- ASSERT(operation.key());
</del><span class="cx"> ASSERT(operation.value());
</span><span class="cx">
</span><span class="cx"> IPC::DataReference value(reinterpret_cast<const uint8_t*>(operation.value()->data()), operation.value()->size());
</span></span></pre>
</div>
</div>
</body>
</html>