Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: third_party/WebKit/Source/core/events/EventTarget.cpp

Issue 2270293002: Replace ASSERT*() with DCHECK*() in core/events/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: isUnreachableNode -> checkReachableNode Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 else 503 else
504 UseCounter::count(executingWindow->document(), prefixedFeature); 504 UseCounter::count(executingWindow->document(), prefixedFeature);
505 } else if (listenersVector) { 505 } else if (listenersVector) {
506 UseCounter::count(executingWindow->document(), unprefixedFeature); 506 UseCounter::count(executingWindow->document(), unprefixedFeature);
507 } 507 }
508 } 508 }
509 } 509 }
510 510
511 DispatchEventResult EventTarget::fireEventListeners(Event* event) 511 DispatchEventResult EventTarget::fireEventListeners(Event* event)
512 { 512 {
513 ASSERT(!EventDispatchForbiddenScope::isEventDispatchForbidden()); 513 #if DCHECK_IS_ON()
514 DCHECK(!EventDispatchForbiddenScope::isEventDispatchForbidden());
515 #endif
514 DCHECK(event); 516 DCHECK(event);
515 DCHECK(event->wasInitialized()); 517 DCHECK(event->wasInitialized());
516 518
517 EventTargetData* d = eventTargetData(); 519 EventTargetData* d = eventTargetData();
518 if (!d) 520 if (!d)
519 return DispatchEventResult::NotCanceled; 521 return DispatchEventResult::NotCanceled;
520 522
521 EventListenerVector* legacyListenersVector = nullptr; 523 EventListenerVector* legacyListenersVector = nullptr;
522 AtomicString legacyTypeName = legacyType(event); 524 AtomicString legacyTypeName = legacyType(event);
523 if (!legacyTypeName.isEmpty()) 525 if (!legacyTypeName.isEmpty())
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 DEFINE_STATIC_LOCAL(EnumerationHistogram, passiveForcedHistogram, (" Event.PassiveForcedEventDispatchCancelled", PassiveForcedListenerResultTypeMax)) ; 650 DEFINE_STATIC_LOCAL(EnumerationHistogram, passiveForcedHistogram, (" Event.PassiveForcedEventDispatchCancelled", PassiveForcedListenerResultTypeMax)) ;
649 PassiveForcedListenerResultType breakageType = PreventDefaultNotCall ed; 651 PassiveForcedListenerResultType breakageType = PreventDefaultNotCall ed;
650 if (event->preventDefaultCalledDuringPassive()) 652 if (event->preventDefaultCalledDuringPassive())
651 breakageType = DocumentLevelTouchPreventDefaultCalled; 653 breakageType = DocumentLevelTouchPreventDefaultCalled;
652 654
653 passiveForcedHistogram.count(breakageType); 655 passiveForcedHistogram.count(breakageType);
654 } 656 }
655 657
656 event->setHandlingPassive(false); 658 event->setHandlingPassive(false);
657 659
658 RELEASE_ASSERT(i <= size); 660 CHECK_LE(i, size);
659 } 661 }
660 d->firingEventIterators->removeLast(); 662 d->firingEventIterators->removeLast();
661 return firedListener; 663 return firedListener;
662 } 664 }
663 665
664 DispatchEventResult EventTarget::dispatchEventResult(const Event& event) 666 DispatchEventResult EventTarget::dispatchEventResult(const Event& event)
665 { 667 {
666 if (event.defaultPrevented()) 668 if (event.defaultPrevented())
667 return DispatchEventResult::CanceledByEventHandler; 669 return DispatchEventResult::CanceledByEventHandler;
668 if (event.defaultHandled()) 670 if (event.defaultHandled())
(...skipping 26 matching lines...) Expand all
695 // they have one less listener to invoke. 697 // they have one less listener to invoke.
696 if (d->firingEventIterators) { 698 if (d->firingEventIterators) {
697 for (size_t i = 0; i < d->firingEventIterators->size(); ++i) { 699 for (size_t i = 0; i < d->firingEventIterators->size(); ++i) {
698 d->firingEventIterators->at(i).iterator = 0; 700 d->firingEventIterators->at(i).iterator = 0;
699 d->firingEventIterators->at(i).end = 0; 701 d->firingEventIterators->at(i).end = 0;
700 } 702 }
701 } 703 }
702 } 704 }
703 705
704 } // namespace blink 706 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/events/EventTarget.h ('k') | third_party/WebKit/Source/core/events/GenericEventQueue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698