Bug 102732 - IndexedDB: Change frontend to call IDBDatabaseBackendInterface::createTransaction()
Summary: IndexedDB: Change frontend to call IDBDatabaseBackendInterface::createTransac...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alec Flett
URL:
Keywords:
Depends on: 102730
Blocks: 102733 102736 102741
  Show dependency treegraph
 
Reported: 2012-11-19 16:11 PST by Alec Flett
Modified: 2012-11-28 15:43 PST (History)
5 users (show)

See Also:


Attachments
Patch (10.81 KB, patch)
2012-11-27 11:39 PST, Alec Flett
no flags Details | Formatted Diff | Diff
Patch (11.12 KB, patch)
2012-11-27 12:20 PST, Alec Flett
no flags Details | Formatted Diff | Diff
Patch for landing (10.88 KB, patch)
2012-11-28 15:09 PST, Alec Flett
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alec Flett 2012-11-19 16:11:38 PST
Part of the transaction id refactor

In IDBDatabase::transaction, make sure we call IDBDatabaseBackend::createTransaction() rather than transaction()
Comment 1 Alec Flett 2012-11-19 16:42:43 PST
Rather than calling through IDBTransactionBackendInterface, backend object store calls should just call through IDBDatabase with a transaction id

specifically: (leaving out the details of request/callback hookup/etc)
* IDBObjectStoreBackendInterface::openCursor() becomes 
  IDBDatabaseBackendInterface::openCursor(transaction_id, objectstore_id, -1, keyRange, direction, key=false);
* IDBObjectStoreBackendInterface::openKeyCursor() becomes 
  IDBDatabaseBackendInterface::openCursor(transaction_id, objectstore_id, -1, keyRange, direction, key=true);
* IDBObjectStoreBackendInterface::count() becomes 
  IDBDatabaseBackendInterface::count(transaction_id, objectstore_id, -1, keyRange);
* IDBObjectStoreBackendInterface::get() becomes 
  IDBDatabaseBackendInterface::get(transaction_id, objectstore_id, -1, keyRange, key=false);
* IDBObjectStoreBackendInterface::put() becomes
  IDBDatabaseBackendInterface::put(transaction_id, objectstore_id, -1, key);
* IDBObjectStoreBackendInterface::deleteFunctiuon() becomes
  IDBDatabaseBackendInterface::deleteFunction(transaction_id, objectstore_id, -1, keyRange);
* IDBObjectStoreBackendInterface::clear() becomes
  IDBDatabaseBackendInterface::clear(transaction_id, objectstore_id);
* IDBObjectStoreBackendInterface::setIndexKeys() becomes
  IDBDatabaseBackendInterface::setIndexKeys(transaction_id, objectstore_id, index_ids, index_keys, ...);
* IDBObjectStoreBackendInterface::setIndexesReady() becomes
  IDBDatabaseBackendInterface::setIndexesReady(transaction_id, objectstore_id, index_ids);


This bug does not cover:
* IDBObjectStoreBackendInterface::createIndex()
* IDBObjectStoreBackendInterface::deleteIndex()

(I'm leaving openKeyCursor in here for now, even though it isn't yet implemented in the IDL or in the spec)
Comment 2 Alec Flett 2012-11-19 16:45:05 PST
[oops, wrong bug: ignore that comment 1]
Comment 3 Alec Flett 2012-11-27 11:39:15 PST
Created attachment 176310 [details]
Patch
Comment 4 Alec Flett 2012-11-27 11:39:43 PST
jsbell@ / dgrogan@ - a quick look before passing this along to tony?
Comment 5 David Grogan 2012-11-27 12:03:29 PST
Comment on attachment 176310 [details]
Patch

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

> Source/WebCore/Modules/indexeddb/IDBDatabase.cpp:80
> +    static int64_t currentTransactionId = 0;

This needs to be made thread-safe. A worker thread can race with the main thread here.

You might need AtomicallyInitializedStatic and atomicIncrement.

> Source/WebCore/Modules/indexeddb/IDBTransaction.h:73
> +    int64_t id() const;

Does anything use this or m_id? I guess they will be used when backend() and m_backend are deleted?
Comment 6 Alec Flett 2012-11-27 12:20:21 PST
Created attachment 176323 [details]
Patch
Comment 7 Alec Flett 2012-11-27 14:13:14 PST
tony@ - r? (this can't land until chrome is updated, which can't happen till the next webkit roll, that's why EWS is flailing)
Comment 8 Alec Flett 2012-11-28 15:09:02 PST
Created attachment 176585 [details]
Patch for landing
Comment 9 WebKit Review Bot 2012-11-28 15:43:21 PST
Comment on attachment 176585 [details]
Patch for landing

Clearing flags on attachment: 176585

Committed r136071: <http://trac.webkit.org/changeset/136071>
Comment 10 WebKit Review Bot 2012-11-28 15:43:25 PST
All reviewed patches have been landed.  Closing bug.