| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 // transaction abort. | 121 // transaction abort. |
| 122 if (!m_error) { | 122 if (!m_error) { |
| 123 m_error = error; | 123 m_error = error; |
| 124 } | 124 } |
| 125 } | 125 } |
| 126 | 126 |
| 127 PassRefPtr<IDBObjectStore> IDBTransaction::objectStore(const String& name, Excep
tionState& exceptionState) | 127 PassRefPtr<IDBObjectStore> IDBTransaction::objectStore(const String& name, Excep
tionState& exceptionState) |
| 128 { | 128 { |
| 129 if (m_state == Finished) { | 129 if (m_state == Finished) { |
| 130 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::transac
tionFinishedErrorMessage); | 130 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::transac
tionFinishedErrorMessage); |
| 131 return 0; | 131 return nullptr; |
| 132 } | 132 } |
| 133 | 133 |
| 134 IDBObjectStoreMap::iterator it = m_objectStoreMap.find(name); | 134 IDBObjectStoreMap::iterator it = m_objectStoreMap.find(name); |
| 135 if (it != m_objectStoreMap.end()) | 135 if (it != m_objectStoreMap.end()) |
| 136 return it->value; | 136 return it->value; |
| 137 | 137 |
| 138 if (!isVersionChange() && !m_objectStoreNames.contains(name)) { | 138 if (!isVersionChange() && !m_objectStoreNames.contains(name)) { |
| 139 exceptionState.throwDOMException(NotFoundError, IDBDatabase::noSuchObjec
tStoreErrorMessage); | 139 exceptionState.throwDOMException(NotFoundError, IDBDatabase::noSuchObjec
tStoreErrorMessage); |
| 140 return 0; | 140 return nullptr; |
| 141 } | 141 } |
| 142 | 142 |
| 143 int64_t objectStoreId = m_database->findObjectStoreId(name); | 143 int64_t objectStoreId = m_database->findObjectStoreId(name); |
| 144 if (objectStoreId == IDBObjectStoreMetadata::InvalidId) { | 144 if (objectStoreId == IDBObjectStoreMetadata::InvalidId) { |
| 145 ASSERT(isVersionChange()); | 145 ASSERT(isVersionChange()); |
| 146 exceptionState.throwDOMException(NotFoundError, IDBDatabase::noSuchObjec
tStoreErrorMessage); | 146 exceptionState.throwDOMException(NotFoundError, IDBDatabase::noSuchObjec
tStoreErrorMessage); |
| 147 return 0; | 147 return nullptr; |
| 148 } | 148 } |
| 149 | 149 |
| 150 const IDBDatabaseMetadata& metadata = m_database->metadata(); | 150 const IDBDatabaseMetadata& metadata = m_database->metadata(); |
| 151 | 151 |
| 152 RefPtr<IDBObjectStore> objectStore = IDBObjectStore::create(metadata.objectS
tores.get(objectStoreId), this); | 152 RefPtr<IDBObjectStore> objectStore = IDBObjectStore::create(metadata.objectS
tores.get(objectStoreId), this); |
| 153 objectStoreCreated(name, objectStore); | 153 objectStoreCreated(name, objectStore); |
| 154 return objectStore.release(); | 154 return objectStore.release(); |
| 155 } | 155 } |
| 156 | 156 |
| 157 void IDBTransaction::objectStoreCreated(const String& name, PassRefPtr<IDBObject
Store> prpObjectStore) | 157 void IDBTransaction::objectStoreCreated(const String& name, PassRefPtr<IDBObject
Store> prpObjectStore) |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 event->setTarget(this); | 392 event->setTarget(this); |
| 393 eventQueue->enqueueEvent(event); | 393 eventQueue->enqueueEvent(event); |
| 394 } | 394 } |
| 395 | 395 |
| 396 blink::WebIDBDatabase* IDBTransaction::backendDB() const | 396 blink::WebIDBDatabase* IDBTransaction::backendDB() const |
| 397 { | 397 { |
| 398 return m_database->backend(); | 398 return m_database->backend(); |
| 399 } | 399 } |
| 400 | 400 |
| 401 } // namespace WebCore | 401 } // namespace WebCore |
| OLD | NEW |