Clean the chromium bits of WebCore's WebDatabase
authorbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Apr 2013 20:52:10 +0000 (20:52 +0000)
committerbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Apr 2013 20:52:10 +0000 (20:52 +0000)
https://bugs.webkit.org/show_bug.cgi?id=114010

Reviewed by Ryosuke Niwa.

* Modules/webdatabase/AbstractDatabaseServer.h:
* Modules/webdatabase/ChangeVersionWrapper.cpp:
(WebCore::ChangeVersionWrapper::performPreflight):
(WebCore::ChangeVersionWrapper::performPostflight):
* Modules/webdatabase/Database.cpp:
* Modules/webdatabase/Database.h:
(Database):
* Modules/webdatabase/DatabaseBackend.cpp:
(WebCore::DatabaseBackend::openAndVerifyVersion):
* Modules/webdatabase/DatabaseBackendBase.cpp:
(WebCore::DoneCreatingDatabaseOnExitCaller::~DoneCreatingDatabaseOnExitCaller):
(WebCore::DatabaseBackendBase::performOpenAndVerify):
(WebCore::DatabaseBackendBase::getActualVersionForTransaction):
(WebCore::DatabaseBackendBase::incrementalVacuumIfNeeded):
* Modules/webdatabase/DatabaseBackendBase.h:
(DatabaseBackendBase):
* Modules/webdatabase/DatabaseBackendSync.cpp:
(WebCore::DatabaseBackendSync::openAndVerifyVersion):
* Modules/webdatabase/DatabaseContext.cpp:
(WebCore::DatabaseContext::databaseExceededQuota):
* Modules/webdatabase/DatabaseManager.cpp:
* Modules/webdatabase/DatabaseManager.h:
(DatabaseManager):
* Modules/webdatabase/DatabaseServer.cpp:
(WebCore::DatabaseServer::initialize):
(WebCore::DatabaseServer::setClient):
(WebCore::DatabaseServer::databaseDirectoryPath):
(WebCore::DatabaseServer::setDatabaseDirectoryPath):
(WebCore::DatabaseServer::openDatabase):
* Modules/webdatabase/DatabaseServer.h:
* Modules/webdatabase/DatabaseSync.cpp:
(WebCore::DatabaseSync::changeVersion):
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::canEstablishDatabase):
(WebCore::DatabaseTracker::retryCanEstablishDatabase):
* Modules/webdatabase/DatabaseTracker.h:
(WebCore):
(DatabaseTracker):
* Modules/webdatabase/SQLStatementBackend.cpp:
(WebCore::SQLStatementBackend::execute):
(WebCore::SQLStatementBackend::setDatabaseDeletedError):
(WebCore::SQLStatementBackend::setVersionMismatchedError):
(WebCore::SQLStatementBackend::setFailureDueToQuota):
* Modules/webdatabase/SQLStatementBackend.h:
(SQLStatementBackend):
* Modules/webdatabase/SQLTransaction.cpp:
(WebCore::SQLTransaction::deliverTransactionCallback):
(WebCore::SQLTransaction::deliverStatementCallback):
* Modules/webdatabase/SQLTransactionBackend.cpp:
(WebCore::SQLTransactionBackend::executeSQL):
(WebCore::SQLTransactionBackend::openTransactionAndPreflight):
(WebCore::SQLTransactionBackend::runCurrentStatementAndGetNextState):
(WebCore::SQLTransactionBackend::nextStateForCurrentStatementError):
(WebCore::SQLTransactionBackend::postflightAndCommit):
(WebCore::SQLTransactionBackend::acquireOriginLock):
(WebCore::SQLTransactionBackend::releaseOriginLockIfNeeded):
* Modules/webdatabase/SQLTransactionBackend.h:
(SQLTransactionBackend):
* Modules/webdatabase/SQLTransactionBackendSync.cpp:
(WebCore::SQLTransactionBackendSync::begin):
(WebCore::SQLTransactionBackendSync::commit):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@147796 268f45cc-cd09-0410-ab3c-d52691b4dbfc

23 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/webdatabase/AbstractDatabaseServer.h
Source/WebCore/Modules/webdatabase/ChangeVersionWrapper.cpp
Source/WebCore/Modules/webdatabase/Database.cpp
Source/WebCore/Modules/webdatabase/Database.h
Source/WebCore/Modules/webdatabase/DatabaseBackend.cpp
Source/WebCore/Modules/webdatabase/DatabaseBackendBase.cpp
Source/WebCore/Modules/webdatabase/DatabaseBackendBase.h
Source/WebCore/Modules/webdatabase/DatabaseBackendSync.cpp
Source/WebCore/Modules/webdatabase/DatabaseContext.cpp
Source/WebCore/Modules/webdatabase/DatabaseManager.cpp
Source/WebCore/Modules/webdatabase/DatabaseManager.h
Source/WebCore/Modules/webdatabase/DatabaseServer.cpp
Source/WebCore/Modules/webdatabase/DatabaseServer.h
Source/WebCore/Modules/webdatabase/DatabaseSync.cpp
Source/WebCore/Modules/webdatabase/DatabaseTracker.cpp
Source/WebCore/Modules/webdatabase/DatabaseTracker.h
Source/WebCore/Modules/webdatabase/SQLStatementBackend.cpp
Source/WebCore/Modules/webdatabase/SQLStatementBackend.h
Source/WebCore/Modules/webdatabase/SQLTransaction.cpp
Source/WebCore/Modules/webdatabase/SQLTransactionBackend.cpp
Source/WebCore/Modules/webdatabase/SQLTransactionBackend.h
Source/WebCore/Modules/webdatabase/SQLTransactionBackendSync.cpp

index ceaf73c..0c4bbe6 100644 (file)
@@ -1,3 +1,72 @@
+2013-04-05  Benjamin Poulain  <benjamin@webkit.org>
+
+        Clean the chromium bits of WebCore's WebDatabase
+        https://bugs.webkit.org/show_bug.cgi?id=114010
+
+        Reviewed by Ryosuke Niwa.
+
+        * Modules/webdatabase/AbstractDatabaseServer.h:
+        * Modules/webdatabase/ChangeVersionWrapper.cpp:
+        (WebCore::ChangeVersionWrapper::performPreflight):
+        (WebCore::ChangeVersionWrapper::performPostflight):
+        * Modules/webdatabase/Database.cpp:
+        * Modules/webdatabase/Database.h:
+        (Database):
+        * Modules/webdatabase/DatabaseBackend.cpp:
+        (WebCore::DatabaseBackend::openAndVerifyVersion):
+        * Modules/webdatabase/DatabaseBackendBase.cpp:
+        (WebCore::DoneCreatingDatabaseOnExitCaller::~DoneCreatingDatabaseOnExitCaller):
+        (WebCore::DatabaseBackendBase::performOpenAndVerify):
+        (WebCore::DatabaseBackendBase::getActualVersionForTransaction):
+        (WebCore::DatabaseBackendBase::incrementalVacuumIfNeeded):
+        * Modules/webdatabase/DatabaseBackendBase.h:
+        (DatabaseBackendBase):
+        * Modules/webdatabase/DatabaseBackendSync.cpp:
+        (WebCore::DatabaseBackendSync::openAndVerifyVersion):
+        * Modules/webdatabase/DatabaseContext.cpp:
+        (WebCore::DatabaseContext::databaseExceededQuota):
+        * Modules/webdatabase/DatabaseManager.cpp:
+        * Modules/webdatabase/DatabaseManager.h:
+        (DatabaseManager):
+        * Modules/webdatabase/DatabaseServer.cpp:
+        (WebCore::DatabaseServer::initialize):
+        (WebCore::DatabaseServer::setClient):
+        (WebCore::DatabaseServer::databaseDirectoryPath):
+        (WebCore::DatabaseServer::setDatabaseDirectoryPath):
+        (WebCore::DatabaseServer::openDatabase):
+        * Modules/webdatabase/DatabaseServer.h:
+        * Modules/webdatabase/DatabaseSync.cpp:
+        (WebCore::DatabaseSync::changeVersion):
+        * Modules/webdatabase/DatabaseTracker.cpp:
+        (WebCore::DatabaseTracker::canEstablishDatabase):
+        (WebCore::DatabaseTracker::retryCanEstablishDatabase):
+        * Modules/webdatabase/DatabaseTracker.h:
+        (WebCore):
+        (DatabaseTracker):
+        * Modules/webdatabase/SQLStatementBackend.cpp:
+        (WebCore::SQLStatementBackend::execute):
+        (WebCore::SQLStatementBackend::setDatabaseDeletedError):
+        (WebCore::SQLStatementBackend::setVersionMismatchedError):
+        (WebCore::SQLStatementBackend::setFailureDueToQuota):
+        * Modules/webdatabase/SQLStatementBackend.h:
+        (SQLStatementBackend):
+        * Modules/webdatabase/SQLTransaction.cpp:
+        (WebCore::SQLTransaction::deliverTransactionCallback):
+        (WebCore::SQLTransaction::deliverStatementCallback):
+        * Modules/webdatabase/SQLTransactionBackend.cpp:
+        (WebCore::SQLTransactionBackend::executeSQL):
+        (WebCore::SQLTransactionBackend::openTransactionAndPreflight):
+        (WebCore::SQLTransactionBackend::runCurrentStatementAndGetNextState):
+        (WebCore::SQLTransactionBackend::nextStateForCurrentStatementError):
+        (WebCore::SQLTransactionBackend::postflightAndCommit):
+        (WebCore::SQLTransactionBackend::acquireOriginLock):
+        (WebCore::SQLTransactionBackend::releaseOriginLockIfNeeded):
+        * Modules/webdatabase/SQLTransactionBackend.h:
+        (SQLTransactionBackend):
+        * Modules/webdatabase/SQLTransactionBackendSync.cpp:
+        (WebCore::SQLTransactionBackendSync::begin):
+        (WebCore::SQLTransactionBackendSync::commit):
+
 2013-04-05  Geoffrey Garen  <ggaren@apple.com>
 
         Made USE(JSC) unconditional
index 94783ef..fdbdc57 100644 (file)
@@ -61,7 +61,6 @@ public:
         const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize,
         bool setVersionInNewDatabase, DatabaseError&, String& errorMessage, OpenAttempt = FirstTryToOpenDatabase) = 0;
 
-#if !PLATFORM(CHROMIUM)
     virtual bool hasEntryForOrigin(SecurityOrigin*) = 0;
     virtual void origins(Vector<RefPtr<SecurityOrigin> >& result) = 0;
     virtual bool databaseNamesForOrigin(SecurityOrigin*, Vector<String>& result) = 0;
@@ -76,10 +75,6 @@ public:
     virtual bool deleteOrigin(SecurityOrigin*) = 0;
     virtual bool deleteDatabase(SecurityOrigin*, const String& name) = 0;
 
-#else // PLATFORM(CHROMIUM)
-    virtual void closeDatabasesImmediately(const String& originIdentifier, const String& name) = 0;
-#endif // PLATFORM(CHROMIUM)
-
     virtual void interruptAllDatabasesForContext(const DatabaseBackendContext*) = 0;
 
 protected:
index 3bf4c65..6a397a6 100644 (file)
@@ -52,14 +52,12 @@ bool ChangeVersionWrapper::performPreflight(SQLTransactionBackend* transaction)
     String actualVersion;
     if (!database->getVersionFromDatabase(actualVersion)) {
         int sqliteError = database->sqliteDatabase().lastError();
-        database->reportChangeVersionResult(1, SQLError::UNKNOWN_ERR, sqliteError);
         m_sqlError = SQLError::create(SQLError::UNKNOWN_ERR, "unable to read the current version",
                                       sqliteError, database->sqliteDatabase().lastErrorMsg());
         return false;
     }
 
     if (actualVersion != m_oldVersion) {
-        database->reportChangeVersionResult(2, SQLError::VERSION_ERR, 0);
         m_sqlError = SQLError::create(SQLError::VERSION_ERR, "current version of the database and `oldVersion` argument do not match");
         return false;
     }
@@ -75,15 +73,12 @@ bool ChangeVersionWrapper::performPostflight(SQLTransactionBackend* transaction)
 
     if (!database->setVersionInDatabase(m_newVersion)) {
         int sqliteError = database->sqliteDatabase().lastError();
-        database->reportChangeVersionResult(3, SQLError::UNKNOWN_ERR, sqliteError);
         m_sqlError = SQLError::create(SQLError::UNKNOWN_ERR, "unable to set new version in database",
                                       sqliteError, database->sqliteDatabase().lastErrorMsg());
         return false;
     }
 
     database->setExpectedVersion(m_newVersion);
-
-    database->reportChangeVersionResult(0, -1, 0); // OK
     return true;
 }
 
index e475bec..c51963e 100644 (file)
@@ -283,19 +283,6 @@ SecurityOrigin* Database::securityOrigin() const
     return 0;
 }
 
-#if PLATFORM(CHROMIUM)
-void Database::reportStartTransactionResult(int errorSite, int webSqlErrorCode, int sqliteErrorCode)
-{
-    backend()->reportStartTransactionResult(errorSite, webSqlErrorCode, sqliteErrorCode);
-}
-
-void Database::reportCommitTransactionResult(int errorSite, int webSqlErrorCode, int sqliteErrorCode)
-{
-    backend()->reportCommitTransactionResult(errorSite, webSqlErrorCode, sqliteErrorCode);
-}
-
-#endif
-
 } // namespace WebCore
 
 #endif // ENABLE(SQL_DATABASE)
index 0ce4233..068468a 100644 (file)
@@ -86,14 +86,6 @@ private:
 
     Vector<String> performGetTableNames();
 
-#if PLATFORM(CHROMIUM)
-    void reportStartTransactionResult(int errorSite, int webSqlErrorCode, int sqliteErrorCode);
-    void reportCommitTransactionResult(int errorSite, int webSqlErrorCode, int sqliteErrorCode);
-#else
-    void reportStartTransactionResult(int, int, int) { }
-    void reportCommitTransactionResult(int, int, int) { }
-#endif
-
     RefPtr<SecurityOrigin> m_databaseThreadSecurityOrigin;
     RefPtr<DatabaseContext> m_databaseContext;
 
index 62f1521..c7553ea 100644 (file)
@@ -55,9 +55,6 @@ bool DatabaseBackend::openAndVerifyVersion(bool setVersionInNewDatabase, Databas
     if (!databaseContext()->databaseThread() || databaseContext()->databaseThread()->terminationRequested(&synchronizer))
         return false;
 
-#if PLATFORM(CHROMIUM)
-    DatabaseTracker::tracker().prepareToOpenDatabase(this);
-#endif
     bool success = false;
     OwnPtr<DatabaseOpenTask> task = DatabaseOpenTask::create(this, setVersionInNewDatabase, &synchronizer, error, errorMessage, success);
     databaseContext()->databaseThread()->scheduleImmediateTask(task.release());
index e8013f2..838c87b 100644 (file)
 #include <wtf/text/CString.h>
 #include <wtf/text/StringHash.h>
 
-#if PLATFORM(CHROMIUM)
-#include "DatabaseObserver.h" // For error reporting.
-#endif
-
 // Registering "opened" databases with the DatabaseTracker
 // =======================================================
 // The DatabaseTracker maintains a list of databases that have been
@@ -294,12 +290,7 @@ public:
     }
     ~DoneCreatingDatabaseOnExitCaller()
     {
-#if !PLATFORM(CHROMIUM)
         DatabaseTracker::tracker().doneCreatingDatabase(m_database);
-#else
-        if (!m_openSucceeded)
-            DatabaseTracker::tracker().failedToOpenDatabase(m_database);
-#endif            
     }
 
     void setOpenSucceeded() { m_openSucceeded = true; }
@@ -319,7 +310,6 @@ bool DatabaseBackendBase::performOpenAndVerify(bool shouldSetVersionInNewDatabas
     const int maxSqliteBusyWaitTime = 30000;
 
     if (!m_sqliteDatabase.open(m_filename, true)) {
-        reportOpenDatabaseResult(1, INVALID_STATE_ERR, m_sqliteDatabase.lastError());
         errorMessage = formatErrorMessage("unable to open database", m_sqliteDatabase.lastError(), m_sqliteDatabase.lastErrorMsg());
         return false;
     }
@@ -337,30 +327,12 @@ bool DatabaseBackendBase::performOpenAndVerify(bool shouldSetVersionInNewDatabas
             // Map null string to empty string (see updateGuidVersionMap()).
             currentVersion = entry->value.isNull() ? emptyString() : entry->value.isolatedCopy();
             LOG(StorageAPI, "Current cached version for guid %i is %s", m_guid, currentVersion.ascii().data());
-
-#if PLATFORM(CHROMIUM)
-            // Note: In multi-process browsers the cached value may be inaccurate, but
-            // we cannot read the actual version from the database without potentially
-            // inducing a form of deadlock, a busytimeout error when trying to
-            // access the database. So we'll use the cached value if we're unable to read
-            // the value from the database file without waiting.
-            // FIXME: Add an async openDatabase method to the DatabaseAPI.
-            const int noSqliteBusyWaitTime = 0;
-            m_sqliteDatabase.setBusyTimeout(noSqliteBusyWaitTime);
-            String versionFromDatabase;
-            if (getVersionFromDatabase(versionFromDatabase, false)) {
-                currentVersion = versionFromDatabase;
-                updateGuidVersionMap(m_guid, currentVersion);
-            }
-            m_sqliteDatabase.setBusyTimeout(maxSqliteBusyWaitTime);
-#endif
         } else {
             LOG(StorageAPI, "No cached version for guid %i", m_guid);
 
             SQLiteTransaction transaction(m_sqliteDatabase);
             transaction.begin();
             if (!transaction.inProgress()) {
-                reportOpenDatabaseResult(2, INVALID_STATE_ERR, m_sqliteDatabase.lastError());
                 errorMessage = formatErrorMessage("unable to open database, failed to start transaction", m_sqliteDatabase.lastError(), m_sqliteDatabase.lastErrorMsg());
                 m_sqliteDatabase.close();
                 return false;
@@ -371,14 +343,12 @@ bool DatabaseBackendBase::performOpenAndVerify(bool shouldSetVersionInNewDatabas
                 m_new = true;
 
                 if (!m_sqliteDatabase.executeCommand("CREATE TABLE " + tableName + " (key TEXT NOT NULL ON CONFLICT FAIL UNIQUE ON CONFLICT REPLACE,value TEXT NOT NULL ON CONFLICT FAIL);")) {
-                    reportOpenDatabaseResult(3, INVALID_STATE_ERR, m_sqliteDatabase.lastError());
                     errorMessage = formatErrorMessage("unable to open database, failed to create 'info' table", m_sqliteDatabase.lastError(), m_sqliteDatabase.lastErrorMsg());
                     transaction.rollback();
                     m_sqliteDatabase.close();
                     return false;
                 }
             } else if (!getVersionFromDatabase(currentVersion, false)) {
-                reportOpenDatabaseResult(4, INVALID_STATE_ERR, m_sqliteDatabase.lastError());
                 errorMessage = formatErrorMessage("unable to open database, failed to read current version", m_sqliteDatabase.lastError(), m_sqliteDatabase.lastErrorMsg());
                 transaction.rollback();
                 m_sqliteDatabase.close();
@@ -390,7 +360,6 @@ bool DatabaseBackendBase::performOpenAndVerify(bool shouldSetVersionInNewDatabas
             } else if (!m_new || shouldSetVersionInNewDatabase) {
                 LOG(StorageAPI, "Setting version %s in database %s that was just created", m_expectedVersion.ascii().data(), databaseDebugName().ascii().data());
                 if (!setVersionInDatabase(m_expectedVersion, false)) {
-                    reportOpenDatabaseResult(5, INVALID_STATE_ERR, m_sqliteDatabase.lastError());
                     errorMessage = formatErrorMessage("unable to open database, failed to write current version", m_sqliteDatabase.lastError(), m_sqliteDatabase.lastErrorMsg());
                     transaction.rollback();
                     m_sqliteDatabase.close();
@@ -411,7 +380,6 @@ bool DatabaseBackendBase::performOpenAndVerify(bool shouldSetVersionInNewDatabas
     // If the expected version isn't the empty string, ensure that the current database version we have matches that version. Otherwise, set an exception.
     // If the expected version is the empty string, then we always return with whatever version of the database we have.
     if ((!m_new || shouldSetVersionInNewDatabase) && m_expectedVersion.length() && m_expectedVersion != currentVersion) {
-        reportOpenDatabaseResult(6, INVALID_STATE_ERR, 0);
         errorMessage = "unable to open database, version mismatch, '" + m_expectedVersion + "' does not match the currentVersion of '" + currentVersion + "'";
         m_sqliteDatabase.close();
         return false;
@@ -430,8 +398,6 @@ bool DatabaseBackendBase::performOpenAndVerify(bool shouldSetVersionInNewDatabas
 
     if (m_new && !shouldSetVersionInNewDatabase)
         m_expectedVersion = ""; // The caller provided a creationCallback which will set the expected version.
-
-    reportOpenDatabaseResult(0, -1, 0); // OK
     return true;
 }
 
@@ -527,14 +493,9 @@ void DatabaseBackendBase::setCachedVersion(const String& actualVersion)
 bool DatabaseBackendBase::getActualVersionForTransaction(String &actualVersion)
 {
     ASSERT(m_sqliteDatabase.transactionInProgress());
-#if PLATFORM(CHROMIUM)
     // Note: In multi-process browsers the cached value may be inaccurate.
     // So we retrieve the value from the database and update the cached value here.
     return getVersionFromDatabase(actualVersion, true);
-#else
-    actualVersion = getCachedVersion();
-    return true;
-#endif
 }
 
 void DatabaseBackendBase::disableAuthorizer()
@@ -602,7 +563,6 @@ void DatabaseBackendBase::incrementalVacuumIfNeeded()
     int64_t totalSize = m_sqliteDatabase.totalSize();
     if (totalSize <= 10 * freeSpaceSize) {
         int result = m_sqliteDatabase.runIncrementalVacuumCommand();
-        reportVacuumDatabaseResult(result);
         if (result != SQLResultOk)
             m_frontend->logErrorMessage(formatErrorMessage("error vacuuming database", result, m_sqliteDatabase.lastErrorMsg()));
     }
@@ -619,41 +579,6 @@ bool DatabaseBackendBase::isInterrupted()
     return m_sqliteDatabase.isInterrupted();
 }
 
-#if PLATFORM(CHROMIUM)
-// These are used to generate histograms of errors seen with websql.
-// See about:histograms in chromium.
-void DatabaseBackendBase::reportOpenDatabaseResult(int errorSite, int webSqlErrorCode, int sqliteErrorCode)
-{
-    DatabaseObserver::reportOpenDatabaseResult(this, errorSite, webSqlErrorCode, sqliteErrorCode);
-}
-
-void DatabaseBackendBase::reportChangeVersionResult(int errorSite, int webSqlErrorCode, int sqliteErrorCode)
-{
-    DatabaseObserver::reportChangeVersionResult(this, errorSite, webSqlErrorCode, sqliteErrorCode);
-}
-
-void DatabaseBackendBase::reportStartTransactionResult(int errorSite, int webSqlErrorCode, int sqliteErrorCode)
-{
-    DatabaseObserver::reportStartTransactionResult(this, errorSite, webSqlErrorCode, sqliteErrorCode);
-}
-
-void DatabaseBackendBase::reportCommitTransactionResult(int errorSite, int webSqlErrorCode, int sqliteErrorCode)
-{
-    DatabaseObserver::reportCommitTransactionResult(this, errorSite, webSqlErrorCode, sqliteErrorCode);
-}
-
-void DatabaseBackendBase::reportExecuteStatementResult(int errorSite, int webSqlErrorCode, int sqliteErrorCode)
-{
-    DatabaseObserver::reportExecuteStatementResult(this, errorSite, webSqlErrorCode, sqliteErrorCode);
-}
-
-void DatabaseBackendBase::reportVacuumDatabaseResult(int sqliteErrorCode)
-{
-    DatabaseObserver::reportVacuumDatabaseResult(this, sqliteErrorCode);
-}
-
-#endif // PLATFORM(CHROMIUM)
-
 } // namespace WebCore
 
 #endif // ENABLE(SQL_DATABASE)
index 55bd989..0802f78 100644 (file)
@@ -114,22 +114,6 @@ protected:
     void setCachedVersion(const String&);
     bool getActualVersionForTransaction(String& version);
 
-#if PLATFORM(CHROMIUM)
-    void reportOpenDatabaseResult(int errorSite, int webSqlErrorCode, int sqliteErrorCode);
-    void reportChangeVersionResult(int errorSite, int webSqlErrorCode, int sqliteErrorCode);
-    void reportStartTransactionResult(int errorSite, int webSqlErrorCode, int sqliteErrorCode);
-    void reportCommitTransactionResult(int errorSite, int webSqlErrorCode, int sqliteErrorCode);
-    void reportExecuteStatementResult(int errorSite, int webSqlErrorCode, int sqliteErrorCode);
-    void reportVacuumDatabaseResult(int sqliteErrorCode);
-#else
-    void reportOpenDatabaseResult(int, int, int) { }
-    void reportChangeVersionResult(int, int, int) { }
-    void reportStartTransactionResult(int, int, int) { }
-    void reportCommitTransactionResult(int, int, int) { }
-    void reportExecuteStatementResult(int, int, int) { }
-    void reportVacuumDatabaseResult(int) { }
-#endif
-
     static const char* databaseInfoTableName();
 
     RefPtr<SecurityOrigin> m_contextThreadSecurityOrigin;
index b68038d..a29b483 100644 (file)
@@ -54,9 +54,6 @@ DatabaseBackendSync::~DatabaseBackendSync()
 
 bool DatabaseBackendSync::openAndVerifyVersion(bool setVersionInNewDatabase, DatabaseError& error, String& errorMessage)
 {
-#if PLATFORM(CHROMIUM)
-    DatabaseTracker::tracker().prepareToOpenDatabase(this);
-#endif
     return performOpenAndVerify(setVersionInNewDatabase, error, errorMessage);
 }
 
index 58a309a..5c73b5d 100644 (file)
@@ -224,11 +224,9 @@ void DatabaseContext::databaseExceededQuota(const String& name, DatabaseDetails
         return;
     }
     ASSERT(m_scriptExecutionContext->isWorkerContext());
-#if !PLATFORM(CHROMIUM)
     // FIXME: This needs a real implementation; this is a temporary solution for testing.
     const unsigned long long defaultQuota = 5 * 1024 * 1024;
     DatabaseManager::manager().setQuota(m_scriptExecutionContext->securityOrigin(), defaultQuota);
-#endif
 }
 
 } // namespace WebCore
index 878f8b7..0a042e1 100644 (file)
@@ -363,7 +363,6 @@ String DatabaseManager::fullPathForDatabase(SecurityOrigin* origin, const String
     return m_server->fullPathForDatabase(origin, name, createIfDoesNotExist);
 }
 
-#if !PLATFORM(CHROMIUM)
 bool DatabaseManager::hasEntryForOrigin(SecurityOrigin* origin)
 {
     return m_server->hasEntryForOrigin(origin);
@@ -414,13 +413,6 @@ bool DatabaseManager::deleteDatabase(SecurityOrigin* origin, const String& name)
     return m_server->deleteDatabase(origin, name);
 }
 
-#else // PLATFORM(CHROMIUM)
-void DatabaseManager::closeDatabasesImmediately(const String& originIdentifier, const String& name)
-{
-    m_server->closeDatabasesImmediately(originIdentifier, name);
-}
-#endif // PLATFORM(CHROMIUM)
-
 void DatabaseManager::interruptAllDatabasesForContext(ScriptExecutionContext* context)
 {
     RefPtr<DatabaseContext> databaseContext = existingDatabaseContextFor(context);
index 2de65ca..f864e0b 100644 (file)
@@ -89,7 +89,6 @@ public:
 
     String fullPathForDatabase(SecurityOrigin*, const String& name, bool createIfDoesNotExist = true);
 
-#if !PLATFORM(CHROMIUM)
     bool hasEntryForOrigin(SecurityOrigin*);
     void origins(Vector<RefPtr<SecurityOrigin> >& result);
     bool databaseNamesForOrigin(SecurityOrigin*, Vector<String>& result);
@@ -104,10 +103,6 @@ public:
     bool deleteOrigin(SecurityOrigin*);
     bool deleteDatabase(SecurityOrigin*, const String& name);
 
-#else // PLATFORM(CHROMIUM)
-    void closeDatabasesImmediately(const String& originIdentifier, const String& name);
-#endif // PLATFORM(CHROMIUM)
-
     void interruptAllDatabasesForContext(ScriptExecutionContext*);
 
 private:
index 9f6375d..1942397 100644 (file)
@@ -40,36 +40,22 @@ namespace WebCore {
 
 void DatabaseServer::initialize(const String& databasePath)
 {
-#if !PLATFORM(CHROMIUM)
     DatabaseTracker::initializeTracker(databasePath);
-#else
-    UNUSED_PARAM(databasePath);
-#endif
 }
 
 void DatabaseServer::setClient(DatabaseManagerClient* client)
 {
-#if !PLATFORM(CHROMIUM)
     DatabaseTracker::tracker().setClient(client);
-#else
-    UNUSED_PARAM(client);
-#endif
 }
 
 String DatabaseServer::databaseDirectoryPath() const
 {
-#if !PLATFORM(CHROMIUM)
     return DatabaseTracker::tracker().databaseDirectoryPath();
-#else
-    return "";
-#endif
 }
 
 void DatabaseServer::setDatabaseDirectoryPath(const String& path)
 {
-#if !PLATFORM(CHROMIUM)
     DatabaseTracker::tracker().setDatabaseDirectoryPath(path);
-#endif
 }
 
 String DatabaseServer::fullPathForDatabase(SecurityOrigin* origin, const String& name, bool createIfDoesNotExist)
@@ -77,7 +63,6 @@ String DatabaseServer::fullPathForDatabase(SecurityOrigin* origin, const String&
     return DatabaseTracker::tracker().fullPathForDatabase(origin, name, createIfDoesNotExist);
 }
 
-#if !PLATFORM(CHROMIUM)
 bool DatabaseServer::hasEntryForOrigin(SecurityOrigin* origin)
 {
     return DatabaseTracker::tracker().hasEntryForOrigin(origin);
@@ -128,13 +113,6 @@ bool DatabaseServer::deleteDatabase(SecurityOrigin* origin, const String& name)
     return DatabaseTracker::tracker().deleteDatabase(origin, name);
 }
 
-#else // PLATFORM(CHROMIUM)
-void DatabaseServer::closeDatabasesImmediately(const String& originIdentifier, const String& name)
-{
-    DatabaseTracker::tracker().closeDatabasesImmediately(originIdentifier, name);
-}
-#endif // PLATFORM(CHROMIUM)
-
 void DatabaseServer::interruptAllDatabasesForContext(const DatabaseBackendContext* context)
 {
     DatabaseTracker::tracker().interruptAllDatabasesForContext(context);
@@ -150,10 +128,10 @@ PassRefPtr<DatabaseBackendBase> DatabaseServer::openDatabase(RefPtr<DatabaseBack
     
     switch (attempt) {
     case FirstTryToOpenDatabase:
-        success = DatabaseTracker::tracker().canEstablishDatabase(backendContext.get(), name, displayName, estimatedSize, error);
+        success = DatabaseTracker::tracker().canEstablishDatabase(backendContext.get(), name, estimatedSize, error);
         break;
     case RetryOpenDatabase:
-        success = DatabaseTracker::tracker().retryCanEstablishDatabase(backendContext.get(), name, displayName, estimatedSize, error);
+        success = DatabaseTracker::tracker().retryCanEstablishDatabase(backendContext.get(), name, estimatedSize, error);
     }
 
     if (success)
index c3c6bb6..6a868bd 100644 (file)
@@ -49,7 +49,6 @@ public:
         const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize,
         bool setVersionInNewDatabase, DatabaseError&, String& errorMessage, OpenAttempt);
 
-#if !PLATFORM(CHROMIUM)
     virtual bool hasEntryForOrigin(SecurityOrigin*);
     virtual void origins(Vector<RefPtr<SecurityOrigin> >& result);
     virtual bool databaseNamesForOrigin(SecurityOrigin*, Vector<String>& result);
@@ -64,10 +63,6 @@ public:
     virtual bool deleteOrigin(SecurityOrigin*);
     virtual bool deleteDatabase(SecurityOrigin*, const String& name);
 
-#else // PLATFORM(CHROMIUM)
-    virtual void closeDatabasesImmediately(const String& originIdentifier, const String& name);
-#endif // PLATFORM(CHROMIUM)
-
     virtual void interruptAllDatabasesForContext(const DatabaseBackendContext*);
 
 protected:
index faa9c9b..f92c34f 100644 (file)
@@ -79,7 +79,6 @@ void DatabaseSync::changeVersion(const String& oldVersion, const String& newVers
     ASSERT(m_scriptExecutionContext->isContextThread());
 
     if (sqliteDatabase().transactionInProgress()) {
-        reportChangeVersionResult(1, SQLException::DATABASE_ERR, 0);
         setLastErrorMessage("unable to changeVersion from within a transaction");
         ec = SQLException::DATABASE_ERR;
         return;
@@ -93,14 +92,12 @@ void DatabaseSync::changeVersion(const String& oldVersion, const String& newVers
 
     String actualVersion;
     if (!getVersionFromDatabase(actualVersion)) {
-        reportChangeVersionResult(2, SQLException::UNKNOWN_ERR, sqliteDatabase().lastError());
         setLastErrorMessage("unable to read the current version", sqliteDatabase().lastError(), sqliteDatabase().lastErrorMsg());
         ec = SQLException::UNKNOWN_ERR;
         return;
     }
 
     if (actualVersion != oldVersion) {
-        reportChangeVersionResult(3, SQLException::VERSION_ERR, 0);
         setLastErrorMessage("current version of the database and `oldVersion` argument do not match");
         ec = SQLException::VERSION_ERR;
         return;
@@ -112,7 +109,6 @@ void DatabaseSync::changeVersion(const String& oldVersion, const String& newVers
     }
 
     if (!setVersionInDatabase(newVersion)) {
-        reportChangeVersionResult(4, SQLException::UNKNOWN_ERR, sqliteDatabase().lastError());
         setLastErrorMessage("unable to set the new version", sqliteDatabase().lastError(), sqliteDatabase().lastErrorMsg());
         ec = SQLException::UNKNOWN_ERR;
         return;
@@ -124,8 +120,6 @@ void DatabaseSync::changeVersion(const String& oldVersion, const String& newVers
         return;
     }
 
-    reportChangeVersionResult(0, -1, 0); // OK
-
     setExpectedVersion(newVersion);
     setLastErrorMessage("");
 }
index 9af71dc..3f314de 100644 (file)
@@ -156,9 +156,8 @@ bool DatabaseTracker::hasAdequateQuotaForOrigin(SecurityOrigin* origin, unsigned
     return false;
 }
 
-bool DatabaseTracker::canEstablishDatabase(DatabaseBackendContext* context, const String& name, const String& displayName, unsigned long estimatedSize, DatabaseError& error)
+bool DatabaseTracker::canEstablishDatabase(DatabaseBackendContext* context, const String& name, unsigned long estimatedSize, DatabaseError& error)
 {
-    UNUSED_PARAM(displayName); // Chromium needs the displayName but we don't.
     error = DatabaseError::None;
 
     MutexLocker lockDatabase(m_databaseGuard);
@@ -209,13 +208,8 @@ bool DatabaseTracker::canEstablishDatabase(DatabaseBackendContext* context, cons
 // hasAdequateQuotaForOrigin() simple and correct (i.e. bug free), and just
 // re-use it. Also note that the path for opening a database involves IO, and
 // hence should not be a performance critical path anyway. 
-bool DatabaseTracker::retryCanEstablishDatabase(DatabaseBackendContext* context, const String& name, const String& displayName, unsigned long estimatedSize, DatabaseError& error)
+bool DatabaseTracker::retryCanEstablishDatabase(DatabaseBackendContext* context, const String& name, unsigned long estimatedSize, DatabaseError& error)
 {
-    // Chromium needs the displayName in canEstablishDatabase(), but we don't.
-    // Though Chromium does not use retryCanEstablishDatabase(), we should
-    // keep the prototypes for canEstablishDatabase() and its retry function
-    // the same. Hence, we also have an unneeded displayName arg here.
-    UNUSED_PARAM(displayName);
     error = DatabaseError::None;
 
     MutexLocker lockDatabase(m_databaseGuard);
index 50774c2..80e3f09 100644 (file)
 
 #if ENABLE(SQL_DATABASE)
 
+#include "DatabaseDetails.h"
 #include "DatabaseError.h"
+#include "SQLiteDatabase.h"
+#include "SecurityOriginHash.h"
 #include <wtf/HashMap.h>
 #include <wtf/HashSet.h>
+#include <wtf/OwnPtr.h>
 #include <wtf/text/StringHash.h>
 #include <wtf/text/WTFString.h>
 
-#if !PLATFORM(CHROMIUM)
-#include "DatabaseDetails.h"
-#include "SQLiteDatabase.h"
-#include "SecurityOriginHash.h"
-#include <wtf/OwnPtr.h>
-#endif // !PLATFORM(CHROMIUM)
-
 namespace WebCore {
 
 class DatabaseBackendBase;
 class DatabaseBackendContext;
+class DatabaseManagerClient;
 class OriginLock;
 class SecurityOrigin;
 
-#if !PLATFORM(CHROMIUM)
-class DatabaseManagerClient;
-
-#endif // !PLATFORM(CHROMIUM)
-
 class DatabaseTracker {
     WTF_MAKE_NONCOPYABLE(DatabaseTracker); WTF_MAKE_FAST_ALLOCATED;
 public:
-#if !PLATFORM(CHROMIUM)
     static void initializeTracker(const String& databasePath);
-#endif
+
     static DatabaseTracker& tracker();
     // This singleton will potentially be used from multiple worker threads and the page's context thread simultaneously.  To keep this safe, it's
     // currently using 4 locks.  In order to avoid deadlock when taking multiple locks, you must take them in the correct order:
@@ -70,8 +62,8 @@ public:
     // m_databaseGuard and m_openDatabaseMapGuard currently don't overlap.
     // notificationMutex() is currently independent of the other locks.
 
-    bool canEstablishDatabase(DatabaseBackendContext*, const String& name, const String& displayName, unsigned long estimatedSize, DatabaseError&);
-    bool retryCanEstablishDatabase(DatabaseBackendContext*, const String& name, const String& displayName, unsigned long estimatedSize, DatabaseError&);
+    bool canEstablishDatabase(DatabaseBackendContext*, const String& name, unsigned long estimatedSize, DatabaseError&);
+    bool retryCanEstablishDatabase(DatabaseBackendContext*, const String& name, unsigned long estimatedSize, DatabaseError&);
 
     void setDatabaseDetails(SecurityOrigin*, const String& name, const String& displayName, unsigned long estimatedSize);
     String fullPathForDatabase(SecurityOrigin*, const String& name, bool createIfDoesNotExist = true);
@@ -89,7 +81,6 @@ private:
 
     bool hasAdequateQuotaForOrigin(SecurityOrigin*, unsigned long estimatedSize, DatabaseError&);
 
-#if !PLATFORM(CHROMIUM)
 public:
     void setDatabaseDirectoryPath(const String&);
     String databaseDirectoryPath() const;
@@ -181,24 +172,6 @@ private:
 
     static void scheduleForNotification();
     static void notifyDatabasesChanged(void*);
-#else // PLATFORM(CHROMIUM)
-public:
-    void closeDatabasesImmediately(const String& originIdentifier, const String& name);
-
-    void prepareToOpenDatabase(DatabaseBackendBase*);
-    void failedToOpenDatabase(DatabaseBackendBase*);
-
-private:
-    typedef HashSet<DatabaseBackendBase*> DatabaseSet;
-    typedef HashMap<String, DatabaseSet*> DatabaseNameMap;
-    typedef HashMap<String, DatabaseNameMap*> DatabaseOriginMap;
-    class CloseOneDatabaseImmediatelyTask;
-
-    void closeOneDatabaseImmediately(const String& originIdentifier, const String& name, DatabaseBackendBase*);
-
-    Mutex m_openDatabaseMapGuard;
-    mutable OwnPtr<DatabaseOriginMap> m_openDatabaseMap;
-#endif // PLATFORM(CHROMIUM)
 };
 
 } // namespace WebCore
index 0d22704..77924be 100644 (file)
@@ -132,7 +132,6 @@ bool SQLStatementBackend::execute(DatabaseBackend* db)
             m_error = SQLError::create(SQLError::DATABASE_ERR, "could not prepare statement", result, "interrupted");
         else
             m_error = SQLError::create(SQLError::SYNTAX_ERR, "could not prepare statement", result, database->lastErrorMsg());
-        db->reportExecuteStatementResult(1, m_error->code(), result);
         return false;
     }
 
@@ -141,20 +140,18 @@ bool SQLStatementBackend::execute(DatabaseBackend* db)
     if (statement.bindParameterCount() != m_arguments.size()) {
         LOG(StorageAPI, "Bind parameter count doesn't match number of question marks");
         m_error = SQLError::create(db->isInterrupted() ? SQLError::DATABASE_ERR : SQLError::SYNTAX_ERR, "number of '?'s in statement string does not match argument count");
-        db->reportExecuteStatementResult(2, m_error->code(), 0);
         return false;
     }
 
     for (unsigned i = 0; i < m_arguments.size(); ++i) {
         result = statement.bindValue(i + 1, m_arguments[i]);
         if (result == SQLResultFull) {
-            setFailureDueToQuota(db);
+            setFailureDueToQuota();
             return false;
         }
 
         if (result != SQLResultOk) {
             LOG(StorageAPI, "Failed to bind value index %i to statement for query '%s'", i + 1, m_statement.ascii().data());
-            db->reportExecuteStatementResult(3, SQLError::DATABASE_ERR, result);
             m_error = SQLError::create(SQLError::DATABASE_ERR, "could not bind value", result, database->lastErrorMsg());
             return false;
         }
@@ -179,7 +176,6 @@ bool SQLStatementBackend::execute(DatabaseBackend* db)
         } while (result == SQLResultRow);
 
         if (result != SQLResultDone) {
-            db->reportExecuteStatementResult(4, SQLError::DATABASE_ERR, result);
             m_error = SQLError::create(SQLError::DATABASE_ERR, "could not iterate results", result, database->lastErrorMsg());
             return false;
         }
@@ -189,14 +185,12 @@ bool SQLStatementBackend::execute(DatabaseBackend* db)
             resultSet->setInsertId(database->lastInsertRowID());
     } else if (result == SQLResultFull) {
         // Return the Quota error - the delegate will be asked for more space and this statement might be re-run
-        setFailureDueToQuota(db);
+        setFailureDueToQuota();
         return false;
     } else if (result == SQLResultConstraint) {
-        db->reportExecuteStatementResult(6, SQLError::CONSTRAINT_ERR, result);
         m_error = SQLError::create(SQLError::CONSTRAINT_ERR, "could not execute statement due to a constaint failure", result, database->lastErrorMsg());
         return false;
     } else {
-        db->reportExecuteStatementResult(5, SQLError::DATABASE_ERR, result);
         m_error = SQLError::create(SQLError::DATABASE_ERR, "could not execute statement", result, database->lastErrorMsg());
         return false;
     }
@@ -207,28 +201,24 @@ bool SQLStatementBackend::execute(DatabaseBackend* db)
     resultSet->setRowsAffected(database->lastChanges());
 
     m_resultSet = resultSet;
-    db->reportExecuteStatementResult(0, -1, 0); // OK
     return true;
 }
 
-void SQLStatementBackend::setDatabaseDeletedError(DatabaseBackend* database)
+void SQLStatementBackend::setDatabaseDeletedError()
 {
     ASSERT(!m_error && !m_resultSet);
-    database->reportExecuteStatementResult(6, SQLError::UNKNOWN_ERR, 0);
     m_error = SQLError::create(SQLError::UNKNOWN_ERR, "unable to execute statement, because the user deleted the database");
 }
 
-void SQLStatementBackend::setVersionMismatchedError(DatabaseBackend* database)
+void SQLStatementBackend::setVersionMismatchedError()
 {
     ASSERT(!m_error && !m_resultSet);
-    database->reportExecuteStatementResult(7, SQLError::VERSION_ERR, 0);
     m_error = SQLError::create(SQLError::VERSION_ERR, "current version of the database and `oldVersion` argument do not match");
 }
 
-void SQLStatementBackend::setFailureDueToQuota(DatabaseBackend* database)
+void SQLStatementBackend::setFailureDueToQuota()
 {
     ASSERT(!m_error && !m_resultSet);
-    database->reportExecuteStatementResult(8, SQLError::QUOTA_ERR, 0);
     m_error = SQLError::create(SQLError::QUOTA_ERR, "there was not enough remaining storage space, or the storage quota was reached and the user declined to allow more space");
 }
 
index 8e72132..a2d2690 100644 (file)
@@ -55,8 +55,8 @@ public:
     bool hasStatementCallback() const { return m_hasCallback; }
     bool hasStatementErrorCallback() const { return m_hasErrorCallback; }
 
-    void setDatabaseDeletedError(DatabaseBackend*);
-    void setVersionMismatchedError(DatabaseBackend*);
+    void setDatabaseDeletedError();
+    void setVersionMismatchedError();
 
     AbstractSQLStatement* frontend();
     virtual PassRefPtr<SQLError> sqlError() const;
@@ -66,7 +66,7 @@ private:
     SQLStatementBackend(PassOwnPtr<AbstractSQLStatement>, const String& statement,
         const Vector<SQLValue>& arguments, int permissions);
 
-    void setFailureDueToQuota(DatabaseBackend*);
+    void setFailureDueToQuota();
     void clearFailureDueToQuota();
 
     OwnPtr<AbstractSQLStatement> m_frontend;
index b60e6b0..2b4f7bb 100644 (file)
@@ -150,11 +150,9 @@ SQLTransactionState SQLTransaction::deliverTransactionCallback()
     // Spec 4.3.2 5: If the transaction callback was null or raised an exception, jump to the error callback
     SQLTransactionState nextState = SQLTransactionState::RunStatements;
     if (shouldDeliverErrorCallback) {
-        m_database->reportStartTransactionResult(5, SQLError::UNKNOWN_ERR, 0);
         m_transactionError = SQLError::create(SQLError::UNKNOWN_ERR, "the SQLTransactionCallback was null or threw an exception");
         nextState = SQLTransactionState::DeliverTransactionErrorCallback;
     }
-    m_database->reportStartTransactionResult(0, -1, 0); // OK
     return nextState;
 }
 
@@ -198,7 +196,6 @@ SQLTransactionState SQLTransaction::deliverStatementCallback()
     m_executeSqlAllowed = false;
 
     if (result) {
-        m_database->reportCommitTransactionResult(2, SQLError::UNKNOWN_ERR, 0);
         m_transactionError = SQLError::create(SQLError::UNKNOWN_ERR, "the statement callback raised an exception or statement error callback did not return false");
         return nextStateForTransactionError();
     }
index bb548ba..0490982 100644 (file)
@@ -531,7 +531,7 @@ void SQLTransactionBackend::executeSQL(PassOwnPtr<AbstractSQLStatement> statemen
     statementBackend = SQLStatementBackend::create(statement, sqlStatement, arguments, permissions);
 
     if (Database::from(m_database.get())->deleted())
-        statementBackend->setDatabaseDeletedError(m_database.get());
+        statementBackend->setDatabaseDeletedError();
 
     enqueueStatementBackend(statementBackend);
 }
@@ -569,7 +569,6 @@ SQLTransactionState SQLTransactionBackend::openTransactionAndPreflight()
 
     // If the database was deleted, jump to the error callback
     if (Database::from(m_database.get())->deleted()) {
-        m_database->reportStartTransactionResult(1, SQLError::UNKNOWN_ERR, 0);
         m_transactionError = SQLError::create(SQLError::UNKNOWN_ERR, "unable to open a transaction, because the user deleted the database");
         return nextStateForTransactionError();
     }
@@ -591,7 +590,6 @@ SQLTransactionState SQLTransactionBackend::openTransactionAndPreflight()
     // Spec 4.3.2.1+2: Open a transaction to the database, jumping to the error callback if that fails
     if (!m_sqliteTransaction->inProgress()) {
         ASSERT(!m_database->sqliteDatabase().transactionInProgress());
-        m_database->reportStartTransactionResult(2, SQLError::DATABASE_ERR, m_database->sqliteDatabase().lastError());
         m_transactionError = SQLError::create(SQLError::DATABASE_ERR, "unable to begin transaction",
             m_database->sqliteDatabase().lastError(), m_database->sqliteDatabase().lastErrorMsg());
         m_sqliteTransaction.clear();
@@ -603,7 +601,6 @@ SQLTransactionState SQLTransactionBackend::openTransactionAndPreflight()
     // the actual version. In single-process browsers, this is just a map lookup.
     String actualVersion;
     if (!m_database->getActualVersionForTransaction(actualVersion)) {
-        m_database->reportStartTransactionResult(3, SQLError::DATABASE_ERR, m_database->sqliteDatabase().lastError());
         m_transactionError = SQLError::create(SQLError::DATABASE_ERR, "unable to read version",
             m_database->sqliteDatabase().lastError(), m_database->sqliteDatabase().lastErrorMsg());
         m_database->disableAuthorizer();
@@ -619,10 +616,8 @@ SQLTransactionState SQLTransactionBackend::openTransactionAndPreflight()
         m_sqliteTransaction.clear();
         m_database->enableAuthorizer();
         m_transactionError = m_wrapper->sqlError();
-        if (!m_transactionError) {
-            m_database->reportStartTransactionResult(4, SQLError::UNKNOWN_ERR, 0);
+        if (!m_transactionError)
             m_transactionError = SQLError::create(SQLError::UNKNOWN_ERR, "unknown error occurred during transaction preflight");
-        }
         return nextStateForTransactionError();
     }
 
@@ -687,7 +682,7 @@ SQLTransactionState SQLTransactionBackend::runCurrentStatementAndGetNextState()
     m_database->resetAuthorizer();
 
     if (m_hasVersionMismatch)
-        m_currentStatementBackend->setVersionMismatchedError(Database::from(m_database.get()));
+        m_currentStatementBackend->setVersionMismatchedError();
 
     if (m_currentStatementBackend->execute(m_database.get())) {
         if (m_database->lastActionChangedDatabase()) {
@@ -719,10 +714,8 @@ SQLTransactionState SQLTransactionBackend::nextStateForCurrentStatementError()
         return SQLTransactionState::DeliverStatementCallback;
 
     m_transactionError = m_currentStatementBackend->sqlError();
-    if (!m_transactionError) {
-        m_database->reportCommitTransactionResult(1, SQLError::DATABASE_ERR, 0);
+    if (!m_transactionError)
         m_transactionError = SQLError::create(SQLError::DATABASE_ERR, "the statement failed to execute");
-    }
     return nextStateForTransactionError();
 }
 
@@ -733,10 +726,8 @@ SQLTransactionState SQLTransactionBackend::postflightAndCommit()
     // Spec 4.3.2.7: Perform postflight steps, jumping to the error callback if they fail.
     if (m_wrapper && !m_wrapper->performPostflight(this)) {
         m_transactionError = m_wrapper->sqlError();
-        if (!m_transactionError) {
-            m_database->reportCommitTransactionResult(3, SQLError::UNKNOWN_ERR, 0);
+        if (!m_transactionError)
             m_transactionError = SQLError::create(SQLError::UNKNOWN_ERR, "unknown error occurred during transaction postflight");
-        }
         return nextStateForTransactionError();
     }
 
@@ -753,14 +744,11 @@ SQLTransactionState SQLTransactionBackend::postflightAndCommit()
     if (m_sqliteTransaction->inProgress()) {
         if (m_wrapper)
             m_wrapper->handleCommitFailedAfterPostflight(this);
-        m_database->reportCommitTransactionResult(4, SQLError::DATABASE_ERR, m_database->sqliteDatabase().lastError());
         m_transactionError = SQLError::create(SQLError::DATABASE_ERR, "unable to commit transaction",
             m_database->sqliteDatabase().lastError(), m_database->sqliteDatabase().lastErrorMsg());
         return nextStateForTransactionError();
     }
 
-    m_database->reportCommitTransactionResult(0, -1, 0); // OK
-
     // Vacuum the database if anything was deleted.
     if (m_database->hadDeletes())
         m_database->incrementalVacuumIfNeeded();
@@ -849,21 +837,17 @@ SQLTransactionState SQLTransactionBackend::sendToFrontendState()
 
 void SQLTransactionBackend::acquireOriginLock()
 {
-#if !PLATFORM(CHROMIUM)
     ASSERT(!m_originLock);
     m_originLock = DatabaseTracker::tracker().originLockFor(m_database->securityOrigin());
     m_originLock->lock();
-#endif
 }
 
 void SQLTransactionBackend::releaseOriginLockIfNeeded()
 {
-#if !PLATFORM(CHROMIUM)
     if (m_originLock) {
         m_originLock->unlock();
         m_originLock.clear();
     }
-#endif
 }
 
 } // namespace WebCore
index 00c2280..12a5009 100644 (file)
@@ -132,9 +132,7 @@ private:
     Deque<RefPtr<SQLStatementBackend> > m_statementQueue;
 
     OwnPtr<SQLiteTransaction> m_sqliteTransaction;
-#if !PLATFORM(CHROMIUM)
     RefPtr<OriginLock> m_originLock;
-#endif
 };
 
 } // namespace WebCore
index b801cf4..5522264 100644 (file)
@@ -131,7 +131,6 @@ ExceptionCode SQLTransactionBackendSync::begin()
 {
     ASSERT(m_database->scriptExecutionContext()->isContextThread());
     if (!m_database->opened()) {
-        m_database->reportStartTransactionResult(1, SQLException::UNKNOWN_ERR, 0);
         m_database->setLastErrorMessage("cannot begin transaction because the database is not open");
         return SQLException::UNKNOWN_ERR;
     }
@@ -153,7 +152,6 @@ ExceptionCode SQLTransactionBackendSync::begin()
     // Check if begin() succeeded.
     if (!m_sqliteTransaction->inProgress()) {
         ASSERT(!m_database->sqliteDatabase().transactionInProgress());
-        m_database->reportStartTransactionResult(2, SQLException::DATABASE_ERR, m_database->sqliteDatabase().lastError());
         m_database->setLastErrorMessage("unable to begin transaction",
             m_database->sqliteDatabase().lastError(), m_database->sqliteDatabase().lastErrorMsg());
         m_sqliteTransaction.clear();
@@ -165,14 +163,12 @@ ExceptionCode SQLTransactionBackendSync::begin()
     // the actual version. In single-process browsers, this is just a map lookup.
     String actualVersion;
     if (!m_database->getActualVersionForTransaction(actualVersion)) {
-        m_database->reportStartTransactionResult(3, SQLException::DATABASE_ERR, m_database->sqliteDatabase().lastError());
         m_database->setLastErrorMessage("unable to read version",
             m_database->sqliteDatabase().lastError(), m_database->sqliteDatabase().lastErrorMsg());
         rollback();
         return SQLException::DATABASE_ERR;
     }
     m_hasVersionMismatch = !m_database->expectedVersion().isEmpty() && (m_database->expectedVersion() != actualVersion);
-    m_database->reportStartTransactionResult(0, -1, 0); // OK
     return 0;
 }
 
@@ -194,7 +190,6 @@ ExceptionCode SQLTransactionBackendSync::commit()
 {
     ASSERT(m_database->scriptExecutionContext()->isContextThread());
     if (!m_database->opened()) {
-        m_database->reportCommitTransactionResult(1, SQLException::UNKNOWN_ERR, 0);
         m_database->setLastErrorMessage("unable to commit transaction because the database is not open.");
         return SQLException::UNKNOWN_ERR;
     }
@@ -207,7 +202,6 @@ ExceptionCode SQLTransactionBackendSync::commit()
 
     // If the commit failed, the transaction will still be marked as "in progress"
     if (m_sqliteTransaction->inProgress()) {
-        m_database->reportCommitTransactionResult(2, SQLException::DATABASE_ERR, m_database->sqliteDatabase().lastError());
         m_database->setLastErrorMessage("unable to commit transaction",
             m_database->sqliteDatabase().lastError(), m_database->sqliteDatabase().lastErrorMsg());
         return SQLException::DATABASE_ERR;
@@ -222,8 +216,6 @@ ExceptionCode SQLTransactionBackendSync::commit()
     // The commit was successful. If the transaction modified this database, notify the delegates.
     if (m_modifiedDatabase)
         m_transactionClient->didCommitWriteTransaction(database());
-
-    m_database->reportCommitTransactionResult(0, -1, 0); // OK
     return 0;
 }