WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
patch
patch (text/plain), 25.96 KB, created by
Dumitru Daniliuc
on 2010-06-30 16:01:49 PDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Dumitru Daniliuc
Created:
2010-06-30 16:01:49 PDT
Size:
25.96 KB
patch
obsolete
>Index: WebCore/ChangeLog >=================================================================== >--- WebCore/ChangeLog (revision 62210) >+++ WebCore/ChangeLog (working copy) >@@ -1,3 +1,63 @@ >+2010-06-30 Dumitru Daniliuc <dumi@chromium.org> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ DB clean up. >+ https://bugs.webkit.org/show_bug.cgi?id=41404 >+ >+ 1. Made all DatabaseTasks internal classes of Database and made >+ the Database methods called by those tasks private. >+ 2. Removed the Database::stop{ed}() methods. >+ 3. Removed the code that kept track of open databases from >+ ScriptExecutionContext (no longer needed) >+ 4. Made minor changes to Database::closeImmediately() to make it >+ possible for DatabaseThread to call that method instead of >+ close(). >+ 5. Minor fix to DatabaseTracker: addOpenDatabase() should call >+ OriginQuotaManager::addDatabase() if the origin quota manager >+ is not tracking this origin. >+ 6. Removed Database::performPolicyChecks(). We already update the >+ DB size after each transaction, and we enforce a max size for >+ the DB at the beginning of each transaction. >+ >+ * dom/ScriptExecutionContext.cpp: >+ (WebCore::ScriptExecutionContext::stopDatabases): >+ * dom/ScriptExecutionContext.h: >+ (WebCore::ScriptExecutionContext::hasOpenDatabases): >+ * storage/Database.cpp: >+ (WebCore::Database::openDatabase): >+ (WebCore::Database::Database): >+ (WebCore::Database::markAsDeletedAndClose): >+ (WebCore::Database::close): >+ (WebCore::Database::closeImmediately): >+ * storage/Database.h: >+ * storage/DatabaseTask.cpp: >+ (WebCore::DatabaseTask::performTask): >+ (WebCore::Database::DatabaseOpenTask::DatabaseOpenTask): >+ (WebCore::Database::DatabaseOpenTask::doPerformTask): >+ (WebCore::Database::DatabaseOpenTask::debugTaskName): >+ (WebCore::Database::DatabaseCloseTask::DatabaseCloseTask): >+ (WebCore::Database::DatabaseCloseTask::doPerformTask): >+ (WebCore::Database::DatabaseCloseTask::debugTaskName): >+ (WebCore::Database::DatabaseTransactionTask::DatabaseTransactionTask): >+ (WebCore::Database::DatabaseTransactionTask::doPerformTask): >+ (WebCore::Database::DatabaseTransactionTask::debugTaskName): >+ (WebCore::Database::DatabaseTableNamesTask::DatabaseTableNamesTask): >+ (WebCore::Database::DatabaseTableNamesTask::doPerformTask): >+ (WebCore::Database::DatabaseTableNamesTask::debugTaskName): >+ * storage/DatabaseTask.h: >+ (WebCore::Database::DatabaseOpenTask::create): >+ (WebCore::Database::DatabaseCloseTask::create): >+ (WebCore::Database::DatabaseTransactionTask::create): >+ (WebCore::Database::DatabaseTableNamesTask::create): >+ * storage/DatabaseThread.cpp: >+ (WebCore::DatabaseThread::databaseThread): >+ * storage/DatabaseTracker.cpp: >+ (WebCore::DatabaseTracker::addOpenDatabase): >+ * storage/SQLTransaction.cpp: >+ (WebCore::SQLTransaction::executeSQL): >+ (WebCore::SQLTransaction::checkAndHandleClosedDatabase): >+ > 2010-06-30 Patrick Gansterer <paroga@paroga.com> > > Reviewed by Darin Adler. >Index: WebCore/dom/ScriptExecutionContext.cpp >=================================================================== >--- WebCore/dom/ScriptExecutionContext.cpp (revision 62210) >+++ WebCore/dom/ScriptExecutionContext.cpp (working copy) >@@ -109,38 +109,9 @@ DatabaseThread* ScriptExecutionContext:: > return m_databaseThread.get(); > } > >-void ScriptExecutionContext::addOpenDatabase(Database* database) >-{ >- ASSERT(isContextThread()); >- if (!m_openDatabaseSet) >- m_openDatabaseSet.set(new DatabaseSet()); >- >- ASSERT(!m_openDatabaseSet->contains(database)); >- m_openDatabaseSet->add(database); >-} >- >-void ScriptExecutionContext::removeOpenDatabase(Database* database) >-{ >- ASSERT(isContextThread()); >- ASSERT(m_openDatabaseSet && m_openDatabaseSet->contains(database)); >- if (!m_openDatabaseSet) >- return; >- m_openDatabaseSet->remove(database); >-} >- > void ScriptExecutionContext::stopDatabases(DatabaseTaskSynchronizer* cleanupSync) > { > ASSERT(isContextThread()); >- if (m_openDatabaseSet) { >- DatabaseSet::iterator i = m_openDatabaseSet->begin(); >- DatabaseSet::iterator end = m_openDatabaseSet->end(); >- for (; i != end; ++i) { >- (*i)->stop(); >- if (m_databaseThread) >- m_databaseThread->unscheduleDatabaseTasks(*i); >- } >- } >- > if (m_databaseThread) > m_databaseThread->requestTermination(cleanupSync); > else if (cleanupSync) >Index: WebCore/dom/ScriptExecutionContext.h >=================================================================== >--- WebCore/dom/ScriptExecutionContext.h (revision 62210) >+++ WebCore/dom/ScriptExecutionContext.h (working copy) >@@ -70,8 +70,6 @@ namespace WebCore { > DatabaseThread* databaseThread(); > void setHasOpenDatabases() { m_hasOpenDatabases = true; } > bool hasOpenDatabases() const { return m_hasOpenDatabases; } >- void addOpenDatabase(Database*); >- void removeOpenDatabase(Database*); > // When the database cleanup is done, cleanupSync will be signalled. > void stopDatabases(DatabaseTaskSynchronizer*); > #endif >@@ -160,8 +158,6 @@ namespace WebCore { > #if ENABLE(DATABASE) > RefPtr<DatabaseThread> m_databaseThread; > bool m_hasOpenDatabases; // This never changes back to false, even after the database thread is closed. >- typedef HashSet<Database* > DatabaseSet; >- OwnPtr<DatabaseSet> m_openDatabaseSet; > #endif > > #if ENABLE(FILE_READER) || ENABLE(FILE_WRITER) >Index: WebCore/storage/Database.cpp >=================================================================== >--- WebCore/storage/Database.cpp (revision 62210) >+++ WebCore/storage/Database.cpp (working copy) >@@ -99,7 +99,6 @@ PassRefPtr<Database> Database::openDatab > > if (!database->openAndVerifyVersion(!creationCallback, e)) { > LOG(StorageAPI, "Failed to open and verify version (expected %s) of database %s", expectedVersion.ascii().data(), database->databaseDebugName().ascii().data()); >- context->removeOpenDatabase(database.get()); > DatabaseTracker::tracker().removeOpenDatabase(database.get()); > return 0; > } >@@ -133,14 +132,11 @@ Database::Database(ScriptExecutionContex > , m_transactionInProgress(false) > , m_isTransactionQueueEnabled(true) > , m_deleted(false) >- , m_stopped(false) > { > m_databaseThreadSecurityOrigin = m_contextThreadSecurityOrigin->threadsafeCopy(); > > ScriptController::initializeThreading(); > ASSERT(m_scriptExecutionContext->databaseThread()); >- >- m_scriptExecutionContext->addOpenDatabase(this); > } > > class DerefContextTask : public ScriptExecutionContext::Task { >@@ -202,107 +198,49 @@ void Database::markAsDeletedAndClose() > return; > } > >- m_scriptExecutionContext->databaseThread()->unscheduleDatabaseTasks(this); >- > DatabaseTaskSynchronizer synchronizer; >- OwnPtr<DatabaseCloseTask> task = DatabaseCloseTask::create(this, DoNotRemoveDatabaseFromContext, &synchronizer); >+ OwnPtr<DatabaseCloseTask> task = DatabaseCloseTask::create(this, &synchronizer); > > m_scriptExecutionContext->databaseThread()->scheduleImmediateTask(task.release()); > synchronizer.waitForTaskCompletion(); >- >- // DatabaseCloseTask tells Database::close not to do these two removals so that we can do them here synchronously. >- m_scriptExecutionContext->removeOpenDatabase(this); >- DatabaseTracker::tracker().removeOpenDatabase(this); > } > >-class ContextRemoveOpenDatabaseTask : public ScriptExecutionContext::Task { >-public: >- static PassOwnPtr<ContextRemoveOpenDatabaseTask> create(PassRefPtr<Database> database) >- { >- return new ContextRemoveOpenDatabaseTask(database); >- } >- >- virtual void performTask(ScriptExecutionContext* context) >- { >- context->removeOpenDatabase(m_database.get()); >- DatabaseTracker::tracker().removeOpenDatabase(m_database.get()); >- } >- >- virtual bool isCleanupTask() const { return true; } >- >-private: >- ContextRemoveOpenDatabaseTask(PassRefPtr<Database> database) >- : m_database(database) >- { >- } >- >- RefPtr<Database> m_database; >-}; >- >-void Database::close(ClosePolicy policy) >+void Database::close() > { >- RefPtr<Database> protect = this; >- > ASSERT(m_scriptExecutionContext->databaseThread()); > ASSERT(currentThread() == m_scriptExecutionContext->databaseThread()->getThreadID()); > > closeDatabase(); > > // Must ref() before calling databaseThread()->recordDatabaseClosed(). >+ RefPtr<Database> protect = this; > m_scriptExecutionContext->databaseThread()->recordDatabaseClosed(this); > m_scriptExecutionContext->databaseThread()->unscheduleDatabaseTasks(this); >- if (policy == RemoveDatabaseFromContext) >- m_scriptExecutionContext->postTask(ContextRemoveOpenDatabaseTask::create(this)); >+ DatabaseTracker::tracker().removeOpenDatabase(this); > } > > void Database::closeImmediately() > { > DatabaseThread* databaseThread = scriptExecutionContext()->databaseThread(); >- if (databaseThread && !databaseThread->terminationRequested()) { >- stop(); >- databaseThread->scheduleTask(DatabaseCloseTask::create(this, Database::RemoveDatabaseFromContext, 0)); >+ if (databaseThread && opened()) { >+ { >+ MutexLocker locker(m_transactionInProgressMutex); >+ m_isTransactionQueueEnabled = false; >+ m_transactionInProgress = false; >+ } >+ >+ if (currentThread() == databaseThread->getThreadID()) >+ close(); >+ else >+ databaseThread->scheduleImmediateTask(DatabaseCloseTask::create(this, 0)); > } > } > >-void Database::stop() >-{ >- // FIXME: The net effect of the following code is to remove all pending transactions and statements, but allow the current statement >- // to run to completion. In the future we can use the sqlite3_progress_handler or sqlite3_interrupt interfaces to cancel the current >- // statement in response to close(), as well. >- >- // This method is meant to be used as an analog to cancelling a loader, and is used when a document is shut down as the result of >- // a page load or closing the page >- m_stopped = true; >- >- { >- MutexLocker locker(m_transactionInProgressMutex); >- m_isTransactionQueueEnabled = false; >- m_transactionInProgress = false; >- } >- >- if (m_scriptExecutionContext->databaseThread()) >- m_scriptExecutionContext->databaseThread()->unscheduleDatabaseTasks(this); >-} >- > unsigned long long Database::maximumSize() const > { > return DatabaseTracker::tracker().getMaxSizeForDatabase(this); > } > >-void Database::performPolicyChecks() >-{ >- // FIXME: Code similar to the following will need to be run to enforce the per-origin size limit the spec mandates. >- // Additionally, we might need a way to pause the database thread while the UA prompts the user for permission to >- // increase the size limit >- >- /* >- if (m_databaseAuthorizer->lastActionIncreasedSize()) >- DatabaseTracker::scheduleFileSizeCheckOnMainThread(this); >- */ >- >- notImplemented(); >-} >- > bool Database::performOpenAndVerify(bool setVersionInNewDatabase, ExceptionCode& e) > { > if (AbstractDatabase::performOpenAndVerify(setVersionInNewDatabase, e)) { >Index: WebCore/storage/Database.h >=================================================================== >--- WebCore/storage/Database.h (revision 62210) >+++ WebCore/storage/Database.h (working copy) >@@ -71,40 +71,37 @@ public: > virtual void markAsDeletedAndClose(); > bool deleted() const { return m_deleted; } > >- enum ClosePolicy { DoNotRemoveDatabaseFromContext, RemoveDatabaseFromContext }; >- void close(ClosePolicy); > virtual void closeImmediately(); > >- void stop(); >- bool stopped() const { return m_stopped; } >- > unsigned long long databaseSize() const; > unsigned long long maximumSize() const; > >- // Called from DatabaseThread, must be prepared to work on the background thread >- void performPolicyChecks(); >- >- virtual bool performOpenAndVerify(bool setVersionInNewDatabase, ExceptionCode&); >- >- void inProgressTransactionCompleted(); > void scheduleTransactionCallback(SQLTransaction*); > void scheduleTransactionStep(SQLTransaction*, bool immediately = false); > >- Vector<String> performGetTableNames(); >- > SQLTransactionClient* transactionClient() const; > SQLTransactionCoordinator* transactionCoordinator() const; > > void incrementalVacuumIfNeeded(); > > private: >+ class DatabaseOpenTask; >+ class DatabaseCloseTask; >+ class DatabaseTransactionTask; >+ class DatabaseTableNamesTask; >+ > Database(ScriptExecutionContext*, const String& name, const String& expectedVersion, > const String& displayName, unsigned long estimatedSize); > > bool openAndVerifyVersion(bool setVersionInNewDatabase, ExceptionCode&); >+ virtual bool performOpenAndVerify(bool setVersionInNewDatabase, ExceptionCode&); >+ void close(); > >+ void inProgressTransactionCompleted(); > void scheduleTransaction(); > >+ Vector<String> performGetTableNames(); >+ > static void deliverPendingCallback(void*); > > Deque<RefPtr<SQLTransaction> > m_transactionQueue; >@@ -115,7 +112,6 @@ private: > RefPtr<SecurityOrigin> m_databaseThreadSecurityOrigin; > > bool m_deleted; >- bool m_stopped; > }; > > } // namespace WebCore >Index: WebCore/storage/DatabaseTask.cpp >=================================================================== >--- WebCore/storage/DatabaseTask.cpp (revision 62210) >+++ WebCore/storage/DatabaseTask.cpp (working copy) >@@ -78,7 +78,6 @@ void DatabaseTask::performTask() > > m_database->resetAuthorizer(); > doPerformTask(); >- m_database->performPolicyChecks(); > > if (m_synchronizer) > m_synchronizer->taskCompleted(); >@@ -87,7 +86,7 @@ void DatabaseTask::performTask() > // *** DatabaseOpenTask *** > // Opens the database file and verifies the version matches the expected version. > >-DatabaseOpenTask::DatabaseOpenTask(Database* database, bool setVersionInNewDatabase, DatabaseTaskSynchronizer* synchronizer, ExceptionCode& code, bool& success) >+Database::DatabaseOpenTask::DatabaseOpenTask(Database* database, bool setVersionInNewDatabase, DatabaseTaskSynchronizer* synchronizer, ExceptionCode& code, bool& success) > : DatabaseTask(database, synchronizer) > , m_setVersionInNewDatabase(setVersionInNewDatabase) > , m_code(code) >@@ -96,13 +95,13 @@ DatabaseOpenTask::DatabaseOpenTask(Datab > ASSERT(synchronizer); // A task with output parameters is supposed to be synchronous. > } > >-void DatabaseOpenTask::doPerformTask() >+void Database::DatabaseOpenTask::doPerformTask() > { > m_success = database()->performOpenAndVerify(m_setVersionInNewDatabase, m_code); > } > > #ifndef NDEBUG >-const char* DatabaseOpenTask::debugTaskName() const >+const char* Database::DatabaseOpenTask::debugTaskName() const > { > return "DatabaseOpenTask"; > } >@@ -111,19 +110,18 @@ const char* DatabaseOpenTask::debugTaskN > // *** DatabaseCloseTask *** > // Closes the database. > >-DatabaseCloseTask::DatabaseCloseTask(Database* database, Database::ClosePolicy closePolicy, DatabaseTaskSynchronizer* synchronizer) >+Database::DatabaseCloseTask::DatabaseCloseTask(Database* database, DatabaseTaskSynchronizer* synchronizer) > : DatabaseTask(database, synchronizer) >- , m_closePolicy(closePolicy) > { > } > >-void DatabaseCloseTask::doPerformTask() >+void Database::DatabaseCloseTask::doPerformTask() > { >- database()->close(m_closePolicy); >+ database()->close(); > } > > #ifndef NDEBUG >-const char* DatabaseCloseTask::debugTaskName() const >+const char* Database::DatabaseCloseTask::debugTaskName() const > { > return "DatabaseCloseTask"; > } >@@ -132,24 +130,20 @@ const char* DatabaseCloseTask::debugTask > // *** DatabaseTransactionTask *** > // Starts a transaction that will report its results via a callback. > >-DatabaseTransactionTask::DatabaseTransactionTask(PassRefPtr<SQLTransaction> transaction) >+Database::DatabaseTransactionTask::DatabaseTransactionTask(PassRefPtr<SQLTransaction> transaction) > : DatabaseTask(transaction->database(), 0) > , m_transaction(transaction) > { > } > >-DatabaseTransactionTask::~DatabaseTransactionTask() >-{ >-} >- >-void DatabaseTransactionTask::doPerformTask() >+void Database::DatabaseTransactionTask::doPerformTask() > { > if (m_transaction->performNextStep()) > m_transaction->database()->inProgressTransactionCompleted(); > } > > #ifndef NDEBUG >-const char* DatabaseTransactionTask::debugTaskName() const >+const char* Database::DatabaseTransactionTask::debugTaskName() const > { > return "DatabaseTransactionTask"; > } >@@ -158,20 +152,20 @@ const char* DatabaseTransactionTask::deb > // *** DatabaseTableNamesTask *** > // Retrieves a list of all tables in the database - for WebInspector support. > >-DatabaseTableNamesTask::DatabaseTableNamesTask(Database* database, DatabaseTaskSynchronizer* synchronizer, Vector<String>& names) >+Database::DatabaseTableNamesTask::DatabaseTableNamesTask(Database* database, DatabaseTaskSynchronizer* synchronizer, Vector<String>& names) > : DatabaseTask(database, synchronizer) > , m_tableNames(names) > { > ASSERT(synchronizer); // A task with output parameters is supposed to be synchronous. > } > >-void DatabaseTableNamesTask::doPerformTask() >+void Database::DatabaseTableNamesTask::doPerformTask() > { > m_tableNames = database()->performGetTableNames(); > } > > #ifndef NDEBUG >-const char* DatabaseTableNamesTask::debugTaskName() const >+const char* Database::DatabaseTableNamesTask::debugTaskName() const > { > return "DatabaseTableNamesTask"; > } >Index: WebCore/storage/DatabaseTask.h >=================================================================== >--- WebCore/storage/DatabaseTask.h (revision 62210) >+++ WebCore/storage/DatabaseTask.h (working copy) >@@ -60,7 +60,6 @@ private: > }; > > class DatabaseTask : public Noncopyable { >- friend class Database; > public: > virtual ~DatabaseTask(); > >@@ -83,15 +82,15 @@ private: > #endif > }; > >-class DatabaseOpenTask : public DatabaseTask { >+class Database::DatabaseOpenTask : public DatabaseTask { > public: >- static PassOwnPtr<DatabaseOpenTask> create(Database* db, bool setVersionInNewDatabase, DatabaseTaskSynchronizer* synchronizer, ExceptionCode& code, bool& success) >+ static PassOwnPtr<Database::DatabaseOpenTask> create(Database* db, bool setVersionInNewDatabase, DatabaseTaskSynchronizer* synchronizer, ExceptionCode& code, bool& success) > { >- return new DatabaseOpenTask(db, setVersionInNewDatabase, synchronizer, code, success); >+ return new Database::DatabaseOpenTask(db, setVersionInNewDatabase, synchronizer, code, success); > } > > private: >- DatabaseOpenTask(Database*, bool setVersionInNewDatabase, DatabaseTaskSynchronizer*, ExceptionCode&, bool& success); >+ Database::DatabaseOpenTask(Database*, bool setVersionInNewDatabase, DatabaseTaskSynchronizer*, ExceptionCode&, bool& success); > > virtual void doPerformTask(); > #ifndef NDEBUG >@@ -103,37 +102,34 @@ private: > bool& m_success; > }; > >-class DatabaseCloseTask : public DatabaseTask { >+class Database::DatabaseCloseTask : public DatabaseTask { > public: >- static PassOwnPtr<DatabaseCloseTask> create(Database* db, Database::ClosePolicy closePolicy, DatabaseTaskSynchronizer* synchronizer) >- { >- return new DatabaseCloseTask(db, closePolicy, synchronizer); >+ static PassOwnPtr<Database::DatabaseCloseTask> create(Database* db, DatabaseTaskSynchronizer* synchronizer) >+ { >+ return new Database::DatabaseCloseTask(db, synchronizer); > } > > private: >- DatabaseCloseTask(Database*, Database::ClosePolicy, DatabaseTaskSynchronizer*); >+ Database::DatabaseCloseTask(Database*, DatabaseTaskSynchronizer*); > > virtual void doPerformTask(); > #ifndef NDEBUG > virtual const char* debugTaskName() const; > #endif >- >- Database::ClosePolicy m_closePolicy; > }; > >-class DatabaseTransactionTask : public DatabaseTask { >+class Database::DatabaseTransactionTask : public DatabaseTask { > public: > // Transaction task is never synchronous, so no 'synchronizer' parameter. >- static PassOwnPtr<DatabaseTransactionTask> create(PassRefPtr<SQLTransaction> transaction) >+ static PassOwnPtr<Database::DatabaseTransactionTask> create(PassRefPtr<SQLTransaction> transaction) > { >- return new DatabaseTransactionTask(transaction); >+ return new Database::DatabaseTransactionTask(transaction); > } > > SQLTransaction* transaction() const { return m_transaction.get(); } > >- virtual ~DatabaseTransactionTask(); > private: >- DatabaseTransactionTask(PassRefPtr<SQLTransaction>); >+ Database::DatabaseTransactionTask(PassRefPtr<SQLTransaction>); > > virtual void doPerformTask(); > #ifndef NDEBUG >@@ -143,15 +139,15 @@ private: > RefPtr<SQLTransaction> m_transaction; > }; > >-class DatabaseTableNamesTask : public DatabaseTask { >+class Database::DatabaseTableNamesTask : public DatabaseTask { > public: >- static PassOwnPtr<DatabaseTableNamesTask> create(Database* db, DatabaseTaskSynchronizer* synchronizer, Vector<String>& names) >+ static PassOwnPtr<Database::DatabaseTableNamesTask> create(Database* db, DatabaseTaskSynchronizer* synchronizer, Vector<String>& names) > { >- return new DatabaseTableNamesTask(db, synchronizer, names); >+ return new Database::DatabaseTableNamesTask(db, synchronizer, names); > } > > private: >- DatabaseTableNamesTask(Database*, DatabaseTaskSynchronizer*, Vector<String>& names); >+ Database::DatabaseTableNamesTask(Database*, DatabaseTaskSynchronizer*, Vector<String>& names); > > virtual void doPerformTask(); > #ifndef NDEBUG >Index: WebCore/storage/DatabaseThread.cpp >=================================================================== >--- WebCore/storage/DatabaseThread.cpp (revision 62210) >+++ WebCore/storage/DatabaseThread.cpp (working copy) >@@ -113,14 +113,14 @@ void* DatabaseThread::databaseThread() > openSetCopy.swap(m_openDatabaseSet); > DatabaseSet::iterator end = openSetCopy.end(); > for (DatabaseSet::iterator it = openSetCopy.begin(); it != end; ++it) >- (*it)->close(Database::RemoveDatabaseFromContext); >+ (*it)->closeImmediately(); > } > > // Detach the thread so its resources are no longer of any concern to anyone else > detachThread(m_threadID); > > DatabaseTaskSynchronizer* cleanupSync = m_cleanupSync; >- >+ > // Clear the self refptr, possibly resulting in deletion > m_selfRef = 0; > >Index: WebCore/storage/DatabaseTracker.cpp >=================================================================== >--- WebCore/storage/DatabaseTracker.cpp (revision 62210) >+++ WebCore/storage/DatabaseTracker.cpp (working copy) >@@ -508,8 +508,10 @@ void DatabaseTracker::addOpenDatabase(Ab > LOG(StorageAPI, "Added open Database %s (%p)\n", database->stringIdentifier().ascii().data(), database); > > Locker<OriginQuotaManager> quotaManagerLocker(originQuotaManager()); >- if (!originQuotaManager().tracksOrigin(database->securityOrigin())) >+ if (!originQuotaManager().tracksOrigin(database->securityOrigin())) { > originQuotaManager().trackOrigin(database->securityOrigin()); >+ originQuotaManager().addDatabase(database->securityOrigin(), database->stringIdentifier(), database->fileName()); >+ } > } > > MutexLocker lockDatabase(m_databaseGuard); >Index: WebCore/storage/SQLTransaction.cpp >=================================================================== >--- WebCore/storage/SQLTransaction.cpp (revision 62210) >+++ WebCore/storage/SQLTransaction.cpp (working copy) >@@ -89,7 +89,7 @@ SQLTransaction::~SQLTransaction() > > void SQLTransaction::executeSQL(const String& sqlStatement, const Vector<SQLValue>& arguments, PassRefPtr<SQLStatementCallback> callback, PassRefPtr<SQLStatementErrorCallback> callbackError, ExceptionCode& e) > { >- if (!m_executeSqlAllowed || m_database->stopped()) { >+ if (!m_executeSqlAllowed || !m_database->opened()) { > e = INVALID_STATE_ERR; > return; > } >@@ -149,7 +149,7 @@ const char* SQLTransaction::debugStepNam > > void SQLTransaction::checkAndHandleClosedDatabase() > { >- if (!m_database->stopped()) >+ if (m_database->opened()) > return; > > // If the database was stopped, don't do anything and cancel queued work >Index: LayoutTests/ChangeLog >=================================================================== >--- LayoutTests/ChangeLog (revision 62210) >+++ LayoutTests/ChangeLog (working copy) >@@ -1,3 +1,12 @@ >+2010-06-30 Dumitru Daniliuc <dumi@chromium.org> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Minor change to a DB test to make it run correctly with run-webkit-tests --iterations N. >+ https://bugs.webkit.org/show_bug.cgi?id=41404 >+ >+ * storage/open-database-creation-callback.html: >+ > 2010-06-30 Beth Dakin <bdakin@apple.com> > > Reviewed by Dan Bernstein. >Index: LayoutTests/storage/open-database-creation-callback.html >=================================================================== >--- LayoutTests/storage/open-database-creation-callback.html (revision 62210) >+++ LayoutTests/storage/open-database-creation-callback.html (working copy) >@@ -26,7 +26,8 @@ function runTest() > > // Open a new database with a creation callback, and make sure the creation callback is queued > var creationCallbackCalled1 = false; >- var db1 = openDatabase("OpenDatabaseCreationCallback1", "1.0", "", 1, >+ var db1Name = "OpenDatabaseCreationCallback1" + (new Date()).getTime(); >+ var db1 = openDatabase(db1Name, "1.0", "", 1, > function(db) { > creationCallbackCalled1 = true; > if (db.version != "") { >@@ -52,7 +53,7 @@ function runTest() > // a null handle and throw a INVALID_STATE_ERR exception. > var db1Fail = null; > try { >- db1Fail = openDatabase("OpenDatabaseCreationCallback1", "1.0", "", 1); >+ db1Fail = openDatabase(db1Name, "1.0", "", 1); > log("This statement should not have been executed; an INVALID_STATE_ERR exception should've been thrown."); > finishTest(); > } catch(err) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
dumi
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 41404
:
60160
|
60187
|
60344