Skip to content
  • beidson@apple.com's avatar
    Use KeyedCoding as a persistent storage mechanism for blobs · 28f5727e
    beidson@apple.com authored
    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: http://svn.webkit.org/repository/webkit/trunk@162148 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    28f5727e