Use KeyedCoding as a persistent storage mechanism for blobs
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Jan 2014 21:45:34 +0000 (21:45 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Jan 2014 21:45:34 +0000 (21:45 +0000)
commit0d4187cf021ab6d7184d16b11847f2a7ad099beb
tree24e1ce2f97c6fe0c5674c646e4b9219b9571f95d
parent9efe7c4a6084a1d7031e9b40538cd3d3e0500437
Use KeyedCoding as a persistent storage mechanism for blobs
https://bugs.webkit.org/show_bug.cgi?id=127012

Reviewed by Anders Carlsson.

Source/WebCore:

Add basic KeyedDecoder interface that is the inverse of KeyedEncoder:
* platform/KeyedCoding.h:
(WebCore::KeyedDecoder::decodeVerifiedEnum):
(WebCore::KeyedDecoder::decodeObject):
(WebCore::KeyedDecoder::decodeObjects):

Use KeyedEncoder/Decoder to encode/decode IDBKeyPath:
* Modules/indexeddb/IDBKeyPath.cpp:
(WebCore::IDBKeyPath::encode):
(WebCore::IDBKeyPath::decode):
* Modules/indexeddb/IDBKeyPath.h:

* WebCore.exp.in:

Source/WebKit2:

Add a way to get the encoded buffer to save:
* Shared/cf/KeyedEncoder.cpp:
(WebKit::KeyedEncoder::finishEncoding):
* Shared/cf/KeyedEncoder.h:

Add a WebKit KeyedDecoder for CF platforms that can decode the previously encoded buffer:
* Shared/cf/KeyedDecoder.cpp: Added.
(WebKit::KeyedDecoder::KeyedDecoder):
(WebKit::KeyedDecoder::~KeyedDecoder):
(WebKit::KeyedDecoder::decodeInt64):
(WebKit::KeyedDecoder::decodeUInt32):
(WebKit::KeyedDecoder::decodeString):
(WebKit::KeyedDecoder::beginObject):
(WebKit::KeyedDecoder::endObject):
(WebKit::KeyedDecoder::beginArray):
(WebKit::KeyedDecoder::beginArrayElement):
(WebKit::KeyedDecoder::endArrayElement):
(WebKit::KeyedDecoder::endArray):
* Shared/cf/KeyedDecoder.h:

Create a WebKit KeyedEncoder/Decoder and use to encode/decode IDBKeyPaths:
* DatabaseProcess/IndexedDB/IDBSerialization.cpp:
(WebKit::serializeIDBKeyPath):
(WebKit::deserializeIDBKeyPath):
* DatabaseProcess/IndexedDB/IDBSerialization.h:

* DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
(WebKit::UniqueIDBDatabaseBackingStoreSQLite::createObjectStore):

* WebKit2.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162148 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBKeyPath.cpp
Source/WebCore/Modules/indexeddb/IDBKeyPath.h
Source/WebCore/WebCore.exp.in
Source/WebCore/platform/KeyedCoding.h
Source/WebKit2/ChangeLog
Source/WebKit2/DatabaseProcess/IndexedDB/IDBSerialization.cpp
Source/WebKit2/DatabaseProcess/IndexedDB/IDBSerialization.h
Source/WebKit2/DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp
Source/WebKit2/Shared/cf/KeyedDecoder.cpp [new file with mode: 0644]
Source/WebKit2/Shared/cf/KeyedDecoder.h [new file with mode: 0644]
Source/WebKit2/Shared/cf/KeyedEncoder.cpp
Source/WebKit2/Shared/cf/KeyedEncoder.h
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj