Changeset 87313 in webkit
- Timestamp:
- May 25, 2011 12:23:39 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r87311 r87313 1 2011-05-25 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r87257. 4 http://trac.webkit.org/changeset/87257 5 https://bugs.webkit.org/show_bug.cgi?id=61457 6 7 This broke layout tests, see bug 61431. (Requested by 8 hwennborg on #webkit). 9 10 * storage/indexeddb/migrate-basics-expected.txt: Removed. 11 * storage/indexeddb/migrate-basics.html: Removed. 12 1 13 2011-05-25 Qi Zhang <qi.2.zhang@nokia.com> 2 14 -
trunk/Source/WebCore/ChangeLog
r87312 r87313 1 2011-05-25 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r87257. 4 http://trac.webkit.org/changeset/87257 5 https://bugs.webkit.org/show_bug.cgi?id=61457 6 7 This broke layout tests, see bug 61431. (Requested by 8 hwennborg on #webkit). 9 10 * storage/IDBBackingStore.h: 11 * storage/IDBFactoryBackendImpl.cpp: 12 (WebCore::IDBFactoryBackendImpl::IDBFactoryBackendImpl): 13 (WebCore::IDBFactoryBackendImpl::open): 14 * storage/IDBFactoryBackendImpl.h: 15 * storage/IDBFactoryBackendInterface.h: 16 * storage/IDBLevelDBBackingStore.cpp: 17 * storage/IDBLevelDBBackingStore.h: 18 * storage/IDBSQLiteBackingStore.cpp: 19 * storage/IDBSQLiteBackingStore.h: 20 1 21 2011-05-25 Alexis Menard <alexis.menard@openbossa.org> 2 22 -
trunk/Source/WebCore/storage/IDBBackingStore.h
r87257 r87313 30 30 31 31 #include "IDBCursor.h" 32 #include "IDBFactoryBackendImpl.h"33 #include "IDBFactoryBackendInterface.h"34 32 #include "SQLiteDatabase.h" 35 33 #include <wtf/PassRefPtr.h> … … 40 38 namespace WebCore { 41 39 40 class IDBFactoryBackendImpl; 42 41 class IDBKey; 43 42 class IDBKeyRange; … … 108 107 }; 109 108 virtual PassRefPtr<Transaction> createTransaction() = 0; 110 virtual IDBFactoryBackendInterface::BackingStoreType backingStoreType() = 0;111 109 }; 112 110 -
trunk/Source/WebCore/storage/IDBFactoryBackendImpl.cpp
r87257 r87313 46 46 IDBFactoryBackendImpl::IDBFactoryBackendImpl() 47 47 : m_transactionCoordinator(IDBTransactionCoordinator::create()) 48 , m_migrateEnabled(false)49 48 { 50 49 } … … 78 77 IDBDatabaseBackendMap::iterator it = m_databaseBackendMap.find(uniqueIdentifier); 79 78 if (it != m_databaseBackendMap.end()) { 80 // Also check that backing store types match: this is important for migration. 81 if ((backingStoreType == DefaultBackingStore) || (backingStoreType == it->second->backingStore()->backingStoreType())) { 82 callbacks->onSuccess(it->second); 83 return; 84 } 79 callbacks->onSuccess(it->second); 80 return; 85 81 } 86 82 … … 89 85 RefPtr<IDBBackingStore> backingStore; 90 86 IDBBackingStoreMap::iterator it2 = m_backingStoreMap.find(fileIdentifier); 91 if (it2 != m_backingStoreMap.end() && (backingStoreType == it2->second->backingStoreType()))87 if (it2 != m_backingStoreMap.end()) 92 88 backingStore = it2->second; 93 89 else { 94 #if ENABLE(LEVELDB) 95 if (m_migrateEnabled) { 96 bool hasSQLBackend = IDBSQLiteBackingStore::backingStoreExists(securityOrigin.get(), dataDir); 97 bool hasLevelDbBackend = IDBLevelDBBackingStore::backingStoreExists(securityOrigin.get(), dataDir); 98 99 if (hasSQLBackend && hasLevelDbBackend) 100 backingStoreType = LevelDBBackingStore; 101 102 // Migration: if the database exists and is SQLite we want to migrate it to LevelDB. 103 if (hasSQLBackend && !hasLevelDbBackend) { 104 if (migrate(name, securityOrigin.get(), dataDir, maximumSize)) 105 backingStoreType = LevelDBBackingStore; 106 else 107 backingStoreType = DefaultBackingStore; 108 } 109 } 110 #endif 111 112 if (backingStoreType == DefaultBackingStore || backingStoreType == SQLiteBackingStore) 90 if (backingStoreType == DefaultBackingStore) 113 91 backingStore = IDBSQLiteBackingStore::open(securityOrigin.get(), dataDir, maximumSize, fileIdentifier, this); 114 92 #if ENABLE(LEVELDB) … … 127 105 } 128 106 129 void IDBFactoryBackendImpl::setEnableMigration(bool enabled)130 {131 m_migrateEnabled = enabled;132 }133 134 bool IDBFactoryBackendImpl::migrate(const String& name, SecurityOrigin* securityOrigin, const String& dataDir, int64_t maximumSize)135 {136 // FIXME: Implement migration.137 return false;138 }139 140 107 } // namespace WebCore 141 108 -
trunk/Source/WebCore/storage/IDBFactoryBackendImpl.h
r87257 r87313 57 57 58 58 virtual void open(const String& name, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*, const String& dataDir, int64_t maximumSize, BackingStoreType); 59 virtual void setEnableMigration(bool);60 59 61 60 private: 62 61 IDBFactoryBackendImpl(); 63 bool migrate(const String& name, SecurityOrigin*, const String& dataDir, int64_t maximumSize);64 62 65 63 typedef HashMap<String, IDBDatabaseBackendImpl*> IDBDatabaseBackendMap; … … 70 68 71 69 RefPtr<IDBTransactionCoordinator> m_transactionCoordinator; 72 73 bool m_migrateEnabled;74 70 75 71 // Only one instance of the factory should exist at any given time. -
trunk/Source/WebCore/storage/IDBFactoryBackendInterface.h
r87257 r87313 54 54 enum BackingStoreType { 55 55 DefaultBackingStore, 56 LevelDBBackingStore, 57 SQLiteBackingStore 56 LevelDBBackingStore 58 57 }; 59 58 60 59 virtual void open(const String& name, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*, const String& dataDir, int64_t maximumSize, BackingStoreType) = 0; 61 virtual void setEnableMigration(bool) = 0;62 60 }; 63 61 -
trunk/Source/WebCore/storage/IDBLevelDBBackingStore.cpp
r87257 r87313 1267 1267 } 1268 1268 1269 bool IDBLevelDBBackingStore::backingStoreExists(SecurityOrigin* securityOrigin, const String& pathBaseArg)1270 {1271 String pathBase = pathBaseArg;1272 1273 if (pathBase.isEmpty())1274 return false;1275 1276 // FIXME: We should eventually use the same LevelDB database for all origins.1277 String path = pathByAppendingComponent(pathBase, securityOrigin->databaseIdentifier() + ".indexeddb.leveldb");1278 1279 // FIXME: It would be more thorough to open the database here but also more expensive.1280 if (fileExists(path+"/CURRENT"))1281 return true;1282 1283 return false;1284 }1285 1286 1269 // FIXME: deleteDatabase should be part of IDBBackingStore. 1287 1270 -
trunk/Source/WebCore/storage/IDBLevelDBBackingStore.h
r87257 r87313 73 73 74 74 virtual PassRefPtr<Transaction> createTransaction(); 75 virtual IDBFactoryBackendInterface::BackingStoreType backingStoreType() { return IDBFactoryBackendInterface::LevelDBBackingStore; }76 77 static bool backingStoreExists(SecurityOrigin*, const String& pathBase);78 75 79 76 private: -
trunk/Source/WebCore/storage/IDBSQLiteBackingStore.cpp
r87257 r87313 992 992 } 993 993 994 bool IDBSQLiteBackingStore::backingStoreExists(SecurityOrigin* securityOrigin, const String& pathBase)995 {996 String path = pathByAppendingComponent(pathBase, securityOrigin->databaseIdentifier() + ".indexeddb");997 998 SQLiteDatabase db;999 if (!db.open(path))1000 return false;1001 1002 db.close();1003 return true;1004 }1005 1006 994 namespace { 1007 995 -
trunk/Source/WebCore/storage/IDBSQLiteBackingStore.h
r87257 r87313 68 68 69 69 virtual PassRefPtr<Transaction> createTransaction(); 70 virtual IDBFactoryBackendInterface::BackingStoreType backingStoreType() { return IDBFactoryBackendInterface::SQLiteBackingStore; }71 72 static bool backingStoreExists(SecurityOrigin*, const String& pathBase);73 70 74 71 private: -
trunk/Source/WebKit/chromium/ChangeLog
r87274 r87313 1 2011-05-25 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r87257. 4 http://trac.webkit.org/changeset/87257 5 https://bugs.webkit.org/show_bug.cgi?id=61457 6 7 This broke layout tests, see bug 61431. (Requested by 8 hwennborg on #webkit). 9 10 * public/WebIDBFactory.h: 11 * src/AssertMatchingEnums.cpp: 12 * src/IDBFactoryBackendProxy.cpp: 13 * src/IDBFactoryBackendProxy.h: 14 * src/WebIDBFactoryImpl.cpp: 15 (WebKit::WebIDBFactoryImpl::WebIDBFactoryImpl): 16 (WebKit::WebIDBFactoryImpl::open): 17 * src/WebIDBFactoryImpl.h: 18 1 19 2011-05-24 Keishi Hattori <keishi@webkit.org> 2 20 -
trunk/Source/WebKit/chromium/public/WebIDBFactory.h
r87257 r87313 54 54 enum BackingStoreType { 55 55 DefaultBackingStore, 56 LevelDBBackingStore, 57 SQLiteBackingStore 56 LevelDBBackingStore 58 57 }; 59 58 60 59 // The WebKit implementation of open ignores the WebFrame* parameter. 61 60 virtual void open(const WebString& name, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*, const WebString& dataDir, unsigned long long maximumSize, BackingStoreType) { WEBKIT_ASSERT_NOT_REACHED(); } 62 virtual void setEnableMigration(bool) { WEBKIT_ASSERT_NOT_REACHED(); }63 61 64 62 virtual void deleteDatabase(const WebString& name, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*, const WebString& dataDir) { WEBKIT_ASSERT_NOT_REACHED(); } 65 66 // Used for DumpRenderTree tests.67 WEBKIT_API static void setOverrideBackingStoreType(BackingStoreType);68 WEBKIT_API static void setTemporaryDatabaseFolder(const WebString& path);69 63 }; 70 64 -
trunk/Source/WebKit/chromium/src/AssertMatchingEnums.cpp
r87257 r87313 400 400 COMPILE_ASSERT_MATCHING_ENUM(WebIDBFactory::DefaultBackingStore, IDBFactoryBackendInterface::DefaultBackingStore); 401 401 COMPILE_ASSERT_MATCHING_ENUM(WebIDBFactory::LevelDBBackingStore, IDBFactoryBackendInterface::LevelDBBackingStore); 402 COMPILE_ASSERT_MATCHING_ENUM(WebIDBFactory::SQLiteBackingStore, IDBFactoryBackendInterface::SQLiteBackingStore);403 402 404 403 #if ENABLE(FILE_SYSTEM) -
trunk/Source/WebKit/chromium/src/IDBFactoryBackendProxy.cpp
r87257 r87313 78 78 } 79 79 80 void IDBFactoryBackendProxy::setEnableMigration(bool enable)81 {82 m_webIDBFactory->setEnableMigration(enable);83 }84 85 86 80 } // namespace WebKit 87 81 -
trunk/Source/WebKit/chromium/src/IDBFactoryBackendProxy.h
r87257 r87313 47 47 PassRefPtr<WebCore::DOMStringList> databases(void) const; 48 48 virtual void open(const String& name, PassRefPtr<WebCore::IDBCallbacks>, PassRefPtr<WebCore::SecurityOrigin>, WebCore::Frame*, const String& dataDir, int64_t maximumSize, BackingStoreType); 49 virtual void setEnableMigration(bool);50 49 51 50 private: -
trunk/Source/WebKit/chromium/src/WebIDBFactoryImpl.cpp
r87257 r87313 45 45 namespace WebKit { 46 46 47 static WebIDBFactory::BackingStoreType overriddenBackingStoreType = WebIDBFactory::DefaultBackingStore;48 static WebString tempDatabaseFolder;49 50 47 WebIDBFactory* WebIDBFactory::create() 51 48 { … … 53 50 } 54 51 55 void WebIDBFactory::setOverrideBackingStoreType(BackingStoreType type)56 {57 overriddenBackingStoreType = type;58 }59 60 void WebIDBFactory::setTemporaryDatabaseFolder(const WebString& path)61 {62 tempDatabaseFolder = path;63 }64 65 52 WebIDBFactoryImpl::WebIDBFactoryImpl() 66 53 : m_idbFactoryBackend(IDBFactoryBackendImpl::create()) 67 54 { 68 m_idbFactoryBackend->setEnableMigration(true);69 55 } 70 56 … … 75 61 void WebIDBFactoryImpl::open(const WebString& name, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame*, const WebString& dataDir, unsigned long long maximumSize, BackingStoreType backingStoreType) 76 62 { 77 WebString path = dataDir; 78 if (overriddenBackingStoreType != DefaultBackingStore) { 79 backingStoreType = overriddenBackingStoreType; 80 81 // The dataDir is empty for two reasons: LevelDB in icognito mode or 82 // LevelDB from DumpRenderTree. The first case is taken care of inside 83 // IDBFactoryBackendImpl.cpp by forcing SQLITE backend for incognito. 84 // For the DumpRenderTree case we need to keep track of the location 85 // so we can wipe it out when we're done with the test. 86 if (dataDir.isEmpty() && backingStoreType == LevelDBBackingStore) 87 path = tempDatabaseFolder; 88 } 89 m_idbFactoryBackend->open(name, IDBCallbacksProxy::create(adoptPtr(callbacks)), origin, 0, path, maximumSize, static_cast<IDBFactoryBackendInterface::BackingStoreType>(backingStoreType)); 90 } 91 92 void WebIDBFactoryImpl::setEnableMigration(bool enable) 93 { 94 m_idbFactoryBackend->setEnableMigration(enable); 63 m_idbFactoryBackend->open(name, IDBCallbacksProxy::create(adoptPtr(callbacks)), origin, 0, dataDir, maximumSize, static_cast<IDBFactoryBackendInterface::BackingStoreType>(backingStoreType)); 95 64 } 96 65 -
trunk/Source/WebKit/chromium/src/WebIDBFactoryImpl.h
r87257 r87313 46 46 47 47 virtual void open(const WebString& name, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*, const WebString& dataDir, unsigned long long maximumSize, BackingStoreType); 48 virtual void setEnableMigration(bool);49 48 50 49 private: -
trunk/Tools/ChangeLog
r87311 r87313 1 2011-05-25 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r87257. 4 http://trac.webkit.org/changeset/87257 5 https://bugs.webkit.org/show_bug.cgi?id=61457 6 7 This broke layout tests, see bug 61431. (Requested by 8 hwennborg on #webkit). 9 10 * DumpRenderTree/chromium/LayoutTestController.cpp: 11 (LayoutTestController::LayoutTestController): 12 (LayoutTestController::clearAllDatabases): 13 * DumpRenderTree/chromium/LayoutTestController.h: 14 1 15 2011-05-25 Qi Zhang <qi.2.zhang@nokia.com> 2 16 -
trunk/Tools/DumpRenderTree/chromium/LayoutTestController.cpp
r87257 r87313 45 45 #include "WebFrame.h" 46 46 #include "WebGeolocationClientMock.h" 47 #include "WebIDBFactory.h"48 47 #include "WebInputElement.h" 49 48 #include "WebKit.h" … … 84 83 // by CppBoundClass, the parent to LayoutTestController). 85 84 bindMethod("addFileToPasteboardOnDrag", &LayoutTestController::addFileToPasteboardOnDrag); 86 bindMethod("addMockSpeechInputResult", &LayoutTestController::addMockSpeechInputResult);87 85 bindMethod("addOriginAccessWhitelistEntry", &LayoutTestController::addOriginAccessWhitelistEntry); 88 86 bindMethod("addUserScript", &LayoutTestController::addUserScript); … … 162 160 bindMethod("setMockGeolocationError", &LayoutTestController::setMockGeolocationError); 163 161 bindMethod("setMockGeolocationPosition", &LayoutTestController::setMockGeolocationPosition); 164 bindMethod(" setOverrideIndexedDBBackingStore", &LayoutTestController::setOverrideIndexedDBBackingStore);162 bindMethod("addMockSpeechInputResult", &LayoutTestController::addMockSpeechInputResult); 165 163 bindMethod("setPageVisibility", &LayoutTestController::setPageVisibility); 166 164 bindMethod("setPluginsEnabled", &LayoutTestController::setPluginsEnabled); … … 1128 1126 // We don't use the WebKit icon database. 1129 1127 result->setNull(); 1130 }1131 1132 void LayoutTestController::setOverrideIndexedDBBackingStore(const CppArgumentList& arguments, CppVariant* result)1133 {1134 result->setNull();1135 #if ENABLE(INDEXED_DATABASE)1136 if (arguments.size() < 1 || !arguments[0].isString())1137 return;1138 string name = arguments[0].toString();1139 if (name == "sqlite")1140 WebIDBFactory::setOverrideBackingStoreType(WebIDBFactory::SQLiteBackingStore);1141 else if (name == "default")1142 WebIDBFactory::setOverrideBackingStoreType(WebIDBFactory::DefaultBackingStore);1143 else if (name == "leveldb") {1144 WebIDBFactory::setOverrideBackingStoreType(WebIDBFactory::LevelDBBackingStore);1145 1146 m_tempFolder = adoptPtr(webkit_support::CreateScopedTempDirectory());1147 if (m_tempFolder) {1148 if (m_tempFolder->CreateUniqueTempDir())1149 WebIDBFactory::setTemporaryDatabaseFolder(WebString::fromUTF8(m_tempFolder->path().c_str()));1150 }1151 }1152 #endif1153 1128 } 1154 1129 … … 1518 1493 result->setNull(); 1519 1494 webkit_support::ClearAllDatabases(); 1520 m_tempFolder.clear();1521 1495 } 1522 1496 -
trunk/Tools/DumpRenderTree/chromium/LayoutTestController.h
r87257 r87313 57 57 } 58 58 59 namespace webkit_support {60 class ScopedTempDirectory;61 }62 63 59 class TestShell; 64 60 … … 309 305 // Sets the default quota for all origins 310 306 void setDatabaseQuota(const CppArgumentList&, CppVariant*); 311 // Overrides the backend for IndexedDB312 void setOverrideIndexedDBBackingStore(const CppArgumentList&, CppVariant*);313 307 314 308 // Calls setlocale(LC_ALL, ...) for a specified locale. … … 594 588 CppVariant m_globalFlag; 595 589 596 // Used to create and destroy temporary folders.597 OwnPtr<webkit_support::ScopedTempDirectory> m_tempFolder;598 599 590 // Bound variable counting the number of top URLs visited. 600 591 CppVariant m_webHistoryItemCount;
Note: See TracChangeset
for help on using the changeset viewer.