[Webkit-unassigned] [Bug 62780] Migrate SQLite backing store to LevelDB backing store for Indexeddb.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jun 16 06:20:40 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=62780





--- Comment #2 from Hans Wennborg <hans at chromium.org>  2011-06-16 06:20:40 PST ---
(From update of attachment 97405)
It's great to see this uploaded!

View in context: https://bugs.webkit.org/attachment.cgi?id=97405&action=review

> Source/WebCore/storage/IDBFactoryBackendImpl.cpp:82
>  

Some of this patch overlaps with the patch in Bug 62382. Let's get that one landed first.

> Source/WebCore/storage/IDBFactoryBackendImpl.cpp:131
> +    String toUniqueIdentifier = securityOrigin->databaseIdentifier() + "@" + name + String::format("@%d", LevelDBBackingStore);

We have code for creating these identifiers in a couple of places now. May be worth moving it out to a function or something.

> Source/WebCore/storage/IDBFactoryBackendImpl.cpp:161
> +        return false;

Are we migrating the whole origin or just one database?

I think we should do the whole origin. That way we also don't need to involve an IDBDatabaseBackendImpl, we can just dig out all the database names from the IDBBackingStore.

In fact, I'd love to see methods like this..

IDBFactoryBackendImpl::migrate(SecurityOrigin, dataDir, ...) - this guy opens and/or creates backingstores in the right places

static migrateBackingStore(IDBBackingStore* from, IDBBackingStore *to) - this guy migrates an entire backing store from another (calling out to helper functions below)
static migrateDatabase (IDBBackingStore* from, IDBBackingStore *to, String databaseName) - this migrates a single database
(maybe a migrateObjectStore function too)

> Source/WebCore/storage/IDBFactoryBackendImpl.cpp:196
> +            RefPtr<IDBBackingStore::Cursor> cursor = fromBackingStore->openObjectStoreCursor(fromDatabaseBackend->id(), fromObjStoreIds[i], 0, IDBCursor::NEXT);

I would have used the ForEachObjectStoreRecord() method, but I'm not sure that matters.

> Source/WebCore/storage/IDBFactoryBackendImpl.cpp:219
> +                if (!toBackingStore->createIndex(toDatabaseId, assignedObjectStoreId, name, keyPath, idxUnique[j], indexId))

createIndex doesn't populate the index (sorry, the name isn't that clear), so we'll need to do that too, and the layout test should test for it.
Maybe we can use openIndexKeyCursor(), or we can add a function similar to forEachObjectStoreRecord()

> Source/WebCore/storage/IDBSQLiteBackingStore.cpp:1006
> +    return false;

If we just want to check for file existence, we should simplify this to return fileExists(path) :)

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list