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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
184 IDBObjectStoreMap::iterator it = m_objectStoreMap.find(name); | 184 IDBObjectStoreMap::iterator it = m_objectStoreMap.find(name); |
185 if (it != m_objectStoreMap.end()) { | 185 if (it != m_objectStoreMap.end()) { |
186 IDBObjectStore* objectStore = it->value; | 186 IDBObjectStore* objectStore = it->value; |
187 m_objectStoreMap.remove(name); | 187 m_objectStoreMap.remove(name); |
188 objectStore->markDeleted(); | 188 objectStore->markDeleted(); |
189 m_objectStoreCleanupMap.set(objectStore, objectStore->metadata()); | 189 m_objectStoreCleanupMap.set(objectStore, objectStore->metadata()); |
190 m_deletedObjectStores.add(objectStore); | 190 m_deletedObjectStores.add(objectStore); |
191 } | 191 } |
192 } | 192 } |
193 | 193 |
194 void IDBTransaction::objectStoreWillBeRenamed(const String& oldName, const Strin g& newName) | |
jsbell
2016/09/07 17:16:14
Here we don't need the id... but it still seems li
pwnall
2016/09/07 22:43:52
objectStoreDeleted() also takes in the store's nam
| |
195 { | |
196 DCHECK(m_state != Finished); | |
197 DCHECK(isVersionChange()); | |
198 | |
199 DCHECK(!m_objectStoreMap.contains(newName)); | |
200 DCHECK(m_objectStoreMap.contains(oldName)) << "The object store had to be ac cessed in order to be renamed."; | |
201 | |
202 IDBObjectStoreMap::iterator it = m_objectStoreMap.find(oldName); | |
203 m_objectStoreMap.set(newName, it->value); | |
204 m_objectStoreMap.remove(oldName); | |
205 } | |
206 | |
194 void IDBTransaction::setActive(bool active) | 207 void IDBTransaction::setActive(bool active) |
195 { | 208 { |
196 DCHECK_NE(m_state, Finished) << "A finished transaction tried to setActive(" << (active ? "true" : "false") << ")"; | 209 DCHECK_NE(m_state, Finished) << "A finished transaction tried to setActive(" << (active ? "true" : "false") << ")"; |
197 if (m_state == Finishing) | 210 if (m_state == Finishing) |
198 return; | 211 return; |
199 ASSERT(active != (m_state == Active)); | 212 ASSERT(active != (m_state == Active)); |
200 m_state = active ? Active : Inactive; | 213 m_state = active ? Active : Inactive; |
201 | 214 |
202 if (!active && m_requestList.isEmpty() && backendDB()) | 215 if (!active && m_requestList.isEmpty() && backendDB()) |
203 backendDB()->commit(m_id); | 216 backendDB()->commit(m_id); |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
423 event->setTarget(this); | 436 event->setTarget(this); |
424 eventQueue->enqueueEvent(event); | 437 eventQueue->enqueueEvent(event); |
425 } | 438 } |
426 | 439 |
427 WebIDBDatabase* IDBTransaction::backendDB() const | 440 WebIDBDatabase* IDBTransaction::backendDB() const |
428 { | 441 { |
429 return m_database->backend(); | 442 return m_database->backend(); |
430 } | 443 } |
431 | 444 |
432 } // namespace blink | 445 } // namespace blink |
OLD | NEW |