| 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 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 const AtomicString& IDBTransaction::interfaceName() const | 339 const AtomicString& IDBTransaction::interfaceName() const |
| 340 { | 340 { |
| 341 return EventTargetNames::IDBTransaction; | 341 return EventTargetNames::IDBTransaction; |
| 342 } | 342 } |
| 343 | 343 |
| 344 ExecutionContext* IDBTransaction::executionContext() const | 344 ExecutionContext* IDBTransaction::executionContext() const |
| 345 { | 345 { |
| 346 return ActiveDOMObject::executionContext(); | 346 return ActiveDOMObject::executionContext(); |
| 347 } | 347 } |
| 348 | 348 |
| 349 bool IDBTransaction::dispatchEventInternal(PassRefPtrWillBeRawPtr<Event> event) | 349 WebInputEventResult IDBTransaction::dispatchEventInternal(PassRefPtrWillBeRawPtr
<Event> event) |
| 350 { | 350 { |
| 351 IDB_TRACE("IDBTransaction::dispatchEvent"); | 351 IDB_TRACE("IDBTransaction::dispatchEvent"); |
| 352 if (m_contextStopped || !executionContext()) { | 352 if (m_contextStopped || !executionContext()) { |
| 353 m_state = Finished; | 353 m_state = Finished; |
| 354 return false; | 354 return WebInputEventResult::HandledSuppressed; |
| 355 } | 355 } |
| 356 ASSERT(m_state != Finished); | 356 ASSERT(m_state != Finished); |
| 357 ASSERT(m_hasPendingActivity); | 357 ASSERT(m_hasPendingActivity); |
| 358 ASSERT(executionContext()); | 358 ASSERT(executionContext()); |
| 359 ASSERT(event->target() == this); | 359 ASSERT(event->target() == this); |
| 360 m_state = Finished; | 360 m_state = Finished; |
| 361 | 361 |
| 362 // Break reference cycles. | 362 // Break reference cycles. |
| 363 for (auto& it : m_objectStoreMap) | 363 for (auto& it : m_objectStoreMap) |
| 364 it.value->transactionFinished(); | 364 it.value->transactionFinished(); |
| 365 m_objectStoreMap.clear(); | 365 m_objectStoreMap.clear(); |
| 366 for (auto& it : m_deletedObjectStores) | 366 for (auto& it : m_deletedObjectStores) |
| 367 it->transactionFinished(); | 367 it->transactionFinished(); |
| 368 m_deletedObjectStores.clear(); | 368 m_deletedObjectStores.clear(); |
| 369 | 369 |
| 370 WillBeHeapVector<RefPtrWillBeMember<EventTarget>> targets; | 370 WillBeHeapVector<RefPtrWillBeMember<EventTarget>> targets; |
| 371 targets.append(this); | 371 targets.append(this); |
| 372 targets.append(db()); | 372 targets.append(db()); |
| 373 | 373 |
| 374 // FIXME: When we allow custom event dispatching, this will probably need to
change. | 374 // FIXME: When we allow custom event dispatching, this will probably need to
change. |
| 375 ASSERT(event->type() == EventTypeNames::complete || event->type() == EventTy
peNames::abort); | 375 ASSERT(event->type() == EventTypeNames::complete || event->type() == EventTy
peNames::abort); |
| 376 bool returnValue = IDBEventDispatcher::dispatch(event.get(), targets); | 376 WebInputEventResult returnValue = IDBEventDispatcher::dispatch(event.get(),
targets); |
| 377 // FIXME: Try to construct a test where |this| outlives openDBRequest and we | 377 // FIXME: Try to construct a test where |this| outlives openDBRequest and we |
| 378 // get a crash. | 378 // get a crash. |
| 379 if (m_openDBRequest) { | 379 if (m_openDBRequest) { |
| 380 ASSERT(isVersionChange()); | 380 ASSERT(isVersionChange()); |
| 381 m_openDBRequest->transactionDidFinishAndDispatch(); | 381 m_openDBRequest->transactionDidFinishAndDispatch(); |
| 382 } | 382 } |
| 383 m_hasPendingActivity = false; | 383 m_hasPendingActivity = false; |
| 384 return returnValue; | 384 return returnValue; |
| 385 } | 385 } |
| 386 | 386 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 404 event->setTarget(this); | 404 event->setTarget(this); |
| 405 eventQueue->enqueueEvent(event); | 405 eventQueue->enqueueEvent(event); |
| 406 } | 406 } |
| 407 | 407 |
| 408 WebIDBDatabase* IDBTransaction::backendDB() const | 408 WebIDBDatabase* IDBTransaction::backendDB() const |
| 409 { | 409 { |
| 410 return m_database->backend(); | 410 return m_database->backend(); |
| 411 } | 411 } |
| 412 | 412 |
| 413 } // namespace blink | 413 } // namespace blink |
| OLD | NEW |