[Webkit-unassigned] [Bug 55095] IndexedDB: fire versionchange events when calling setVersion

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Feb 24 14:48:40 PST 2011


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





--- Comment #4 from David Grogan <dgrogan at chromium.org>  2011-02-24 14:48:41 PST ---
(From update of attachment 83570)
View in context: https://bugs.webkit.org/attachment.cgi?id=83570&action=review

Switching away from connectionId isn't going smoothly.  I misunderstood the alternative (using the callbacks objects themselves as ids) you described, but I'm not sure where :(  I outlined the changes below that I think you talked about.  If I do them, it doesn't seem possible to compare the set of IDBDatabaseCallbacks (really IDBDatabaseCallbacksProxy) objects known to IDBDatabaseBackendImpl with the objects coming in to IDBDatabaseBackendImpl::close and IDBDatabaseBackendImpl::setVersion.  Could you let me know where I went wrong?

> Source/WebCore/storage/IDBDatabase.cpp:107
> +    m_backend->setVersion(version, request, m_connectionId, ec);

"m_connectionId" would change to "this"

> Source/WebCore/storage/IDBDatabaseBackendImpl.cpp:165
> +void IDBDatabaseBackendImpl::setVersion(const String& version, PassRefPtr<IDBCallbacks> prpCallbacks, int connectionId, ExceptionCode& ec)

Say I change "int connectionId" to "PassRefPtr<IDBDatabaseCallbacks> prpDBCallbacks", [next comment]

> Source/WebCore/storage/IDBDatabaseBackendImpl.cpp:174
> +        if (it->first != connectionId)

how do I preserve this check to not fire a versionchange event at the connection that initiated the version change?  It seems like I need to compare a RefPtr<IDBDatabaseCallbacksProxy> with each element in a ListHashSet<RefPtr<IDBDatabaseCallbacksProxy> >, but the IDBDatabaseCallbacksProxy objects are all different even though they wrap some of the same IDBDatabase objects.

>> Source/WebCore/storage/IDBDatabaseBackendImpl.h:106
>> +    typedef HashMap<int, RefPtr<IDBDatabaseCallbacks> > DatabaseCallbacksMap;
> 
> This can probably just be a HashSet.  Actually use a LinkHashSet so that you can iterate over them deterministically.  Make a comment that this is important.

What should the exact type of this be?  Right now I've got ListHashSet<RefPtr<IDBDatabaseCallbacks> >

> Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp:84
> +void WebIDBDatabaseImpl::setVersion(const WebString& version, WebIDBCallbacks* callbacks, int connectionId, WebExceptionCode& ec)

If I understand you correctly, "int connectionId" would change to "WebIDBDatabaseCallbacks* dbCallbacks"

> Source/WebKit/chromium/src/WebIDBDatabaseImpl.cpp:86
> +    m_databaseBackend->setVersion(version, IDBCallbacksProxy::create(callbacks), connectionId, ec);

and "connectionId" would change to "IDBDatabaseCallbacksProxy::create(dbCallbacks)"

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