IDB: storage/indexeddb/mozilla/autoincrement-indexes.html fails
https://bugs.webkit.org/show_bug.cgi?id=128257

Reviewed by Sam Weinig.

Source/WebCore:

Tests: storage/indexeddb/mozilla/autoincrement-indexes.html

Add some IDBKeyData utility methods for WK2 to use:
* Modules/indexeddb/IDBKeyData.cpp:
(WebCore::IDBKeyData::setArrayValue):
(WebCore::IDBKeyData::setStringValue):
(WebCore::IDBKeyData::setDateValue):
(WebCore::IDBKeyData::setNumberValue):
* Modules/indexeddb/IDBKeyData.h:

* WebCore.exp.in:

Source/WebKit2:

* DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
(WebKit::UniqueIDBDatabase::putRecordInBackingStore): Write the correct key to the index if it was auto generated.
(WebKit::UniqueIDBDatabase::getRecordFromBackingStore): If this is an auto increment object store with
  a non-empty key path, save the key path to the get result.

* DatabaseProcess/IndexedDB/UniqueIDBDatabaseBackingStore.h:
* DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::createAndPopulateInitialMetadata): The IndexRecord schema shouldn’t
  have key uniqueness.
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::putRecord): Take IDBKeyData instead of IDBKey.
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::getIndexRecord): Fill in the primary key from the fetch.
* DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:

LayoutTests:

* platform/mac-wk2/TestExpectations: Enable the test.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163482 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/Modules/indexeddb/IDBKeyData.h b/Source/WebCore/Modules/indexeddb/IDBKeyData.h
index 8ef170d..c5961d7 100644
--- a/Source/WebCore/Modules/indexeddb/IDBKeyData.h
+++ b/Source/WebCore/Modules/indexeddb/IDBKeyData.h
@@ -58,6 +58,11 @@
     //   - Returns zero if this IDBKeyData is equal to other.
     int compare(const IDBKeyData& other) const;
 
+    void setArrayValue(const Vector<IDBKeyData>&);
+    void setStringValue(const String&);
+    void setDateValue(double);
+    void setNumberValue(double);
+
 #ifndef NDEBUG
     String loggingString() const;
 #endif