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

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: dtapuska's comments. 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 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 } else if (checkTypeThenUseCount(event, EventTypeNames::focusin, UseCounter: :FocusInOutEvent)) { 581 } else if (checkTypeThenUseCount(event, EventTypeNames::focusin, UseCounter: :FocusInOutEvent)) {
582 } else if (checkTypeThenUseCount(event, EventTypeNames::focusout, UseCounter ::FocusInOutEvent)) { 582 } else if (checkTypeThenUseCount(event, EventTypeNames::focusout, UseCounter ::FocusInOutEvent)) {
583 } else if (checkTypeThenUseCount(event, EventTypeNames::textInput, UseCounte r::TextInputFired)) { 583 } else if (checkTypeThenUseCount(event, EventTypeNames::textInput, UseCounte r::TextInputFired)) {
584 } else if (checkTypeThenUseCount(event, EventTypeNames::touchstart, UseCount er::TouchStartFired)) { 584 } else if (checkTypeThenUseCount(event, EventTypeNames::touchstart, UseCount er::TouchStartFired)) {
585 } else if (checkTypeThenUseCount(event, EventTypeNames::mousedown, UseCounte r::MouseDownFired)) { 585 } else if (checkTypeThenUseCount(event, EventTypeNames::mousedown, UseCounte r::MouseDownFired)) {
586 } else if (checkTypeThenUseCount(event, EventTypeNames::pointerdown, UseCoun ter::PointerDownFired)) { 586 } else if (checkTypeThenUseCount(event, EventTypeNames::pointerdown, UseCoun ter::PointerDownFired)) {
587 if (LocalDOMWindow* executingWindow = this->executingWindow()) { 587 if (LocalDOMWindow* executingWindow = this->executingWindow()) {
588 if (event->isPointerEvent() && static_cast<PointerEvent*>(event)->po interType() == "touch") 588 if (event->isPointerEvent() && static_cast<PointerEvent*>(event)->po interType() == "touch")
589 UseCounter::count(executingWindow->document(), UseCounter::Point erDownFiredForTouch); 589 UseCounter::count(executingWindow->document(), UseCounter::Point erDownFiredForTouch);
590 } 590 }
591 } else if (checkTypeThenUseCount(event, EventTypeNames::pointerenter, UseCou nter::PointerEnterLeaveFired)
592 || checkTypeThenUseCount(event, EventTypeNames::pointerleave, UseCounter ::PointerEnterLeaveFired)
593 || checkTypeThenUseCount(event, EventTypeNames::pointerover, UseCounter: :PointerOverOutFired)
594 || checkTypeThenUseCount(event, EventTypeNames::pointerout, UseCounter:: PointerOverOutFired)) {
595 LocalDOMWindow* executingWindow = this->executingWindow();
596 Node* node = toNode();
597 if (executingWindow && node && node->getNodeType() == Node::kElementNode && event->isPointerEvent()) {
598 const Element* element = static_cast<Element*>(node);
599 const PointerEvent* pointerEvent = static_cast<PointerEvent*>(event) ;
600 const UseCounter::Feature feature = (event->type() == EventTypeNames ::pointerenter || event->type() == EventTypeNames::pointerleave)
601 ? UseCounter::PointerEnterLeaveFiredWhileCaptured
602 : UseCounter::PointerOverOutFiredWhileCaptured;
603 if (element->hasPointerCapture(pointerEvent->pointerId()))
604 UseCounter::count(executingWindow->document(), feature);
Navid Zolghadr 2016/08/24 21:18:01 This probably won't work as you expect. In the nor
mustaq 2016/08/25 15:00:32 Yes, good catch: this will trigger when set/releas
mustaq 2016/08/25 15:45:54 Done, ptal. I didn't mark the new API as temporary
605 }
591 } 606 }
592 607
593 ExecutionContext* context = getExecutionContext(); 608 ExecutionContext* context = getExecutionContext();
594 if (!context) 609 if (!context)
595 return false; 610 return false;
596 611
597 size_t i = 0; 612 size_t i = 0;
598 size_t size = entry.size(); 613 size_t size = entry.size();
599 if (!d->firingEventIterators) 614 if (!d->firingEventIterators)
600 d->firingEventIterators = wrapUnique(new FiringEventIteratorVector); 615 d->firingEventIterators = wrapUnique(new FiringEventIteratorVector);
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
697 // they have one less listener to invoke. 712 // they have one less listener to invoke.
698 if (d->firingEventIterators) { 713 if (d->firingEventIterators) {
699 for (size_t i = 0; i < d->firingEventIterators->size(); ++i) { 714 for (size_t i = 0; i < d->firingEventIterators->size(); ++i) {
700 d->firingEventIterators->at(i).iterator = 0; 715 d->firingEventIterators->at(i).iterator = 0;
701 d->firingEventIterators->at(i).end = 0; 716 d->firingEventIterators->at(i).end = 0;
702 } 717 }
703 } 718 }
704 } 719 }
705 720
706 } // namespace blink 721 } // 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