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

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

Issue 2274253002: Added counters for pointer boundary events fired. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 4 years, 3 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 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 } else if (checkTypeThenUseCount(event, EventTypeNames::focusin, UseCounter: :FocusInOutEvent)) { 590 } else if (checkTypeThenUseCount(event, EventTypeNames::focusin, UseCounter: :FocusInOutEvent)) {
591 } else if (checkTypeThenUseCount(event, EventTypeNames::focusout, UseCounter ::FocusInOutEvent)) { 591 } else if (checkTypeThenUseCount(event, EventTypeNames::focusout, UseCounter ::FocusInOutEvent)) {
592 } else if (checkTypeThenUseCount(event, EventTypeNames::textInput, UseCounte r::TextInputFired)) { 592 } else if (checkTypeThenUseCount(event, EventTypeNames::textInput, UseCounte r::TextInputFired)) {
593 } else if (checkTypeThenUseCount(event, EventTypeNames::touchstart, UseCount er::TouchStartFired)) { 593 } else if (checkTypeThenUseCount(event, EventTypeNames::touchstart, UseCount er::TouchStartFired)) {
594 } else if (checkTypeThenUseCount(event, EventTypeNames::mousedown, UseCounte r::MouseDownFired)) { 594 } else if (checkTypeThenUseCount(event, EventTypeNames::mousedown, UseCounte r::MouseDownFired)) {
595 } else if (checkTypeThenUseCount(event, EventTypeNames::pointerdown, UseCoun ter::PointerDownFired)) { 595 } else if (checkTypeThenUseCount(event, EventTypeNames::pointerdown, UseCoun ter::PointerDownFired)) {
596 if (LocalDOMWindow* executingWindow = this->executingWindow()) { 596 if (LocalDOMWindow* executingWindow = this->executingWindow()) {
597 if (event->isPointerEvent() && static_cast<PointerEvent*>(event)->po interType() == "touch") 597 if (event->isPointerEvent() && static_cast<PointerEvent*>(event)->po interType() == "touch")
598 UseCounter::count(executingWindow->document(), UseCounter::Point erDownFiredForTouch); 598 UseCounter::count(executingWindow->document(), UseCounter::Point erDownFiredForTouch);
599 } 599 }
600 } else if (checkTypeThenUseCount(event, EventTypeNames::pointerenter, UseCou nter::PointerEnterLeaveFired)
601 || checkTypeThenUseCount(event, EventTypeNames::pointerleave, UseCounter ::PointerEnterLeaveFired)
602 || checkTypeThenUseCount(event, EventTypeNames::pointerover, UseCounter: :PointerOverOutFired)
603 || checkTypeThenUseCount(event, EventTypeNames::pointerout, UseCounter:: PointerOverOutFired)) {
604 LocalDOMWindow* executingWindow = this->executingWindow();
605 Node* node = toNode();
606 if (executingWindow && node && node->getNodeType() == Node::kElementNode && event->isPointerEvent()) {
607 const Element* element = static_cast<Element*>(node);
608 const PointerEvent* pointerEvent = static_cast<PointerEvent*>(event) ;
609 const UseCounter::Feature feature = (event->type() == EventTypeNames ::pointerenter || event->type() == EventTypeNames::pointerleave)
610 ? UseCounter::PointerEnterLeaveFiredWhileCaptured
611 : UseCounter::PointerOverOutFiredWhileCaptured;
612 if (element->hasPointerCapture(pointerEvent->pointerId()) && element ->hasProcessedPointerCapture(pointerEvent->pointerId()))
613 UseCounter::count(executingWindow->document(), feature);
614 }
600 } 615 }
601 616
602 ExecutionContext* context = getExecutionContext(); 617 ExecutionContext* context = getExecutionContext();
603 if (!context) 618 if (!context)
604 return false; 619 return false;
605 620
606 size_t i = 0; 621 size_t i = 0;
607 size_t size = entry.size(); 622 size_t size = entry.size();
608 if (!d->firingEventIterators) 623 if (!d->firingEventIterators)
609 d->firingEventIterators = wrapUnique(new FiringEventIteratorVector); 624 d->firingEventIterators = wrapUnique(new FiringEventIteratorVector);
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 // they have one less listener to invoke. 721 // they have one less listener to invoke.
707 if (d->firingEventIterators) { 722 if (d->firingEventIterators) {
708 for (size_t i = 0; i < d->firingEventIterators->size(); ++i) { 723 for (size_t i = 0; i < d->firingEventIterators->size(); ++i) {
709 d->firingEventIterators->at(i).iterator = 0; 724 d->firingEventIterators->at(i).iterator = 0;
710 d->firingEventIterators->at(i).end = 0; 725 d->firingEventIterators->at(i).end = 0;
711 } 726 }
712 } 727 }
713 } 728 }
714 729
715 } // namespace blink 730 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Element.cpp ('k') | third_party/WebKit/Source/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698