| 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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 // revert the metadata change if the transaction aborts, in order to return | 263 // revert the metadata change if the transaction aborts, in order to return |
| 264 // correct values from IDB{Database, Transaction}.objectStoreNames. | 264 // correct values from IDB{Database, Transaction}.objectStoreNames. |
| 265 DCHECK(m_database->metadata().objectStores.contains(objectStoreId)); | 265 DCHECK(m_database->metadata().objectStores.contains(objectStoreId)); |
| 266 RefPtr<IDBObjectStoreMetadata> metadata = | 266 RefPtr<IDBObjectStoreMetadata> metadata = |
| 267 m_database->metadata().objectStores.get(objectStoreId); | 267 m_database->metadata().objectStores.get(objectStoreId); |
| 268 DCHECK(metadata.get()); | 268 DCHECK(metadata.get()); |
| 269 DCHECK_EQ(metadata->name, name); | 269 DCHECK_EQ(metadata->name, name); |
| 270 m_deletedObjectStores.push_back(std::move(metadata)); | 270 m_deletedObjectStores.push_back(std::move(metadata)); |
| 271 } else { | 271 } else { |
| 272 IDBObjectStore* objectStore = it->value; | 272 IDBObjectStore* objectStore = it->value; |
| 273 m_objectStoreMap.remove(name); | 273 m_objectStoreMap.erase(name); |
| 274 objectStore->markDeleted(); | 274 objectStore->markDeleted(); |
| 275 if (objectStore->id() > m_oldDatabaseMetadata.maxObjectStoreId) { | 275 if (objectStore->id() > m_oldDatabaseMetadata.maxObjectStoreId) { |
| 276 // The store was created and deleted in this transaction, so it will | 276 // The store was created and deleted in this transaction, so it will |
| 277 // not be restored even if the transaction aborts. We have just | 277 // not be restored even if the transaction aborts. We have just |
| 278 // removed our last reference to it. | 278 // removed our last reference to it. |
| 279 DCHECK(!m_oldStoreMetadata.contains(objectStore)); | 279 DCHECK(!m_oldStoreMetadata.contains(objectStore)); |
| 280 objectStore->clearIndexCache(); | 280 objectStore->clearIndexCache(); |
| 281 } else { | 281 } else { |
| 282 // The store was created before this transaction, and we created an | 282 // The store was created before this transaction, and we created an |
| 283 // IDBObjectStore instance for it. When that happened, we must have | 283 // IDBObjectStore instance for it. When that happened, we must have |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 IDBObjectStore* objectStore = it.key; | 595 IDBObjectStore* objectStore = it.key; |
| 596 objectStore->clearIndexCache(); | 596 objectStore->clearIndexCache(); |
| 597 } | 597 } |
| 598 m_oldStoreMetadata.clear(); | 598 m_oldStoreMetadata.clear(); |
| 599 | 599 |
| 600 m_deletedIndexes.clear(); | 600 m_deletedIndexes.clear(); |
| 601 m_deletedObjectStores.clear(); | 601 m_deletedObjectStores.clear(); |
| 602 } | 602 } |
| 603 | 603 |
| 604 } // namespace blink | 604 } // namespace blink |
| OLD | NEW |