| 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 // transaction abort. | 133 // transaction abort. |
| 134 if (!m_error) { | 134 if (!m_error) { |
| 135 m_error = error; | 135 m_error = error; |
| 136 } | 136 } |
| 137 } | 137 } |
| 138 | 138 |
| 139 IDBObjectStore* IDBTransaction::objectStore(const String& name, ExceptionState&
exceptionState) | 139 IDBObjectStore* IDBTransaction::objectStore(const String& name, ExceptionState&
exceptionState) |
| 140 { | 140 { |
| 141 if (m_state == Finished) { | 141 if (m_state == Finished) { |
| 142 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::transac
tionFinishedErrorMessage); | 142 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::transac
tionFinishedErrorMessage); |
| 143 return 0; | 143 return nullptr; |
| 144 } | 144 } |
| 145 | 145 |
| 146 IDBObjectStoreMap::iterator it = m_objectStoreMap.find(name); | 146 IDBObjectStoreMap::iterator it = m_objectStoreMap.find(name); |
| 147 if (it != m_objectStoreMap.end()) | 147 if (it != m_objectStoreMap.end()) |
| 148 return it->value; | 148 return it->value; |
| 149 | 149 |
| 150 if (!isVersionChange() && !m_objectStoreNames.contains(name)) { | 150 if (!isVersionChange() && !m_objectStoreNames.contains(name)) { |
| 151 exceptionState.throwDOMException(NotFoundError, IDBDatabase::noSuchObjec
tStoreErrorMessage); | 151 exceptionState.throwDOMException(NotFoundError, IDBDatabase::noSuchObjec
tStoreErrorMessage); |
| 152 return 0; | 152 return nullptr; |
| 153 } | 153 } |
| 154 | 154 |
| 155 int64_t objectStoreId = m_database->findObjectStoreId(name); | 155 int64_t objectStoreId = m_database->findObjectStoreId(name); |
| 156 if (objectStoreId == IDBObjectStoreMetadata::InvalidId) { | 156 if (objectStoreId == IDBObjectStoreMetadata::InvalidId) { |
| 157 ASSERT(isVersionChange()); | 157 ASSERT(isVersionChange()); |
| 158 exceptionState.throwDOMException(NotFoundError, IDBDatabase::noSuchObjec
tStoreErrorMessage); | 158 exceptionState.throwDOMException(NotFoundError, IDBDatabase::noSuchObjec
tStoreErrorMessage); |
| 159 return 0; | 159 return nullptr; |
| 160 } | 160 } |
| 161 | 161 |
| 162 const IDBDatabaseMetadata& metadata = m_database->metadata(); | 162 const IDBDatabaseMetadata& metadata = m_database->metadata(); |
| 163 | 163 |
| 164 IDBObjectStore* objectStore = IDBObjectStore::create(metadata.objectStores.g
et(objectStoreId), this); | 164 IDBObjectStore* objectStore = IDBObjectStore::create(metadata.objectStores.g
et(objectStoreId), this); |
| 165 objectStoreCreated(name, objectStore); | 165 objectStoreCreated(name, objectStore); |
| 166 return objectStore; | 166 return objectStore; |
| 167 } | 167 } |
| 168 | 168 |
| 169 void IDBTransaction::objectStoreCreated(const String& name, IDBObjectStore* obje
ctStore) | 169 void IDBTransaction::objectStoreCreated(const String& name, IDBObjectStore* obje
ctStore) |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 event->setTarget(this); | 407 event->setTarget(this); |
| 408 eventQueue->enqueueEvent(event); | 408 eventQueue->enqueueEvent(event); |
| 409 } | 409 } |
| 410 | 410 |
| 411 WebIDBDatabase* IDBTransaction::backendDB() const | 411 WebIDBDatabase* IDBTransaction::backendDB() const |
| 412 { | 412 { |
| 413 return m_database->backend(); | 413 return m_database->backend(); |
| 414 } | 414 } |
| 415 | 415 |
| 416 } // namespace blink | 416 } // namespace blink |
| OLD | NEW |