2011-05-25 Sheriff Bot <webkit.review.bot@gmail.com>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 May 2011 19:23:39 +0000 (19:23 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 May 2011 19:23:39 +0000 (19:23 +0000)
        Unreviewed, rolling out r87257.
        http://trac.webkit.org/changeset/87257
        https://bugs.webkit.org/show_bug.cgi?id=61457

        This broke layout tests, see bug 61431. (Requested by
        hwennborg on #webkit).

        * storage/indexeddb/migrate-basics-expected.txt: Removed.
        * storage/indexeddb/migrate-basics.html: Removed.
2011-05-25  Sheriff Bot  <webkit.review.bot@gmail.com>

        Unreviewed, rolling out r87257.
        http://trac.webkit.org/changeset/87257
        https://bugs.webkit.org/show_bug.cgi?id=61457

        This broke layout tests, see bug 61431. (Requested by
        hwennborg on #webkit).

        * storage/IDBBackingStore.h:
        * storage/IDBFactoryBackendImpl.cpp:
        (WebCore::IDBFactoryBackendImpl::IDBFactoryBackendImpl):
        (WebCore::IDBFactoryBackendImpl::open):
        * storage/IDBFactoryBackendImpl.h:
        * storage/IDBFactoryBackendInterface.h:
        * storage/IDBLevelDBBackingStore.cpp:
        * storage/IDBLevelDBBackingStore.h:
        * storage/IDBSQLiteBackingStore.cpp:
        * storage/IDBSQLiteBackingStore.h:
2011-05-25  Sheriff Bot  <webkit.review.bot@gmail.com>

        Unreviewed, rolling out r87257.
        http://trac.webkit.org/changeset/87257
        https://bugs.webkit.org/show_bug.cgi?id=61457

        This broke layout tests, see bug 61431. (Requested by
        hwennborg on #webkit).

        * public/WebIDBFactory.h:
        * src/AssertMatchingEnums.cpp:
        * src/IDBFactoryBackendProxy.cpp:
        * src/IDBFactoryBackendProxy.h:
        * src/WebIDBFactoryImpl.cpp:
        (WebKit::WebIDBFactoryImpl::WebIDBFactoryImpl):
        (WebKit::WebIDBFactoryImpl::open):
        * src/WebIDBFactoryImpl.h:
2011-05-25  Sheriff Bot  <webkit.review.bot@gmail.com>

        Unreviewed, rolling out r87257.
        http://trac.webkit.org/changeset/87257
        https://bugs.webkit.org/show_bug.cgi?id=61457

        This broke layout tests, see bug 61431. (Requested by
        hwennborg on #webkit).

        * DumpRenderTree/chromium/LayoutTestController.cpp:
        (LayoutTestController::LayoutTestController):
        (LayoutTestController::clearAllDatabases):
        * DumpRenderTree/chromium/LayoutTestController.h:

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

22 files changed:
LayoutTests/ChangeLog
LayoutTests/storage/indexeddb/migrate-basics-expected.txt [deleted file]
LayoutTests/storage/indexeddb/migrate-basics.html [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/storage/IDBBackingStore.h
Source/WebCore/storage/IDBFactoryBackendImpl.cpp
Source/WebCore/storage/IDBFactoryBackendImpl.h
Source/WebCore/storage/IDBFactoryBackendInterface.h
Source/WebCore/storage/IDBLevelDBBackingStore.cpp
Source/WebCore/storage/IDBLevelDBBackingStore.h
Source/WebCore/storage/IDBSQLiteBackingStore.cpp
Source/WebCore/storage/IDBSQLiteBackingStore.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/public/WebIDBFactory.h
Source/WebKit/chromium/src/AssertMatchingEnums.cpp
Source/WebKit/chromium/src/IDBFactoryBackendProxy.cpp
Source/WebKit/chromium/src/IDBFactoryBackendProxy.h
Source/WebKit/chromium/src/WebIDBFactoryImpl.cpp
Source/WebKit/chromium/src/WebIDBFactoryImpl.h
Tools/ChangeLog
Tools/DumpRenderTree/chromium/LayoutTestController.cpp
Tools/DumpRenderTree/chromium/LayoutTestController.h

index 14893a4..239afa1 100644 (file)
@@ -1,3 +1,15 @@
+2011-05-25  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r87257.
+        http://trac.webkit.org/changeset/87257
+        https://bugs.webkit.org/show_bug.cgi?id=61457
+
+        This broke layout tests, see bug 61431. (Requested by
+        hwennborg on #webkit).
+
+        * storage/indexeddb/migrate-basics-expected.txt: Removed.
+        * storage/indexeddb/migrate-basics.html: Removed.
+
 2011-05-25  Qi Zhang  <qi.2.zhang@nokia.com>
 
         Reviewed by Andreas Kling.
diff --git a/LayoutTests/storage/indexeddb/migrate-basics-expected.txt b/LayoutTests/storage/indexeddb/migrate-basics-expected.txt
deleted file mode 100644 (file)
index 27d4da0..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-Test migration from SQLite to LevelDB.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-webkitIndexedDB.open('MigrationDatabase')
-sqliteCreateSuccess():
-db = event.target.result
-db.setVersion('new version')
-sqliteSetVersionSuccess():
-window.db.createObjectStore('PlainOldStore', {autoIncrement: false})
-store = window.db.createObjectStore('StoreWithKeyPath', {keyPath: 'id', autoIncrement: true})
-window.db.createObjectStore('StoreWithAutoIncrement', {autoIncrement: true})
-trans = db.transaction([], webkitIDBTransaction.READ_WRITE)
-index = store.createIndex('ExampleIndex','id', false)
-sqliteTestAddRecords1():
-store = trans.objectStore('PlainOldStore')
-store = store.add({name: 'George'},1)
-sqliteTestAddRecords2():
-store = trans.objectStore('StoreWithKeyPath')
-store.add({name: 'Thomas', id: 3})
-sqliteTestAddRecords3():
-store = trans.objectStore('StoreWithAutoIncrement')
-store.add({name: 'Lincoln', number: '7012'}, 5)
-leveldbOpenSuccess():
-db = event.target.result
-trans = db.transaction([], webkitIDBTransaction.READ_WRITE, 0)
-leveldbCheckPlainOldStore():
-store = trans.objectStore('PlainOldStore')
-FAIL store = trans.objectStore('PlainOldStore') threw exception Error: NOT_FOUND_ERR: DOM IDBDatabase Exception 3
-request = store.openCursor(keyRange)
-FAIL request = store.openCursor(keyRange) threw exception TypeError: Cannot call method 'openCursor' of undefined
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/LayoutTests/storage/indexeddb/migrate-basics.html b/LayoutTests/storage/indexeddb/migrate-basics.html
deleted file mode 100644 (file)
index 59879d2..0000000
+++ /dev/null
@@ -1,197 +0,0 @@
-<html>
-<head>
-<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
-<script src="../../fast/js/resources/js-test-pre.js"></script>
-<script src="../../fast/js/resources/js-test-post-function.js"></script>
-<script src="resources/shared.js"></script>
-</head>
-<body>
-<p id="description"></p>
-<div id="console"></div>
-<script>
-
-description("Test migration from SQLite to LevelDB.");
-
-if (window.layoutTestController)
-    layoutTestController.waitUntilDone();
-
-function test()
-{
-    if (window.layoutTestController)
-        layoutTestController.setOverrideIndexedDBBackingStore("sqlite");
-
-    request = evalAndLog("webkitIndexedDB.open('MigrationDatabase')");
-    request.onsuccess = sqliteOpenSuccess;
-    request.onerror = unexpectedErrorCallback;
-}
-
-function sqliteOpenSuccess()
-{
-    debug("sqliteCreateSuccess():");
-    window.db = evalAndLog("db = event.target.result");
-
-    request = evalAndLog("db.setVersion('new version')");
-    request.onsuccess = sqliteSetVersionSuccess;
-    request.onerror = unexpectedErrorCallback;
-}
-
-function sqliteSetVersionSuccess()
-{
-    debug("sqliteSetVersionSuccess():");
-    evalAndLog("window.db.createObjectStore('PlainOldStore', {autoIncrement: false})");
-    window.store = evalAndLog("store = window.db.createObjectStore('StoreWithKeyPath', {keyPath: 'id', autoIncrement: true})");
-    evalAndLog("window.db.createObjectStore('StoreWithAutoIncrement', {autoIncrement: true})");
-
-    window.trans = evalAndLog("trans = db.transaction([], webkitIDBTransaction.READ_WRITE)");
-    window.index = evalAndLog("index = store.createIndex('ExampleIndex','id', false)");
-
-
-    sqliteTestAddRecords1();
-}
-
-function sqliteTestAddRecords1()
-{
-    debug("sqliteTestAddRecords1():");
-    window.store = evalAndLog("store = trans.objectStore('PlainOldStore')");
-    request = evalAndLog("store = store.add({name: 'George'},1)");
-    request.onsuccess = sqliteTestAddRecords2;
-    request.onfailure = unexpectedErrorCallback;
-}
-
-function sqliteTestAddRecords2()
-{
-    debug("sqliteTestAddRecords2():");
-    window.store = evalAndLog("store = trans.objectStore('StoreWithKeyPath')");
-
-    request = evalAndLog("store.add({name: 'Thomas', id: 3})");
-    request.onsuccess = sqliteTestAddRecords3;
-    request.onfailure = unexpectedErrorCallback;
-}
-
-function sqliteTestAddRecords3()
-{
-    debug("sqliteTestAddRecords3():");
-    window.store = evalAndLog("store = trans.objectStore('StoreWithAutoIncrement')");
-    request = evalAndLog("store.add({name: 'Lincoln', number: '7012'}, 5)");
-    request.onsuccess = sqliteCloseDatabase;
-    request.onfailure = unexpectedErrorCallback;
-}
-
-
-function sqliteCloseDatabase()
-{
-    window.db.close();
-    window.db = null;
-    window.trans = null;
-    leveldbOpen();
-}
-
-function leveldbOpen()
-{
-    if (window.layoutTestController)
-        layoutTestController.setOverrideIndexedDBBackingStore("leveldb");
-
-    // This next line will trigger the migration.
-    request = webkitIndexedDB.open('MigrationDatabase');
-    request.onsuccess = leveldbOpenSuccess;
-    request.onerror = unexpectedErrorCallback;
-}
-
-function leveldbOpenSuccess()
-{
-    debug("leveldbOpenSuccess():");
-    window.db = evalAndLog("db = event.target.result");
-    window.trans = evalAndLog("trans = db.transaction([], webkitIDBTransaction.READ_WRITE, 0)");
-    leveldbCheckPlainOldStore();
-}
-
-function leveldbCheckPlainOldStore()
-{
-    debug("leveldbCheckPlainOldStore():");
-    window.store = evalAndLog("store = trans.objectStore('PlainOldStore')");
-    window.keyRange = webkitIDBKeyRange.lowerBound(0);
-    request = evalAndLog("request = store.openCursor(keyRange)");
-    if (!request) {
-        testMigrationEnd();
-        return;
-    }
-    request.onsuccess = leveldbCheckPlainOldStoreCursorNext;
-    request.onerror = unexpectedErrorCallback;
-}
-
-function leveldbCheckPlainOldStoreCursorNext()
-{
-    debug("leveldbCheckPlainOldStoreCursorNext():");
-    window.cursor = event.target.result;
-    if (!window.cursor) {
-        leveldbCheckStoreWithKeyPath();
-        return;
-    }
-
-    shouldBeTrue("cursor.value.name == 'George'");
-    cursor.continue();
-}
-
-function leveldbCheckStoreWithKeyPath()
-{
-    debug("leveldbCheckStoreWithKeyPath():");
-    window.store = evalAndLog("store = trans.objectStore('StoreWithKeyPath')");
-    var keyRange = webkitIDBKeyRange.lowerBound(0);
-    request = store.openCursor(keyRange);
-    request.onsuccess = leveldbCheckStoreWithKeyPathCursorNext;
-    request.onerror = unexpectedErrorCallback;
-}
-
-function leveldbCheckStoreWithKeyPathCursorNext()
-{
-    debug("leveldbCheckStoreWithKeyPathCursorNext():");
-    window.cursor = event.target.result;
-    if (!window.cursor) {
-        leveldbCheckStoreWithAutoIncrement();
-        return;
-    }
-
-    shouldBeTrue("cursor.value.name == 'Thomas'");
-    shouldBeTrue("cursor.value.id == '3'");
-    cursor.continue();
-}
-
-function leveldbCheckStoreWithAutoIncrement()
-{
-    debug("leveldbCheckStoreWithAutoIncrement():");
-    window.store = evalAndLog("store = trans.objectStore('StoreWithAutoIncrement')");
-    var keyRange = webkitIDBKeyRange.lowerBound(0);
-    request = store.openCursor(keyRange);
-    request.onsuccess = leveldbCheckStoreWithAutoIncrementCursorNext;
-    request.onerror = unexpectedErrorCallback;
-}
-function leveldbCheckStoreWithAutoIncrementCursorNext()
-{
-    debug("leveldbCheckStoreWithAutoIncrementCursorNext():");
-    window.cursor = event.target.result;
-    if (!window.cursor) {
-        testMigrationEnd();
-        return;
-    }
-
-    shouldBeTrue("cursor.value.name == 'Lincoln'");
-    shouldBeTrue("cursor.value.number == '7012'");
-    cursor.continue();
-}
-
-function testMigrationEnd()
-{
-    window.db.close();
-    window.db = null;
-    layoutTestController.clearAllDatabases();
-    layoutTestController.setOverrideIndexedDBBackingStore("default");
-    done();
-}
-
-test();
-
-var successfullyParsed = true;
-
-</script>
-</body>
-</html>
index 1be8961..663160d 100644 (file)
@@ -1,3 +1,23 @@
+2011-05-25  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r87257.
+        http://trac.webkit.org/changeset/87257
+        https://bugs.webkit.org/show_bug.cgi?id=61457
+
+        This broke layout tests, see bug 61431. (Requested by
+        hwennborg on #webkit).
+
+        * storage/IDBBackingStore.h:
+        * storage/IDBFactoryBackendImpl.cpp:
+        (WebCore::IDBFactoryBackendImpl::IDBFactoryBackendImpl):
+        (WebCore::IDBFactoryBackendImpl::open):
+        * storage/IDBFactoryBackendImpl.h:
+        * storage/IDBFactoryBackendInterface.h:
+        * storage/IDBLevelDBBackingStore.cpp:
+        * storage/IDBLevelDBBackingStore.h:
+        * storage/IDBSQLiteBackingStore.cpp:
+        * storage/IDBSQLiteBackingStore.h:
+
 2011-05-25  Alexis Menard  <alexis.menard@openbossa.org>
 
         Reviewed by Eric Carlson.
index 2e0e56d..102dea6 100644 (file)
@@ -29,8 +29,6 @@
 #if ENABLE(INDEXED_DATABASE)
 
 #include "IDBCursor.h"
-#include "IDBFactoryBackendImpl.h"
-#include "IDBFactoryBackendInterface.h"
 #include "SQLiteDatabase.h"
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
@@ -39,6 +37,7 @@
 
 namespace WebCore {
 
+class IDBFactoryBackendImpl;
 class IDBKey;
 class IDBKeyRange;
 class SecurityOrigin;
@@ -107,7 +106,6 @@ public:
         virtual void rollback() = 0;
     };
     virtual PassRefPtr<Transaction> createTransaction() = 0;
-    virtual IDBFactoryBackendInterface::BackingStoreType backingStoreType() = 0;
 };
 
 } // namespace WebCore
index 5788b9a..4768b3e 100644 (file)
@@ -45,7 +45,6 @@ namespace WebCore {
 
 IDBFactoryBackendImpl::IDBFactoryBackendImpl()
     : m_transactionCoordinator(IDBTransactionCoordinator::create())
-    , m_migrateEnabled(false)
 {
 }
 
@@ -77,39 +76,18 @@ void IDBFactoryBackendImpl::open(const String& name, PassRefPtr<IDBCallbacks> ca
     String uniqueIdentifier = fileIdentifier + "@" + name;
     IDBDatabaseBackendMap::iterator it = m_databaseBackendMap.find(uniqueIdentifier);
     if (it != m_databaseBackendMap.end()) {
-        // Also check that backing store types match: this is important for migration.
-        if ((backingStoreType == DefaultBackingStore) || (backingStoreType == it->second->backingStore()->backingStoreType())) {
-            callbacks->onSuccess(it->second);
-            return;
-        }
+        callbacks->onSuccess(it->second);
+        return;
     }
 
     // FIXME: Everything from now on should be done on another thread.
 
     RefPtr<IDBBackingStore> backingStore;
     IDBBackingStoreMap::iterator it2 = m_backingStoreMap.find(fileIdentifier);
-    if (it2 != m_backingStoreMap.end() && (backingStoreType == it2->second->backingStoreType()))
+    if (it2 != m_backingStoreMap.end())
         backingStore = it2->second;
     else {
-#if ENABLE(LEVELDB)
-        if (m_migrateEnabled) {
-            bool hasSQLBackend = IDBSQLiteBackingStore::backingStoreExists(securityOrigin.get(), dataDir);
-            bool hasLevelDbBackend = IDBLevelDBBackingStore::backingStoreExists(securityOrigin.get(), dataDir);
-
-            if (hasSQLBackend && hasLevelDbBackend)
-                backingStoreType = LevelDBBackingStore;
-
-            // Migration: if the database exists and is SQLite we want to migrate it to LevelDB.
-            if (hasSQLBackend && !hasLevelDbBackend) {
-                if (migrate(name, securityOrigin.get(), dataDir, maximumSize))
-                    backingStoreType = LevelDBBackingStore;
-                else
-                    backingStoreType = DefaultBackingStore;
-            }
-        }
-#endif
-
-        if (backingStoreType == DefaultBackingStore || backingStoreType == SQLiteBackingStore)
+        if (backingStoreType == DefaultBackingStore)
             backingStore = IDBSQLiteBackingStore::open(securityOrigin.get(), dataDir, maximumSize, fileIdentifier, this);
 #if ENABLE(LEVELDB)
         else if (backingStoreType == LevelDBBackingStore)
@@ -126,17 +104,6 @@ void IDBFactoryBackendImpl::open(const String& name, PassRefPtr<IDBCallbacks> ca
     m_databaseBackendMap.set(uniqueIdentifier, databaseBackend.get());
 }
 
-void IDBFactoryBackendImpl::setEnableMigration(bool enabled)
-{
-    m_migrateEnabled = enabled;
-}
-
-bool IDBFactoryBackendImpl::migrate(const String& name, SecurityOrigin* securityOrigin, const String& dataDir, int64_t maximumSize)
-{
-    // FIXME: Implement migration.
-    return false;
-}
-
 } // namespace WebCore
 
 #endif // ENABLE(INDEXED_DATABASE)
index 94f24ec..ab6e153 100644 (file)
@@ -56,11 +56,9 @@ public:
     void removeIDBBackingStore(const String& uniqueIdentifier);
 
     virtual void open(const String& name, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*, const String& dataDir, int64_t maximumSize, BackingStoreType);
-    virtual void setEnableMigration(bool);
 
 private:
     IDBFactoryBackendImpl();
-    bool migrate(const String& name, SecurityOrigin*, const String& dataDir, int64_t maximumSize);
 
     typedef HashMap<String, IDBDatabaseBackendImpl*> IDBDatabaseBackendMap;
     IDBDatabaseBackendMap m_databaseBackendMap;
@@ -70,8 +68,6 @@ private:
 
     RefPtr<IDBTransactionCoordinator> m_transactionCoordinator;
 
-    bool m_migrateEnabled;
-
     // Only one instance of the factory should exist at any given time.
     static IDBFactoryBackendImpl* idbFactoryBackendImpl;
 };
index ee8475c..87362d4 100644 (file)
@@ -53,12 +53,10 @@ public:
 
     enum BackingStoreType {
         DefaultBackingStore,
-        LevelDBBackingStore,
-        SQLiteBackingStore
+        LevelDBBackingStore
     };
 
     virtual void open(const String& name, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*, const String& dataDir, int64_t maximumSize, BackingStoreType) = 0;
-    virtual void setEnableMigration(bool) = 0;
 };
 
 } // namespace WebCore
index acbe50d..3b0dd33 100644 (file)
@@ -1266,23 +1266,6 @@ PassRefPtr<IDBBackingStore::Transaction> IDBLevelDBBackingStore::createTransacti
     return adoptRef(new DummyTransaction());
 }
 
-bool IDBLevelDBBackingStore::backingStoreExists(SecurityOrigin* securityOrigin, const String& pathBaseArg)
-{
-    String pathBase = pathBaseArg;
-
-    if (pathBase.isEmpty())
-        return false;
-
-    // FIXME: We should eventually use the same LevelDB database for all origins.
-    String path = pathByAppendingComponent(pathBase, securityOrigin->databaseIdentifier() + ".indexeddb.leveldb");
-
-    // FIXME: It would be more thorough to open the database here but also more expensive.
-    if (fileExists(path+"/CURRENT"))
-        return true;
-
-    return false;
-}
-
 // FIXME: deleteDatabase should be part of IDBBackingStore.
 
 } // namespace WebCore
index 464062b..60f621a 100644 (file)
@@ -72,9 +72,6 @@ public:
     virtual PassRefPtr<Cursor> openIndexCursor(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange*, IDBCursor::Direction);
 
     virtual PassRefPtr<Transaction> createTransaction();
-    virtual IDBFactoryBackendInterface::BackingStoreType backingStoreType() { return IDBFactoryBackendInterface::LevelDBBackingStore; }
-
-    static bool backingStoreExists(SecurityOrigin*, const String& pathBase);
 
 private:
     IDBLevelDBBackingStore(String identifier, IDBFactoryBackendImpl*, PassOwnPtr<LevelDBDatabase>);
index f86c316..1a21c58 100644 (file)
@@ -991,18 +991,6 @@ PassRefPtr<IDBBackingStore::Cursor> IDBSQLiteBackingStore::openIndexCursor(int64
     return cursor.release();
 }
 
-bool IDBSQLiteBackingStore::backingStoreExists(SecurityOrigin* securityOrigin, const String& pathBase)
-{
-    String path = pathByAppendingComponent(pathBase, securityOrigin->databaseIdentifier() + ".indexeddb");
-
-    SQLiteDatabase db;
-    if (!db.open(path))
-        return false;
-
-    db.close();
-    return true;
-}
-
 namespace {
 
 class TransactionImpl : public IDBBackingStore::Transaction {
index 633a478..9efa060 100644 (file)
@@ -67,9 +67,6 @@ public:
     virtual PassRefPtr<Cursor> openIndexCursor(int64_t databaseId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange*, IDBCursor::Direction);
 
     virtual PassRefPtr<Transaction> createTransaction();
-    virtual IDBFactoryBackendInterface::BackingStoreType backingStoreType() { return IDBFactoryBackendInterface::SQLiteBackingStore; }
-
-    static bool backingStoreExists(SecurityOrigin*, const String& pathBase);
 
 private:
     IDBSQLiteBackingStore(String identifier, IDBFactoryBackendImpl*);
index e1229b4..c0a30fb 100644 (file)
@@ -1,3 +1,21 @@
+2011-05-25  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r87257.
+        http://trac.webkit.org/changeset/87257
+        https://bugs.webkit.org/show_bug.cgi?id=61457
+
+        This broke layout tests, see bug 61431. (Requested by
+        hwennborg on #webkit).
+
+        * public/WebIDBFactory.h:
+        * src/AssertMatchingEnums.cpp:
+        * src/IDBFactoryBackendProxy.cpp:
+        * src/IDBFactoryBackendProxy.h:
+        * src/WebIDBFactoryImpl.cpp:
+        (WebKit::WebIDBFactoryImpl::WebIDBFactoryImpl):
+        (WebKit::WebIDBFactoryImpl::open):
+        * src/WebIDBFactoryImpl.h:
+
 2011-05-24  Keishi Hattori  <keishi@webkit.org>
 
         Reviewed by Kent Tamura.
index 11a3b6a..97588d5 100755 (executable)
@@ -53,19 +53,13 @@ public:
 
     enum BackingStoreType {
         DefaultBackingStore,
-        LevelDBBackingStore,
-        SQLiteBackingStore
+        LevelDBBackingStore
     };
 
     // The WebKit implementation of open ignores the WebFrame* parameter.
     virtual void open(const WebString& name, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*, const WebString& dataDir, unsigned long long maximumSize, BackingStoreType) { WEBKIT_ASSERT_NOT_REACHED(); }
-    virtual void setEnableMigration(bool) { WEBKIT_ASSERT_NOT_REACHED(); }
 
     virtual void deleteDatabase(const WebString& name, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*, const WebString& dataDir) { WEBKIT_ASSERT_NOT_REACHED(); }
-
-    // Used for DumpRenderTree tests.
-    WEBKIT_API static void setOverrideBackingStoreType(BackingStoreType);
-    WEBKIT_API static void setTemporaryDatabaseFolder(const WebString& path);
 };
 
 } // namespace WebKit
index 860437f..97b99b6 100644 (file)
@@ -399,7 +399,6 @@ COMPILE_ASSERT_MATCHING_ENUM(WebIDBKey::NumberType, IDBKey::NumberType);
 
 COMPILE_ASSERT_MATCHING_ENUM(WebIDBFactory::DefaultBackingStore, IDBFactoryBackendInterface::DefaultBackingStore);
 COMPILE_ASSERT_MATCHING_ENUM(WebIDBFactory::LevelDBBackingStore, IDBFactoryBackendInterface::LevelDBBackingStore);
-COMPILE_ASSERT_MATCHING_ENUM(WebIDBFactory::SQLiteBackingStore, IDBFactoryBackendInterface::SQLiteBackingStore);
 
 #if ENABLE(FILE_SYSTEM)
 COMPILE_ASSERT_MATCHING_ENUM(WebFileSystem::TypeTemporary, AsyncFileSystem::Temporary);
index 555782f..04d3881 100755 (executable)
@@ -77,12 +77,6 @@ void IDBFactoryBackendProxy::open(const String& name, PassRefPtr<IDBCallbacks> c
     m_webIDBFactory->open(name, new WebIDBCallbacksImpl(callbacks), origin, webFrame, dataDir, maximumSize, static_cast<WebIDBFactory::BackingStoreType>(backingStoreType));
 }
 
-void IDBFactoryBackendProxy::setEnableMigration(bool enable)
-{
-    m_webIDBFactory->setEnableMigration(enable);
-}
-
-
 } // namespace WebKit
 
 #endif // ENABLE(INDEXED_DATABASE)
index b04ff3f..89ed355 100755 (executable)
@@ -46,7 +46,6 @@ public:
 
     PassRefPtr<WebCore::DOMStringList> databases(void) const;
     virtual void open(const String& name, PassRefPtr<WebCore::IDBCallbacks>, PassRefPtr<WebCore::SecurityOrigin>, WebCore::Frame*, const String& dataDir, int64_t maximumSize, BackingStoreType);
-    virtual void setEnableMigration(bool);
 
 private:
     IDBFactoryBackendProxy();
index 6a40af4..3689502 100755 (executable)
@@ -44,28 +44,14 @@ using namespace WebCore;
 
 namespace WebKit {
 
-static WebIDBFactory::BackingStoreType overriddenBackingStoreType = WebIDBFactory::DefaultBackingStore;
-static WebString tempDatabaseFolder;
-
 WebIDBFactory* WebIDBFactory::create()
 {
     return new WebIDBFactoryImpl();
 }
 
-void WebIDBFactory::setOverrideBackingStoreType(BackingStoreType type)
-{
-    overriddenBackingStoreType = type;
-}
-
-void WebIDBFactory::setTemporaryDatabaseFolder(const WebString& path)
-{
-    tempDatabaseFolder = path;
-}
-
 WebIDBFactoryImpl::WebIDBFactoryImpl()
     : m_idbFactoryBackend(IDBFactoryBackendImpl::create())
 {
-    m_idbFactoryBackend->setEnableMigration(true);
 }
 
 WebIDBFactoryImpl::~WebIDBFactoryImpl()
@@ -74,24 +60,7 @@ WebIDBFactoryImpl::~WebIDBFactoryImpl()
 
 void WebIDBFactoryImpl::open(const WebString& name, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame*, const WebString& dataDir, unsigned long long maximumSize, BackingStoreType backingStoreType)
 {
-    WebString path = dataDir;
-    if (overriddenBackingStoreType != DefaultBackingStore) {
-        backingStoreType = overriddenBackingStoreType;
-
-        // The dataDir is empty for two reasons: LevelDB in icognito mode or
-        // LevelDB from DumpRenderTree. The first case is taken care of inside
-        // IDBFactoryBackendImpl.cpp by forcing SQLITE backend for incognito.
-        // For the DumpRenderTree case we need to keep track of the location
-        // so we can wipe it out when we're done with the test.
-        if (dataDir.isEmpty() && backingStoreType == LevelDBBackingStore)
-            path = tempDatabaseFolder;
-    }
-    m_idbFactoryBackend->open(name, IDBCallbacksProxy::create(adoptPtr(callbacks)), origin, 0, path, maximumSize, static_cast<IDBFactoryBackendInterface::BackingStoreType>(backingStoreType));
-}
-
-void WebIDBFactoryImpl::setEnableMigration(bool enable)
-{
-    m_idbFactoryBackend->setEnableMigration(enable);
+    m_idbFactoryBackend->open(name, IDBCallbacksProxy::create(adoptPtr(callbacks)), origin, 0, dataDir, maximumSize, static_cast<IDBFactoryBackendInterface::BackingStoreType>(backingStoreType));
 }
 
 } // namespace WebKit
index f6f1807..62bd9ed 100755 (executable)
@@ -45,7 +45,6 @@ public:
     virtual ~WebIDBFactoryImpl();
 
     virtual void open(const WebString& name, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*, const WebString& dataDir, unsigned long long maximumSize, BackingStoreType);
-    virtual void setEnableMigration(bool);
 
 private:
     WTF::RefPtr<WebCore::IDBFactoryBackendInterface> m_idbFactoryBackend;
index 532efe7..c4f286c 100644 (file)
@@ -1,3 +1,17 @@
+2011-05-25  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r87257.
+        http://trac.webkit.org/changeset/87257
+        https://bugs.webkit.org/show_bug.cgi?id=61457
+
+        This broke layout tests, see bug 61431. (Requested by
+        hwennborg on #webkit).
+
+        * DumpRenderTree/chromium/LayoutTestController.cpp:
+        (LayoutTestController::LayoutTestController):
+        (LayoutTestController::clearAllDatabases):
+        * DumpRenderTree/chromium/LayoutTestController.h:
+
 2011-05-25  Qi Zhang  <qi.2.zhang@nokia.com>
 
         Reviewed by Andreas Kling.
index bf42200..33a5580 100644 (file)
@@ -44,7 +44,6 @@
 #include "WebElement.h"
 #include "WebFrame.h"
 #include "WebGeolocationClientMock.h"
-#include "WebIDBFactory.h"
 #include "WebInputElement.h"
 #include "WebKit.h"
 #include "WebNotificationPresenter.h"
@@ -83,7 +82,6 @@ LayoutTestController::LayoutTestController(TestShell* shell)
     // names to their methods will be done by calling bindToJavaScript() (defined
     // by CppBoundClass, the parent to LayoutTestController).
     bindMethod("addFileToPasteboardOnDrag", &LayoutTestController::addFileToPasteboardOnDrag);
-    bindMethod("addMockSpeechInputResult", &LayoutTestController::addMockSpeechInputResult);
     bindMethod("addOriginAccessWhitelistEntry", &LayoutTestController::addOriginAccessWhitelistEntry);
     bindMethod("addUserScript", &LayoutTestController::addUserScript);
     bindMethod("addUserStyleSheet", &LayoutTestController::addUserStyleSheet);
@@ -161,7 +159,7 @@ LayoutTestController::LayoutTestController(TestShell* shell)
     bindMethod("setMockDeviceOrientation", &LayoutTestController::setMockDeviceOrientation);
     bindMethod("setMockGeolocationError", &LayoutTestController::setMockGeolocationError);
     bindMethod("setMockGeolocationPosition", &LayoutTestController::setMockGeolocationPosition);
-    bindMethod("setOverrideIndexedDBBackingStore", &LayoutTestController::setOverrideIndexedDBBackingStore);
+    bindMethod("addMockSpeechInputResult", &LayoutTestController::addMockSpeechInputResult);
     bindMethod("setPageVisibility", &LayoutTestController::setPageVisibility);
     bindMethod("setPluginsEnabled", &LayoutTestController::setPluginsEnabled);
     bindMethod("setPopupBlockingEnabled", &LayoutTestController::setPopupBlockingEnabled);
@@ -1129,29 +1127,6 @@ void LayoutTestController::setIconDatabaseEnabled(const CppArgumentList&, CppVar
     result->setNull();
 }
 
-void LayoutTestController::setOverrideIndexedDBBackingStore(const CppArgumentList& arguments, CppVariant* result)
-{
-    result->setNull();
-#if ENABLE(INDEXED_DATABASE)
-    if (arguments.size() < 1 || !arguments[0].isString())
-        return;
-    string name = arguments[0].toString();
-    if (name == "sqlite")
-        WebIDBFactory::setOverrideBackingStoreType(WebIDBFactory::SQLiteBackingStore);
-    else if (name == "default")
-        WebIDBFactory::setOverrideBackingStoreType(WebIDBFactory::DefaultBackingStore);
-    else if (name == "leveldb") {
-        WebIDBFactory::setOverrideBackingStoreType(WebIDBFactory::LevelDBBackingStore);
-
-        m_tempFolder = adoptPtr(webkit_support::CreateScopedTempDirectory());
-        if (m_tempFolder) {
-            if (m_tempFolder->CreateUniqueTempDir())
-                WebIDBFactory::setTemporaryDatabaseFolder(WebString::fromUTF8(m_tempFolder->path().c_str()));
-        }
-    }
-#endif
-}
-
 void LayoutTestController::callShouldCloseOnWebView(const CppArgumentList&, CppVariant* result)
 {
     result->set(m_shell->webView()->dispatchBeforeUnloadEvent());
@@ -1517,7 +1492,6 @@ void LayoutTestController::clearAllDatabases(const CppArgumentList& arguments, C
 {
     result->setNull();
     webkit_support::ClearAllDatabases();
-    m_tempFolder.clear();
 }
 
 void LayoutTestController::setDatabaseQuota(const CppArgumentList& arguments, CppVariant* result)
index ef782e5..c4e95a7 100644 (file)
@@ -56,10 +56,6 @@ class WebSpeechInputControllerMock;
 class WebSpeechInputListener;
 }
 
-namespace webkit_support {
-class ScopedTempDirectory;
-}
-
 class TestShell;
 
 class LayoutTestController : public CppBoundClass {
@@ -308,8 +304,6 @@ public:
     void clearAllDatabases(const CppArgumentList&, CppVariant*);
     // Sets the default quota for all origins
     void setDatabaseQuota(const CppArgumentList&, CppVariant*);
-    // Overrides the backend for IndexedDB
-    void setOverrideIndexedDBBackingStore(const CppArgumentList&, CppVariant*);
 
     // Calls setlocale(LC_ALL, ...) for a specified locale.
     // Resets between tests.
@@ -593,9 +587,6 @@ private:
 
     CppVariant m_globalFlag;
 
-    // Used to create and destroy temporary folders.
-    OwnPtr<webkit_support::ScopedTempDirectory> m_tempFolder;
-
     // Bound variable counting the number of top URLs visited.
     CppVariant m_webHistoryItemCount;