| 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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 ASSERT(executionContext()); | 372 ASSERT(executionContext()); |
| 373 EventQueue* eventQueue = executionContext()->eventQueue(); | 373 EventQueue* eventQueue = executionContext()->eventQueue(); |
| 374 event->setTarget(this); | 374 event->setTarget(this); |
| 375 eventQueue->enqueueEvent(event.get()); | 375 eventQueue->enqueueEvent(event.get()); |
| 376 m_enqueuedEvents.append(event); | 376 m_enqueuedEvents.append(event); |
| 377 } | 377 } |
| 378 | 378 |
| 379 bool IDBDatabase::dispatchEvent(PassRefPtr<Event> event) | 379 bool IDBDatabase::dispatchEvent(PassRefPtr<Event> event) |
| 380 { | 380 { |
| 381 IDB_TRACE("IDBDatabase::dispatchEvent"); | 381 IDB_TRACE("IDBDatabase::dispatchEvent"); |
| 382 if (m_contextStopped || !executionContext()) |
| 383 return false; |
| 382 ASSERT(event->type() == EventTypeNames::versionchange || event->type() == Ev
entTypeNames::close); | 384 ASSERT(event->type() == EventTypeNames::versionchange || event->type() == Ev
entTypeNames::close); |
| 383 for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) { | 385 for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) { |
| 384 if (m_enqueuedEvents[i].get() == event.get()) | 386 if (m_enqueuedEvents[i].get() == event.get()) |
| 385 m_enqueuedEvents.remove(i); | 387 m_enqueuedEvents.remove(i); |
| 386 } | 388 } |
| 387 return EventTarget::dispatchEvent(event.get()); | 389 return EventTarget::dispatchEvent(event.get()); |
| 388 } | 390 } |
| 389 | 391 |
| 390 int64_t IDBDatabase::findObjectStoreId(const String& name) const | 392 int64_t IDBDatabase::findObjectStoreId(const String& name) const |
| 391 { | 393 { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 422 { | 424 { |
| 423 return EventTargetNames::IDBDatabase; | 425 return EventTargetNames::IDBDatabase; |
| 424 } | 426 } |
| 425 | 427 |
| 426 ExecutionContext* IDBDatabase::executionContext() const | 428 ExecutionContext* IDBDatabase::executionContext() const |
| 427 { | 429 { |
| 428 return ActiveDOMObject::executionContext(); | 430 return ActiveDOMObject::executionContext(); |
| 429 } | 431 } |
| 430 | 432 |
| 431 } // namespace WebCore | 433 } // namespace WebCore |
| OLD | NEW |