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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 } | 334 } |
335 | 335 |
336 ExecutionContext* IDBTransaction::executionContext() const | 336 ExecutionContext* IDBTransaction::executionContext() const |
337 { | 337 { |
338 return ActiveDOMObject::executionContext(); | 338 return ActiveDOMObject::executionContext(); |
339 } | 339 } |
340 | 340 |
341 bool IDBTransaction::dispatchEvent(PassRefPtr<Event> event) | 341 bool IDBTransaction::dispatchEvent(PassRefPtr<Event> event) |
342 { | 342 { |
343 IDB_TRACE("IDBTransaction::dispatchEvent"); | 343 IDB_TRACE("IDBTransaction::dispatchEvent"); |
| 344 if (m_contextStopped || !executionContext()) { |
| 345 m_state = Finished; |
| 346 return false; |
| 347 } |
344 ASSERT(m_state != Finished); | 348 ASSERT(m_state != Finished); |
345 ASSERT(m_hasPendingActivity); | 349 ASSERT(m_hasPendingActivity); |
346 ASSERT(executionContext()); | 350 ASSERT(executionContext()); |
347 ASSERT(event->target() == this); | 351 ASSERT(event->target() == this); |
348 m_state = Finished; | 352 m_state = Finished; |
349 | 353 |
350 // Break reference cycles. | 354 // Break reference cycles. |
351 for (IDBObjectStoreMap::iterator it = m_objectStoreMap.begin(); it != m_obje
ctStoreMap.end(); ++it) | 355 for (IDBObjectStoreMap::iterator it = m_objectStoreMap.begin(); it != m_obje
ctStoreMap.end(); ++it) |
352 it->value->transactionFinished(); | 356 it->value->transactionFinished(); |
353 m_objectStoreMap.clear(); | 357 m_objectStoreMap.clear(); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 event->setTarget(this); | 396 event->setTarget(this); |
393 eventQueue->enqueueEvent(event); | 397 eventQueue->enqueueEvent(event); |
394 } | 398 } |
395 | 399 |
396 blink::WebIDBDatabase* IDBTransaction::backendDB() const | 400 blink::WebIDBDatabase* IDBTransaction::backendDB() const |
397 { | 401 { |
398 return m_database->backend(); | 402 return m_database->backend(); |
399 } | 403 } |
400 | 404 |
401 } // namespace WebCore | 405 } // namespace WebCore |
OLD | NEW |