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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 { | 213 { |
214 if (m_state == Finishing || m_state == Finished) { | 214 if (m_state == Finishing || m_state == Finished) { |
215 ec = IDBDatabaseException::InvalidStateError; | 215 ec = IDBDatabaseException::InvalidStateError; |
216 return; | 216 return; |
217 } | 217 } |
218 | 218 |
219 m_state = Finishing; | 219 m_state = Finishing; |
220 | 220 |
221 if (!m_contextStopped) { | 221 if (!m_contextStopped) { |
222 while (!m_requestList.isEmpty()) { | 222 while (!m_requestList.isEmpty()) { |
223 RefPtr<IDBRequest> request = *m_requestList.begin(); | 223 IDBRequest* request = *m_requestList.begin(); |
224 m_requestList.remove(request); | 224 m_requestList.remove(request); |
225 request->abort(); | 225 request->abort(); |
226 } | 226 } |
227 } | 227 } |
228 | 228 |
229 RefPtr<IDBTransaction> selfRef = this; | 229 RefPtr<IDBTransaction> selfRef = this; |
230 backendDB()->abort(m_id); | 230 backendDB()->abort(m_id); |
231 } | 231 } |
232 | 232 |
233 IDBTransaction::OpenCursorNotifier::OpenCursorNotifier(PassRefPtr<IDBTransaction
> transaction, IDBCursor* cursor) | 233 IDBTransaction::OpenCursorNotifier::OpenCursorNotifier(PassRefPtr<IDBTransaction
> transaction, IDBCursor* cursor) |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 RefPtr<IDBDatabaseError> error = prpError; | 290 RefPtr<IDBDatabaseError> error = prpError; |
291 ASSERT(m_state != Finished); | 291 ASSERT(m_state != Finished); |
292 | 292 |
293 if (m_state != Finishing) { | 293 if (m_state != Finishing) { |
294 ASSERT(error.get()); | 294 ASSERT(error.get()); |
295 setError(DOMError::create(error->name()), error->message()); | 295 setError(DOMError::create(error->name()), error->message()); |
296 | 296 |
297 // Abort was not triggered by front-end, so outstanding requests must | 297 // Abort was not triggered by front-end, so outstanding requests must |
298 // be aborted now. | 298 // be aborted now. |
299 while (!m_requestList.isEmpty()) { | 299 while (!m_requestList.isEmpty()) { |
300 RefPtr<IDBRequest> request = *m_requestList.begin(); | 300 IDBRequest* request = *m_requestList.begin(); |
301 m_requestList.remove(request); | 301 m_requestList.remove(request); |
302 request->abort(); | 302 request->abort(); |
303 } | 303 } |
304 m_state = Finishing; | 304 m_state = Finishing; |
305 } | 305 } |
306 | 306 |
307 if (isVersionChange()) { | 307 if (isVersionChange()) { |
308 for (IDBObjectStoreMetadataMap::iterator it = m_objectStoreCleanupMap.be
gin(); it != m_objectStoreCleanupMap.end(); ++it) | 308 for (IDBObjectStoreMetadataMap::iterator it = m_objectStoreCleanupMap.be
gin(); it != m_objectStoreCleanupMap.end(); ++it) |
309 it->key->setMetadata(it->value); | 309 it->key->setMetadata(it->value); |
310 m_database->setMetadata(m_previousMetadata); | 310 m_database->setMetadata(m_previousMetadata); |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 EventTargetData* IDBTransaction::ensureEventTargetData() | 451 EventTargetData* IDBTransaction::ensureEventTargetData() |
452 { | 452 { |
453 return &m_eventTargetData; | 453 return &m_eventTargetData; |
454 } | 454 } |
455 | 455 |
456 IDBDatabaseBackendInterface* IDBTransaction::backendDB() const | 456 IDBDatabaseBackendInterface* IDBTransaction::backendDB() const |
457 { | 457 { |
458 return db()->backend(); | 458 return db()->backend(); |
459 } | 459 } |
460 | 460 |
| 461 void IDBTransaction::trace(Visitor* visitor) |
| 462 { |
| 463 visitor->trace(m_database); |
| 464 visitor->trace(m_requestList); |
| 465 } |
| 466 |
461 } // namespace WebCore | 467 } // namespace WebCore |
OLD | NEW |