This is a simple memo for myself about web sql databse function flow.
Java script code
Java script code
var db = openDatabase("Todo", "1.0", "Todo manager", 1024*1024);
WebKit code
// call window.openDatabase
PassRefPtr<Database> DOMWindowSQLDatabase::openDatabase(DOMWindow* window, const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode& ec)
// Database::openDatabase
PassRefPtr<Database> Database::openDatabase(ScriptExecutionContext* context, const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode& e)
PassRefPtr<Database> Database::openDatabase(ScriptExecutionContext* context, const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode& e)
// call Database & AbstractDatabase constructor
Database::Database(ScriptExecutionContext* context, const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize)
: AbstractDatabase(context, name, expectedVersion, displayName, estimatedSize, AsyncDatabase)
, m_transactionInProgress(false)
, m_isTransactionQueueEnabled(true)
, m_deleted(false)
// Insert database into tracker (called in constructor of AbstractDatabase)
String DatabaseTracker::fullPathForDatabase(SecurityOrigin* origin, const String& name, bool createIfNotExists)
String DatabaseTracker::fullPathForDatabaseNoLock(SecurityOrigin* origin, const String& name, bool createIfNotExists)
bool DatabaseTracker::addDatabase(SecurityOrigin* origin, const String& name, const String& path)
// open database
bool Database::openAndVerifyVersion(bool setVersionInNewDatabase, ExceptionCode& e, String& errorMessage)
bool Database::performOpenAndVerify(bool setVersionInNewDatabase, ExceptionCode& e, String& errorMessage)
void DatabaseThread::recordDatabaseOpen(Database* database)
// set database detail infomation
void DatabaseTracker::setDatabaseDetails(SecurityOrigin* origin, const String& name, const String& displayName, unsigned long estimatedSize)
>> return RefPtr<Database>
沒有留言:
張貼留言