OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. |
6 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 6 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
7 * (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 7 * (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
8 * | 8 * |
9 * Redistribution and use in source and binary forms, with or without | 9 * Redistribution and use in source and binary forms, with or without |
10 * modification, are permitted provided that the following conditions | 10 * modification, are permitted provided that the following conditions |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 } | 268 } |
269 | 269 |
270 bool EventTarget::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event) | 270 bool EventTarget::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event) |
271 { | 271 { |
272 event->setTrusted(true); | 272 event->setTrusted(true); |
273 return dispatchEventInternal(event); | 273 return dispatchEventInternal(event); |
274 } | 274 } |
275 | 275 |
276 bool EventTarget::dispatchEventInternal(PassRefPtrWillBeRawPtr<Event> event) | 276 bool EventTarget::dispatchEventInternal(PassRefPtrWillBeRawPtr<Event> event) |
277 { | 277 { |
| 278 #if ENABLE(OILPAN) |
| 279 // Dispatching events for a target that is about to be swept, |
| 280 // is unsafe and not allowed. If this assert triggers, your |
| 281 // EventTarget needs to extend its lifetime accordingly. |
| 282 // Using mechanisms like e.g., ActiveDOMObject::hasPendingActivity(). |
| 283 ASSERT(!Heap::willObjectBeLazilySwept(this)); |
| 284 #endif |
278 event->setTarget(this); | 285 event->setTarget(this); |
279 event->setCurrentTarget(this); | 286 event->setCurrentTarget(this); |
280 event->setEventPhase(Event::AT_TARGET); | 287 event->setEventPhase(Event::AT_TARGET); |
281 bool defaultWasNotPrevented = fireEventListeners(event.get()); | 288 bool defaultWasNotPrevented = fireEventListeners(event.get()); |
282 event->setEventPhase(0); | 289 event->setEventPhase(0); |
283 return defaultWasNotPrevented; | 290 return defaultWasNotPrevented; |
284 } | 291 } |
285 | 292 |
286 void EventTarget::uncaughtExceptionInEventHandler() | 293 void EventTarget::uncaughtExceptionInEventHandler() |
287 { | 294 { |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 // they have one less listener to invoke. | 483 // they have one less listener to invoke. |
477 if (d->firingEventIterators) { | 484 if (d->firingEventIterators) { |
478 for (size_t i = 0; i < d->firingEventIterators->size(); ++i) { | 485 for (size_t i = 0; i < d->firingEventIterators->size(); ++i) { |
479 d->firingEventIterators->at(i).iterator = 0; | 486 d->firingEventIterators->at(i).iterator = 0; |
480 d->firingEventIterators->at(i).end = 0; | 487 d->firingEventIterators->at(i).end = 0; |
481 } | 488 } |
482 } | 489 } |
483 } | 490 } |
484 | 491 |
485 } // namespace blink | 492 } // namespace blink |
OLD | NEW |