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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 const AtomicString& eventType, | 276 const AtomicString& eventType, |
277 EventListener* listener, | 277 EventListener* listener, |
278 const AddEventListenerOptionsResolved& options) { | 278 const AddEventListenerOptionsResolved& options) { |
279 if (!listener) | 279 if (!listener) |
280 return false; | 280 return false; |
281 | 281 |
282 V8DOMActivityLogger* activityLogger = | 282 V8DOMActivityLogger* activityLogger = |
283 V8DOMActivityLogger::currentActivityLoggerIfIsolatedWorld(); | 283 V8DOMActivityLogger::currentActivityLoggerIfIsolatedWorld(); |
284 if (activityLogger) { | 284 if (activityLogger) { |
285 Vector<String> argv; | 285 Vector<String> argv; |
286 argv.append(toNode() ? toNode()->nodeName() : interfaceName()); | 286 argv.push_back(toNode() ? toNode()->nodeName() : interfaceName()); |
287 argv.append(eventType); | 287 argv.push_back(eventType); |
288 activityLogger->logEvent("blinkAddEventListener", argv.size(), argv.data()); | 288 activityLogger->logEvent("blinkAddEventListener", argv.size(), argv.data()); |
289 } | 289 } |
290 | 290 |
291 RegisteredEventListener registeredListener; | 291 RegisteredEventListener registeredListener; |
292 bool added = ensureEventTargetData().eventListenerMap.add( | 292 bool added = ensureEventTargetData().eventListenerMap.add( |
293 eventType, listener, options, ®isteredListener); | 293 eventType, listener, options, ®isteredListener); |
294 if (added) { | 294 if (added) { |
295 if (listener->type() == EventListener::JSEventListenerType) { | 295 if (listener->type() == EventListener::JSEventListenerType) { |
296 ScriptWrappableVisitor::writeBarrier( | 296 ScriptWrappableVisitor::writeBarrier( |
297 this, static_cast<V8AbstractEventListener*>(listener)); | 297 this, static_cast<V8AbstractEventListener*>(listener)); |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 } | 640 } |
641 | 641 |
642 ExecutionContext* context = getExecutionContext(); | 642 ExecutionContext* context = getExecutionContext(); |
643 if (!context) | 643 if (!context) |
644 return false; | 644 return false; |
645 | 645 |
646 size_t i = 0; | 646 size_t i = 0; |
647 size_t size = entry.size(); | 647 size_t size = entry.size(); |
648 if (!d->firingEventIterators) | 648 if (!d->firingEventIterators) |
649 d->firingEventIterators = WTF::wrapUnique(new FiringEventIteratorVector); | 649 d->firingEventIterators = WTF::wrapUnique(new FiringEventIteratorVector); |
650 d->firingEventIterators->append(FiringEventIterator(event->type(), i, size)); | 650 d->firingEventIterators->push_back( |
| 651 FiringEventIterator(event->type(), i, size)); |
651 | 652 |
652 double blockedEventThreshold = blockedEventsWarningThreshold(context, event); | 653 double blockedEventThreshold = blockedEventsWarningThreshold(context, event); |
653 TimeTicks now; | 654 TimeTicks now; |
654 bool shouldReportBlockedEvent = false; | 655 bool shouldReportBlockedEvent = false; |
655 if (blockedEventThreshold) { | 656 if (blockedEventThreshold) { |
656 now = TimeTicks::Now(); | 657 now = TimeTicks::Now(); |
657 shouldReportBlockedEvent = | 658 shouldReportBlockedEvent = |
658 (now - event->platformTimeStamp()).InSecondsF() > blockedEventThreshold; | 659 (now - event->platformTimeStamp()).InSecondsF() > blockedEventThreshold; |
659 } | 660 } |
660 bool firedListener = false; | 661 bool firedListener = false; |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
759 // they have one less listener to invoke. | 760 // they have one less listener to invoke. |
760 if (d->firingEventIterators) { | 761 if (d->firingEventIterators) { |
761 for (const auto& iterator : *d->firingEventIterators) { | 762 for (const auto& iterator : *d->firingEventIterators) { |
762 iterator.iterator = 0; | 763 iterator.iterator = 0; |
763 iterator.end = 0; | 764 iterator.end = 0; |
764 } | 765 } |
765 } | 766 } |
766 } | 767 } |
767 | 768 |
768 } // namespace blink | 769 } // namespace blink |
OLD | NEW |