2012年5月13日 星期日

[WebKit] IndexedDB open()

This is a simple memo for myself about webkit function flow.

Java script code
var request = webkitIndexedDB.open("todos");


Webkit code

// get webkitIndexedDB object
static IDBFactory* webkitIndexedDB(DOMWindow*);

// call IDBFactory::open
PassRefPtr<IDBRequest> open(ScriptExecutionContext*, const String& name, ExceptionCode&);

// get IDBFactory.m_backend
RefPtr<IDBFactoryBackendInterface> m_backend;

// call IDBFactoryBackendInterface::open
virtual void open(const String& name, IDBCallbacks*, PassRefPtr<SecurityOrigin>, Frame*, const String& dataDir) = 0;

// call IDBFactoryBackendImpl::open to implement IDBFactoryBackendInterface::open
virtual void open(const String& name, IDBCallbacks*, PassRefPtr<SecurityOrigin>, Frame*, const String& dataDir);

// call IDBFactoryBackendImpl::openInternal in IDBFactoryBackendImpl::open
void openInternal(const String& name, IDBCallbacks*, PassRefPtr<SecurityOrigin>, const String& dataDir);

// branch 1, If database exist, call IDBDatabaseBackendImpl::openConnection
void openConnection(PassRefPtr<IDBCallbacks>);

        // call IDBDatabaseBackendImpl::openInternal
        void IDBDatabaseBackendImpl::openInternal()

        // call IDBBackingStore::getIDBDatabaseMetaData to get meta data from from physical database
        virtual bool getIDBDatabaseMetaData(const String& name, String& foundVersion, int64_t& foundId) = 0;

        // call IDBDatabaseBackendImpl::loadObjectStores
        void IDBDatabaseBackendImpl::loadObjectStores()

                // call IDBBackingStore::getObjectStores to get all ObjectStores from physical database
                virtual void getObjectStores(int64_t databaseId, Vector<int64_t>& foundIds, Vector<String>& foundNames, Vector<String>& foundKeyPaths, Vector<bool>& foundAutoIncrementFlags) = 0;

                // call IDBObjectStoreBackendImpl::create
                static PassRefPtr<IDBObjectStoreBackendImpl> create(IDBBackingStore* backingStore, int64_t databaseId, int64_t id, const String& name, const String& keyPath, bool autoIncrement)



// branch 2, If database doesn't exist, call IDBDatabaseBackendImpl::create
static PassRefPtr<IDBDatabaseBackendImpl> create(const String& name, IDBBackingStore* database, IDBTransactionCoordinator* coordinator, IDBFactoryBackendImpl* factory, const String& uniqueIdentifier)


>>> back to trunk
// call IDBCallbacks::onSuccess
void IDBRequest::onSuccess(PassRefPtr<IDBDatabaseBackendInterface> backend)

// call IDBDatabase::create
PassRefPtr<IDBDatabase> IDBDatabase::create(ScriptExecutionContext* context, PassRefPtr<IDBDatabaseBackendInterface> database)

// create request result for IDBRequest
static PassRefPtr<IDBAny> create(PassRefPtr<T> idbObject)

// summit success event
static IDBRequest::PassRefPtr<Event> createSuccessEvent()
        void IDBRequest::enqueueEvent(PassRefPtr<Event> event)



沒有留言:

張貼留言