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

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

Issue 2229543002: Fix UseCounter for SubframeBeforeUnloadFired. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Now with test 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 bool EventTarget::fireEventListeners(Event* event, EventTargetData* d, EventList enerVector& entry) 559 bool EventTarget::fireEventListeners(Event* event, EventTargetData* d, EventList enerVector& entry)
560 { 560 {
561 // Fire all listeners registered for this event. Don't fire listeners remove d 561 // Fire all listeners registered for this event. Don't fire listeners remove d
562 // during event dispatch. Also, don't fire event listeners added during even t 562 // during event dispatch. Also, don't fire event listeners added during even t
563 // dispatch. Conveniently, all new event listeners will be added after or at 563 // dispatch. Conveniently, all new event listeners will be added after or at
564 // index |size|, so iterating up to (but not including) |size| naturally exc ludes 564 // index |size|, so iterating up to (but not including) |size| naturally exc ludes
565 // new event listeners. 565 // new event listeners.
566 566
567 if (checkTypeThenUseCount(event, EventTypeNames::beforeunload, UseCounter::D ocumentBeforeUnloadFired)) { 567 if (checkTypeThenUseCount(event, EventTypeNames::beforeunload, UseCounter::D ocumentBeforeUnloadFired)) {
568 if (LocalDOMWindow* executingWindow = this->executingWindow()) { 568 if (LocalDOMWindow* executingWindow = this->executingWindow()) {
569 // TODO(mustaq): Is the |if| condition correct? crbug.com/635029 569 if (executingWindow != executingWindow->top())
570 if (executingWindow->top())
571 UseCounter::count(executingWindow->document(), UseCounter::SubFr ameBeforeUnloadFired); 570 UseCounter::count(executingWindow->document(), UseCounter::SubFr ameBeforeUnloadFired);
572 } 571 }
573 } else if (checkTypeThenUseCount(event, EventTypeNames::unload, UseCounter:: DocumentUnloadFired)) { 572 } else if (checkTypeThenUseCount(event, EventTypeNames::unload, UseCounter:: DocumentUnloadFired)) {
574 } else if (checkTypeThenUseCount(event, EventTypeNames::DOMFocusIn, UseCount er::DOMFocusInOutEvent)) { 573 } else if (checkTypeThenUseCount(event, EventTypeNames::DOMFocusIn, UseCount er::DOMFocusInOutEvent)) {
575 } else if (checkTypeThenUseCount(event, EventTypeNames::DOMFocusOut, UseCoun ter::DOMFocusInOutEvent)) { 574 } else if (checkTypeThenUseCount(event, EventTypeNames::DOMFocusOut, UseCoun ter::DOMFocusInOutEvent)) {
576 } else if (checkTypeThenUseCount(event, EventTypeNames::focusin, UseCounter: :FocusInOutEvent)) { 575 } else if (checkTypeThenUseCount(event, EventTypeNames::focusin, UseCounter: :FocusInOutEvent)) {
577 } else if (checkTypeThenUseCount(event, EventTypeNames::focusout, UseCounter ::FocusInOutEvent)) { 576 } else if (checkTypeThenUseCount(event, EventTypeNames::focusout, UseCounter ::FocusInOutEvent)) {
578 } else if (checkTypeThenUseCount(event, EventTypeNames::textInput, UseCounte r::TextInputFired)) { 577 } else if (checkTypeThenUseCount(event, EventTypeNames::textInput, UseCounte r::TextInputFired)) {
579 } else if (checkTypeThenUseCount(event, EventTypeNames::touchstart, UseCount er::TouchStartFired)) { 578 } else if (checkTypeThenUseCount(event, EventTypeNames::touchstart, UseCount er::TouchStartFired)) {
580 } else if (checkTypeThenUseCount(event, EventTypeNames::mousedown, UseCounte r::MouseDownFired)) { 579 } else if (checkTypeThenUseCount(event, EventTypeNames::mousedown, UseCounte r::MouseDownFired)) {
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 // they have one less listener to invoke. 691 // they have one less listener to invoke.
693 if (d->firingEventIterators) { 692 if (d->firingEventIterators) {
694 for (size_t i = 0; i < d->firingEventIterators->size(); ++i) { 693 for (size_t i = 0; i < d->firingEventIterators->size(); ++i) {
695 d->firingEventIterators->at(i).iterator = 0; 694 d->firingEventIterators->at(i).iterator = 0;
696 d->firingEventIterators->at(i).end = 0; 695 d->firingEventIterators->at(i).end = 0;
697 } 696 }
698 } 697 }
699 } 698 }
700 699
701 } // namespace blink 700 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698