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

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

Issue 10534013: Revert 119486 - 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/IDBDatabaseBackendImpl.cpp
===================================================================
--- Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp (revision 119524)
+++ Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.cpp (working copy)
@@ -93,14 +93,6 @@
RefPtr<IDBDatabaseCallbacks> m_databaseCallbacks;
};
-PassRefPtr<IDBDatabaseBackendImpl> IDBDatabaseBackendImpl::create(const String& name, IDBBackingStore* database, IDBTransactionCoordinator* coordinator, IDBFactoryBackendImpl* factory, const String& uniqueIdentifier)
-{
- RefPtr<IDBDatabaseBackendImpl> backend = adoptRef(new IDBDatabaseBackendImpl(name, database, coordinator, factory, uniqueIdentifier));
- if (!backend->openInternal())
- return 0;
- return backend.release();
-}
-
IDBDatabaseBackendImpl::IDBDatabaseBackendImpl(const String& name, IDBBackingStore* backingStore, IDBTransactionCoordinator* coordinator, IDBFactoryBackendImpl* factory, const String& uniqueIdentifier)
: m_backingStore(backingStore)
, m_id(InvalidId)
@@ -111,17 +103,19 @@
, m_transactionCoordinator(coordinator)
{
ASSERT(!m_name.isNull());
+ openInternal();
}
-bool IDBDatabaseBackendImpl::openInternal()
+void IDBDatabaseBackendImpl::openInternal()
{
bool success = m_backingStore->getIDBDatabaseMetaData(m_name, m_version, m_id);
ASSERT(success == (m_id != InvalidId));
if (success) {
loadObjectStores();
- return true;
+ return;
}
- return m_backingStore->createIDBDatabaseMetaData(m_name, m_version, m_id);
+ if (!m_backingStore->createIDBDatabaseMetaData(m_name, m_version, m_id))
+ ASSERT_NOT_REACHED(); // FIXME: Need better error handling.
}
IDBDatabaseBackendImpl::~IDBDatabaseBackendImpl()
@@ -331,10 +325,9 @@
if (!m_pendingDeleteCalls.isEmpty() || m_runningVersionChangeTransaction || !m_pendingSetVersionCalls.isEmpty())
m_pendingOpenCalls.append(PendingOpenCall::create(callbacks));
else {
- if (m_id == InvalidId && !openInternal())
- callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Internal error."));
- else
- callbacks->onSuccess(this);
+ if (m_id == InvalidId)
+ openInternal();
+ callbacks->onSuccess(this);
}
}
« no previous file with comments | « Source/WebCore/Modules/indexeddb/IDBDatabaseBackendImpl.h ('k') | Source/WebCore/Modules/indexeddb/IDBFactoryBackendImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698