Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(268)

Unified Diff: Source/WebCore/Modules/indexeddb/IDBFactoryBackendImpl.cpp

Issue 10536007: Merge 117978 - IndexedDB: Fire error when there are problems opening a DB (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1132/
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/WebCore/Modules/indexeddb/IDBFactoryBackendImpl.cpp
===================================================================
--- Source/WebCore/Modules/indexeddb/IDBFactoryBackendImpl.cpp (revision 119484)
+++ Source/WebCore/Modules/indexeddb/IDBFactoryBackendImpl.cpp (working copy)
@@ -129,8 +129,11 @@
}
RefPtr<IDBDatabaseBackendImpl> databaseBackend = IDBDatabaseBackendImpl::create(name, backingStore.get(), m_transactionCoordinator.get(), this, uniqueIdentifier);
- m_databaseBackendMap.set(uniqueIdentifier, databaseBackend.get());
- databaseBackend->deleteDatabase(callbacks);
+ if (databaseBackend) {
+ m_databaseBackendMap.set(uniqueIdentifier, databaseBackend.get());
+ databaseBackend->deleteDatabase(callbacks);
+ } else
+ callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Internal error."));
}
PassRefPtr<IDBBackingStore> IDBFactoryBackendImpl::openBackingStore(PassRefPtr<SecurityOrigin> securityOrigin, const String& dataDirectory)
@@ -177,8 +180,11 @@
}
RefPtr<IDBDatabaseBackendImpl> databaseBackend = IDBDatabaseBackendImpl::create(name, backingStore.get(), m_transactionCoordinator.get(), this, uniqueIdentifier);
- callbacks->onSuccess(RefPtr<IDBDatabaseBackendInterface>(databaseBackend.get()).release());
- m_databaseBackendMap.set(uniqueIdentifier, databaseBackend.get());
+ if (databaseBackend) {
+ callbacks->onSuccess(RefPtr<IDBDatabaseBackendInterface>(databaseBackend.get()).release());
+ m_databaseBackendMap.set(uniqueIdentifier, databaseBackend.get());
+ } else
+ callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Internal error."));
}
} // namespace WebCore
« no previous file with comments | « Source/WebCore/Modules/indexeddb/IDBFactoryBackendImpl.h ('k') | Source/WebCore/Modules/indexeddb/IDBLevelDBBackingStore.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698