[Webkit-unassigned] [Bug 68037] Implement WebKit side of IDBFactory::databaseNames

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Sep 14 10:56:23 PDT 2011


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





--- Comment #7 from Joshua Bell <jsbell at chromium.org>  2011-09-14 10:56:23 PST ---
(From update of attachment 107257)
View in context: https://bugs.webkit.org/attachment.cgi?id=107257&action=review

>> Source/WebCore/storage/IDBFactory.cpp:75
>> +    return m_factoryBackend->databaseNames(document->securityOrigin(), document->frame(), groupSettings->indexedDBDatabasePath(), groupSettings->indexedDBQuotaBytes(), IDBFactoryBackendInterface::DefaultBackingStore);
> 
> Remove the quota parameter from here and all the other databaseNames function signatures.

I had it removed, but had to put it back in when I realized I needed to call IDBLevelDBBackingStore::open(securityOrigin.get(), dataDir, maximumSize, fileIdentifier, this) / IDBSQLiteBackingStore::open(securityOrigin.get(), dataDir, maximumSize, fileIdentifier, this) in the case where the the backing store hasn't been added to m_backingStoreMap yet in IDBFactoryBackendImpl::databaseNames - I believe that's the case when the backing store has not yet been accessed for this origin during this session.

If that parameter can be removed from IDBLevelDBBackingStore::open / IDBSQLiteBackingStore::open (move the constant to those implementations) then this is easy. Otherwise, I'll need more guidance. We could add a BackingStore::openIfExists() that doesn't create if not present, etc.

>> Source/WebCore/storage/IDBFactory.h:49
>> +class IDBFactory : public RefCounted<IDBFactory>, public ActiveDOMObject {
> 
> I'm not 100% sure that this won't cause problems but we'll see.  Actually, what prompted you to make this an ActiveDOMObject?

IDBFactory::databaseNames() needed a ScriptExecutionContext. The two models I found are (1) annotate a method so that the method is passed a context for use within the method call, or (2) make the object an ActiveDOMObject which holds a handle to the document/SEC for the lifetime of the object. IDBFactory::open() was annotated in the IDL to take a SEC parameter, but IDBFactory::displayNames is an attribute in the IDL and those apparently can't be so annotated. I followed the ActiveDOMObject model used by some of the other IDB objects.

>> Source/WebCore/storage/IDBFactoryBackendImpl.cpp:104
>> +#endif
> 
> Yeah, it would be nice if this code could be de-duplicated.

Absolutely! Wanted to ensure it was all correct/necessary before touching the rest of the code.

>> Source/WebCore/storage/IDBSQLiteBackingStore.cpp:202
>> +    ASSERT(foundNames.isEmpty());
> 
> maybe we should have this assert in the LevelDB code too?

Agreed, I can sprinkle those in. (That was a copy/paste from the SQLite getIndexes) - did the same for getIndexes and getObjectStores

>> LayoutTests/storage/indexeddb/key-type-negative-zero-expected.txt:1
>> +Test IndexedDB key types
> 
> Put the zero stuff in a separate bug.

Will do.

-- 
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