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

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

Issue 307613002: Refine the UseCounters for DOMFocusIn/Out and focusin/out events (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: less wrong Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/frame/UseCounter.h » ('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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 292
293 if (event->type() == EventTypeNames::beforeunload) { 293 if (event->type() == EventTypeNames::beforeunload) {
294 if (DOMWindow* executingWindow = this->executingWindow()) { 294 if (DOMWindow* executingWindow = this->executingWindow()) {
295 if (executingWindow->top()) 295 if (executingWindow->top())
296 UseCounter::count(executingWindow->document(), UseCounter::SubFr ameBeforeUnloadFired); 296 UseCounter::count(executingWindow->document(), UseCounter::SubFr ameBeforeUnloadFired);
297 UseCounter::count(executingWindow->document(), UseCounter::DocumentB eforeUnloadFired); 297 UseCounter::count(executingWindow->document(), UseCounter::DocumentB eforeUnloadFired);
298 } 298 }
299 } else if (event->type() == EventTypeNames::unload) { 299 } else if (event->type() == EventTypeNames::unload) {
300 if (DOMWindow* executingWindow = this->executingWindow()) 300 if (DOMWindow* executingWindow = this->executingWindow())
301 UseCounter::count(executingWindow->document(), UseCounter::DocumentU nloadFired); 301 UseCounter::count(executingWindow->document(), UseCounter::DocumentU nloadFired);
302 } else if (event->type() == EventTypeNames::DOMFocusIn || event->type() == E ventTypeNames::DOMFocusOut) {
303 if (DOMWindow* executingWindow = this->executingWindow())
304 UseCounter::count(executingWindow->document(), UseCounter::DOMFocusI nOutEvent);
305 } else if (event->type() == EventTypeNames::focusin || event->type() == Even tTypeNames::focusout) {
306 if (DOMWindow* executingWindow = this->executingWindow())
307 UseCounter::count(executingWindow->document(), UseCounter::FocusInOu tEvent);
302 } 308 }
303 309
304 size_t i = 0; 310 size_t i = 0;
305 size_t size = entry.size(); 311 size_t size = entry.size();
306 if (!d->firingEventIterators) 312 if (!d->firingEventIterators)
307 d->firingEventIterators = adoptPtr(new FiringEventIteratorVector); 313 d->firingEventIterators = adoptPtr(new FiringEventIteratorVector);
308 d->firingEventIterators->append(FiringEventIterator(event->type(), i, size)) ; 314 d->firingEventIterators->append(FiringEventIterator(event->type(), i, size)) ;
309 for ( ; i < size; ++i) { 315 for ( ; i < size; ++i) {
310 RegisteredEventListener& registeredListener = entry[i]; 316 RegisteredEventListener& registeredListener = entry[i];
311 if (event->eventPhase() == Event::CAPTURING_PHASE && !registeredListener .useCapture) 317 if (event->eventPhase() == Event::CAPTURING_PHASE && !registeredListener .useCapture)
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 // they have one less listener to invoke. 369 // they have one less listener to invoke.
364 if (d->firingEventIterators) { 370 if (d->firingEventIterators) {
365 for (size_t i = 0; i < d->firingEventIterators->size(); ++i) { 371 for (size_t i = 0; i < d->firingEventIterators->size(); ++i) {
366 d->firingEventIterators->at(i).iterator = 0; 372 d->firingEventIterators->at(i).iterator = 0;
367 d->firingEventIterators->at(i).end = 0; 373 d->firingEventIterators->at(i).end = 0;
368 } 374 }
369 } 375 }
370 } 376 }
371 377
372 } // namespace WebCore 378 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698