Diff
Modified: trunk/Source/WebCore/ChangeLog (90136 => 90137)
--- trunk/Source/WebCore/ChangeLog 2011-06-30 18:22:00 UTC (rev 90136)
+++ trunk/Source/WebCore/ChangeLog 2011-06-30 18:32:30 UTC (rev 90137)
@@ -1,3 +1,20 @@
+2011-06-28 Hans Wennborg <[email protected]>
+
+ Reviewed by Tony Chang.
+
+ IndexedDB: Prepare for running layout tests with LevelDB
+ https://bugs.webkit.org/show_bug.cgi?id=63593
+
+ Migration of data from SQLite to LevelDB must be done before the
+ m_backingStore map is checked for an open LevelDB, because if a
+ previous layout test has used LevelDB, it will be in the
+ m_backingStore map.
+
+ Covered by existing layout tests.
+
+ * storage/IDBFactoryBackendImpl.cpp:
+ (WebCore::IDBFactoryBackendImpl::open):
+
2011-06-30 Pavel Feldman <[email protected]>
Reviewed by Yury Semikhatsky.
Modified: trunk/Source/WebCore/storage/IDBFactoryBackendImpl.cpp (90136 => 90137)
--- trunk/Source/WebCore/storage/IDBFactoryBackendImpl.cpp 2011-06-30 18:22:00 UTC (rev 90136)
+++ trunk/Source/WebCore/storage/IDBFactoryBackendImpl.cpp 2011-06-30 18:32:30 UTC (rev 90137)
@@ -83,8 +83,7 @@
void IDBFactoryBackendImpl::open(const String& name, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<SecurityOrigin> securityOrigin, Frame*, const String& dataDir, int64_t maximumSize, BackingStoreType backingStoreType)
{
- if (backingStoreType == DefaultBackingStore)
- backingStoreType = SQLiteBackingStore; // FIXME: DefaultBackingStore is confusing; get rid of it.
+ ASSERT(backingStoreType != DefaultBackingStore);
const String fileIdentifier = computeFileIdentifier(securityOrigin.get(), backingStoreType);
const String uniqueIdentifier = computeUniqueIdentifier(name, securityOrigin.get(), backingStoreType);
@@ -97,28 +96,27 @@
// 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()))
- backingStore = it2->second;
- else {
-
#if ENABLE(LEVELDB)
- if (backingStoreType == LevelDBBackingStore) {
- bool hasSQLBackingStore = IDBSQLiteBackingStore::backingStoreExists(securityOrigin.get(), name, dataDir);
+ if (backingStoreType == LevelDBBackingStore) {
+ bool hasSQLBackingStore = IDBSQLiteBackingStore::backingStoreExists(securityOrigin.get(), name, dataDir);
- // LayoutTests: SQLite backing store may not exist on disk but may exist in cache.
- String cachedSqliteBackingStoreIdentifier = computeFileIdentifier(securityOrigin.get(), SQLiteBackingStore);
- if (!hasSQLBackingStore && (m_backingStoreMap.end() != m_backingStoreMap.find(cachedSqliteBackingStoreIdentifier)))
- hasSQLBackingStore = true;
+ // LayoutTests: SQLite backing store may not exist on disk but may exist in cache.
+ String cachedSqliteBackingStoreIdentifier = computeFileIdentifier(securityOrigin.get(), SQLiteBackingStore);
+ if (!hasSQLBackingStore && (m_backingStoreMap.end() != m_backingStoreMap.find(cachedSqliteBackingStoreIdentifier)))
+ hasSQLBackingStore = true;
- if (hasSQLBackingStore) {
- bool migrationSucceeded = migrateFromSQLiteToLevelDB(name, securityOrigin.get(), dataDir, maximumSize);
- (void)migrationSucceeded; // FIXME: When migration is actually implemented, we need error handling here.
- }
+ if (hasSQLBackingStore) {
+ bool migrationSucceeded = migrateFromSQLiteToLevelDB(name, securityOrigin.get(), dataDir, maximumSize);
+ UNUSED_PARAM(migrationSucceeded); // FIXME: When migration is actually implemented, we need error handling here.
}
+ }
#endif
+ RefPtr<IDBBackingStore> backingStore;
+ IDBBackingStoreMap::iterator it2 = m_backingStoreMap.find(fileIdentifier);
+ if (it2 != m_backingStoreMap.end() && (backingStoreType == it2->second->backingStoreType()))
+ backingStore = it2->second;
+ else {
if (backingStoreType == SQLiteBackingStore)
backingStore = IDBSQLiteBackingStore::open(securityOrigin.get(), dataDir, maximumSize, fileIdentifier, this);
#if ENABLE(LEVELDB)
Modified: trunk/Source/WebKit/chromium/ChangeLog (90136 => 90137)
--- trunk/Source/WebKit/chromium/ChangeLog 2011-06-30 18:22:00 UTC (rev 90136)
+++ trunk/Source/WebKit/chromium/ChangeLog 2011-06-30 18:32:30 UTC (rev 90137)
@@ -1,3 +1,16 @@
+2011-06-28 Hans Wennborg <[email protected]>
+
+ Reviewed by Tony Chang.
+
+ IndexedDB: Prepare for running layout tests with LevelDB
+ https://bugs.webkit.org/show_bug.cgi?id=63593
+
+ WebIDBFactory should decide what DefaultBackingStore means.
+ Also fix handling of layout test and incognito mode properly.
+
+ * src/WebIDBFactoryImpl.cpp:
+ (WebKit::WebIDBFactoryImpl::open):
+
2011-06-30 Alexander Pavlov <[email protected]>
Reviewed by Kent Tamura.
Modified: trunk/Source/WebKit/chromium/src/WebIDBFactoryImpl.cpp (90136 => 90137)
--- trunk/Source/WebKit/chromium/src/WebIDBFactoryImpl.cpp 2011-06-30 18:22:00 UTC (rev 90136)
+++ trunk/Source/WebKit/chromium/src/WebIDBFactoryImpl.cpp 2011-06-30 18:32:30 UTC (rev 90137)
@@ -74,20 +74,23 @@
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) {
// Backing store type overridden by LayoutTestController.
backingStoreType = overriddenBackingStoreType;
+ }
- // dataDir is empty for layout tests.
- ASSERT(dataDir.isEmpty());
+ if (backingStoreType == DefaultBackingStore)
+ backingStoreType = SQLiteBackingStore;
- if (backingStoreType == LevelDBBackingStore) {
- // LevelDB doesn't support in-memory databases, so use a temporary folder.
+ if (dataDir.isEmpty() && backingStoreType == LevelDBBackingStore) {
+ if (!tempDatabaseFolder.isEmpty()) {
+ // Layout tests provide a temporary folder.
path = tempDatabaseFolder;
+ } else {
+ // For incognito mode, fall back to SQLite.
+ backingStoreType = SQLiteBackingStore;
}
- } else if (dataDir.isEmpty() && backingStoreType == LevelDBBackingStore) {
- // Fall back to SQLite for incognito mode.
- backingStoreType = SQLiteBackingStore;
}
m_idbFactoryBackend->open(name, IDBCallbacksProxy::create(adoptPtr(callbacks)), origin, 0, path, maximumSize, static_cast<IDBFactoryBackendInterface::BackingStoreType>(backingStoreType));
Modified: trunk/Tools/ChangeLog (90136 => 90137)
--- trunk/Tools/ChangeLog 2011-06-30 18:22:00 UTC (rev 90136)
+++ trunk/Tools/ChangeLog 2011-06-30 18:32:30 UTC (rev 90137)
@@ -1,3 +1,21 @@
+2011-06-28 Hans Wennborg <[email protected]>
+
+ Reviewed by Tony Chang.
+
+ IndexedDB: Prepare for running layout tests with LevelDB
+ https://bugs.webkit.org/show_bug.cgi?id=63593
+
+ The TestShell must always provide a temporary folder for LevelDB,
+ not just when the backing store type is overridden.
+
+ * DumpRenderTree/chromium/LayoutTestController.cpp:
+ (LayoutTestController::setOverrideIndexedDBBackingStore):
+ (LayoutTestController::clearAllDatabases):
+ * DumpRenderTree/chromium/LayoutTestController.h:
+ * DumpRenderTree/chromium/TestShell.cpp:
+ (TestShell::TestShell):
+ * DumpRenderTree/chromium/TestShell.h:
+
2011-06-30 Zsolt Fehér <[email protected]>
Reviewed by Csaba Osztrogonác.
Modified: trunk/Tools/DumpRenderTree/chromium/LayoutTestController.cpp (90136 => 90137)
--- trunk/Tools/DumpRenderTree/chromium/LayoutTestController.cpp 2011-06-30 18:22:00 UTC (rev 90136)
+++ trunk/Tools/DumpRenderTree/chromium/LayoutTestController.cpp 2011-06-30 18:32:30 UTC (rev 90137)
@@ -1090,15 +1090,8 @@
WebIDBFactory::setOverrideBackingStoreType(WebIDBFactory::DefaultBackingStore);
else if (name == "sqlite")
WebIDBFactory::setOverrideBackingStoreType(WebIDBFactory::SQLiteBackingStore);
- else if (name == "leveldb") {
+ 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
}
@@ -1483,7 +1476,6 @@
{
result->setNull();
webkit_support::ClearAllDatabases();
- m_tempFolder.clear();
}
void LayoutTestController::setDatabaseQuota(const CppArgumentList& arguments, CppVariant* result)
Modified: trunk/Tools/DumpRenderTree/chromium/LayoutTestController.h (90136 => 90137)
--- trunk/Tools/DumpRenderTree/chromium/LayoutTestController.h 2011-06-30 18:22:00 UTC (rev 90136)
+++ trunk/Tools/DumpRenderTree/chromium/LayoutTestController.h 2011-06-30 18:32:30 UTC (rev 90137)
@@ -606,9 +606,6 @@
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;
Modified: trunk/Tools/DumpRenderTree/chromium/TestShell.cpp (90136 => 90137)
--- trunk/Tools/DumpRenderTree/chromium/TestShell.cpp 2011-06-30 18:22:00 UTC (rev 90136)
+++ trunk/Tools/DumpRenderTree/chromium/TestShell.cpp 2011-06-30 18:32:30 UTC (rev 90137)
@@ -39,6 +39,7 @@
#include "WebElement.h"
#include "WebFrame.h"
#include "WebHistoryItem.h"
+#include "WebIDBFactory.h"
#include "WebTestingSupport.h"
#include "WebKit.h"
#include "WebPermissions.h"
@@ -132,6 +133,12 @@
// timed-out DRT process was crashed.
m_timeout = 30 * 1000;
+#if ENABLE(INDEXED_DATABASE)
+ m_tempIndexedDBDirectory = adoptPtr(webkit_support::CreateScopedTempDirectory());
+ m_tempIndexedDBDirectory->CreateUniqueTempDir();
+ WebIDBFactory::setTemporaryDatabaseFolder(WebString::fromUTF8(m_tempIndexedDBDirectory->path().c_str()));
+#endif
+
createMainWindow();
}
Modified: trunk/Tools/DumpRenderTree/chromium/TestShell.h (90136 => 90137)
--- trunk/Tools/DumpRenderTree/chromium/TestShell.h 2011-06-30 18:22:00 UTC (rev 90136)
+++ trunk/Tools/DumpRenderTree/chromium/TestShell.h 2011-06-30 18:32:30 UTC (rev 90137)
@@ -231,6 +231,9 @@
// Used by the watchdog to know when it's finished.
HANDLE m_finishedEvent;
#endif
+
+ // Temporary directory for IndexedDB (LevelDB doesn't support in-memory databases.)
+ OwnPtr<webkit_support::ScopedTempDirectory> m_tempIndexedDBDirectory;
};
void platformInit(int*, char***);