OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 | 175 |
176 // FIXME: Everything from now on should be done on another thread. | 176 // FIXME: Everything from now on should be done on another thread. |
177 RefPtr<IDBBackingStore> backingStore = openBackingStore(securityOrigin, data
Directory); | 177 RefPtr<IDBBackingStore> backingStore = openBackingStore(securityOrigin, data
Directory); |
178 if (!backingStore) { | 178 if (!backingStore) { |
179 callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOW
N_ERR, "Internal error.")); | 179 callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOW
N_ERR, "Internal error.")); |
180 return; | 180 return; |
181 } | 181 } |
182 | 182 |
183 RefPtr<IDBDatabaseBackendImpl> databaseBackend = IDBDatabaseBackendImpl::cre
ate(name, backingStore.get(), m_transactionCoordinator.get(), this, uniqueIdenti
fier); | 183 RefPtr<IDBDatabaseBackendImpl> databaseBackend = IDBDatabaseBackendImpl::cre
ate(name, backingStore.get(), m_transactionCoordinator.get(), this, uniqueIdenti
fier); |
184 if (databaseBackend) { | 184 if (databaseBackend) { |
185 callbacks->onSuccess(RefPtr<IDBDatabaseBackendInterface>(databaseBackend
.get()).release()); | |
186 m_databaseBackendMap.set(uniqueIdentifier, databaseBackend.get()); | 185 m_databaseBackendMap.set(uniqueIdentifier, databaseBackend.get()); |
| 186 databaseBackend->openConnection(callbacks); |
187 } else | 187 } else |
188 callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOW
N_ERR, "Internal error.")); | 188 callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOW
N_ERR, "Internal error.")); |
189 } | 189 } |
190 | 190 |
191 } // namespace WebCore | 191 } // namespace WebCore |
192 | 192 |
193 #endif // ENABLE(INDEXED_DATABASE) | 193 #endif // ENABLE(INDEXED_DATABASE) |
OLD | NEW |