Bug 46823

Summary: Finished IDBTransaction for IndexedDB
Product: WebKit Reporter: Jeremy Orlow <jorlow>
Component: New BugsAssignee: Jeremy Orlow <jorlow>
Status: RESOLVED FIXED    
Severity: Normal CC: andreip, steveblock
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Other   
OS: OS X 10.5   
Attachments:
Description Flags
Patch
none
Patch steveblock: review+

Jeremy Orlow
Reported 2010-09-29 11:07:24 PDT
Finished IDBTransaction for IndexedDB
Attachments
Patch (157.43 KB, patch)
2010-09-29 11:08 PDT, Jeremy Orlow
no flags
Patch (173.44 KB, patch)
2010-09-30 08:01 PDT, Jeremy Orlow
steveblock: review+
Jeremy Orlow
Comment 1 2010-09-29 11:08:07 PDT
Andrei Popescu
Comment 2 2010-09-30 04:39:00 PDT
Nice work, first round of comments: > class SerializedScriptValue : public ThreadSafeShared<SerializedScriptValue> { Hmm, this is a change that affects everyone so may be a perf issue for platforms that don't define USE_LOCKFREE_THREADSAFESHARED so now have to lock a mutex for each refcount. > if (!m_transaction->scheduleTask(createCallbackTask(&IDBCursorBackendImpl::updateInternal, this, value, callbacks))) The type parameters for the CrossThreadTask constructor are inferred form this call, so the Task object will store a raw IDBCursorBackendImpl pointer. If that happens to be released before the task is executed, we'll crash due to a dangling pointer. > scheduleTask(createCallbackTask(&IDBCursorBackendImpl::continueFunctionInternal, this, key, callbacks))) ditto > scheduleTask(createCallbackTask(&IDBCursorBackendImpl::removeInternal, this, callbacks))) ditto > scheduleTask(createCallbackTask(&IDBDatabaseBackendImpl::createObjectStoreInternal, this, name, keyPath, autoIncrement, callbacks))) ditto > scheduleTask(createCallbackTask(&IDBDatabaseBackendImpl::removeObjectStoreInternal, this, name, callbacks))) ditto > scheduleTask(createCallbackTask(&openCursorInternal, this, keyRange, direction, true, callbacks, transaction)) ditto > scheduleTask(createCallbackTask(&openCursorInternal, this, keyRange, direction, false, callbacks, transaction))) ditto > scheduleTask(createCallbackTask(&getInternal, this, key, true, callbacks))) ditto > scheduleTask(createCallbackTask(&getInternal, this, key, false, callbacks))) ditto > scheduleTask(createCallbackTask(&IDBObjectStoreBackendImpl::getInternal, this, key, callbacks))) ditto > RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_setVersionTransaction.get()); > 62 if (!m_setVersionTransaction) > 63 request->onError(IDBDatabaseError::create(IDBDatabaseException::NOT_ALLOWED_ERR, > "createObjectStore must be called from within a setVersion transaction.")); Nice but it won't work after merging with 46883, as we lose the callbacks param. I'm updating that patch to make this throw an exception instead.
Andrei Popescu
Comment 3 2010-09-30 07:05:41 PDT
One more comment: > oid IDBTransactionBackendImpl::abort() This needs to abort the timer. My bug.
Jeremy Orlow
Comment 4 2010-09-30 07:28:23 PDT
(In reply to comment #2) > Nice work, first round of comments: > > > class SerializedScriptValue : public ThreadSafeShared<SerializedScriptValue> { > > Hmm, this is a change that affects everyone so may be a perf issue for platforms that don't define USE_LOCKFREE_THREADSAFESHARED so now have to lock a mutex for each refcount. I too was worried about this, so I did some research: It's mostly just used for history push state, indexedDB, message ports, and event source. None of them should have too much ref count thrashing (they use pointers in many cases). So I'm pretty sure this won't cause a regression. If we're super worried or see performance issues, we could probably leave it single threaded and simply copy the underlying string.
Jeremy Orlow
Comment 5 2010-09-30 08:01:49 PDT
Steve Block
Comment 6 2010-09-30 09:28:21 PDT
Comment on attachment 69335 [details] Patch rubberstamp after discussion with andrei
Jeremy Orlow
Comment 7 2010-09-30 09:56:13 PDT
Note You need to log in before you can comment on or make changes to this bug.