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 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 void IDBDatabase::enqueueEvent(PassRefPtrWillBeRawPtr<Event> event) | 390 void IDBDatabase::enqueueEvent(PassRefPtrWillBeRawPtr<Event> event) |
391 { | 391 { |
392 ASSERT(!m_contextStopped); | 392 ASSERT(!m_contextStopped); |
393 ASSERT(executionContext()); | 393 ASSERT(executionContext()); |
394 EventQueue* eventQueue = executionContext()->eventQueue(); | 394 EventQueue* eventQueue = executionContext()->eventQueue(); |
395 event->setTarget(this); | 395 event->setTarget(this); |
396 eventQueue->enqueueEvent(event.get()); | 396 eventQueue->enqueueEvent(event.get()); |
397 m_enqueuedEvents.append(event); | 397 m_enqueuedEvents.append(event); |
398 } | 398 } |
399 | 399 |
400 bool IDBDatabase::dispatchEventInternal(PassRefPtrWillBeRawPtr<Event> event) | 400 WebInputEventResult IDBDatabase::dispatchEventInternal(PassRefPtrWillBeRawPtr<Ev
ent> event) |
401 { | 401 { |
402 IDB_TRACE("IDBDatabase::dispatchEvent"); | 402 IDB_TRACE("IDBDatabase::dispatchEvent"); |
403 if (m_contextStopped || !executionContext()) | 403 if (m_contextStopped || !executionContext()) |
404 return false; | 404 return WebInputEventResult::HandledSuppressed; |
405 ASSERT(event->type() == EventTypeNames::versionchange || event->type() == Ev
entTypeNames::close); | 405 ASSERT(event->type() == EventTypeNames::versionchange || event->type() == Ev
entTypeNames::close); |
406 for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) { | 406 for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) { |
407 if (m_enqueuedEvents[i].get() == event.get()) | 407 if (m_enqueuedEvents[i].get() == event.get()) |
408 m_enqueuedEvents.remove(i); | 408 m_enqueuedEvents.remove(i); |
409 } | 409 } |
410 | 410 |
411 bool result = EventTarget::dispatchEventInternal(event.get()); | 411 WebInputEventResult result = EventTarget::dispatchEventInternal(event.get())
; |
412 if (event->type() == EventTypeNames::versionchange && !m_closePending && m_b
ackend) | 412 if (event->type() == EventTypeNames::versionchange && !m_closePending && m_b
ackend) |
413 m_backend->versionChangeIgnored(); | 413 m_backend->versionChangeIgnored(); |
414 return result; | 414 return result; |
415 } | 415 } |
416 | 416 |
417 int64_t IDBDatabase::findObjectStoreId(const String& name) const | 417 int64_t IDBDatabase::findObjectStoreId(const String& name) const |
418 { | 418 { |
419 for (const auto& it : m_metadata.objectStores) { | 419 for (const auto& it : m_metadata.objectStores) { |
420 if (it.value.name == name) { | 420 if (it.value.name == name) { |
421 ASSERT(it.key != IDBObjectStoreMetadata::InvalidId); | 421 ASSERT(it.key != IDBObjectStoreMetadata::InvalidId); |
(...skipping 27 matching lines...) Expand all Loading... |
449 { | 449 { |
450 return EventTargetNames::IDBDatabase; | 450 return EventTargetNames::IDBDatabase; |
451 } | 451 } |
452 | 452 |
453 ExecutionContext* IDBDatabase::executionContext() const | 453 ExecutionContext* IDBDatabase::executionContext() const |
454 { | 454 { |
455 return ActiveDOMObject::executionContext(); | 455 return ActiveDOMObject::executionContext(); |
456 } | 456 } |
457 | 457 |
458 } // namespace blink | 458 } // namespace blink |
OLD | NEW |