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

Side by Side Diff: sky/engine/core/events/EventTarget.cpp

Issue 645513006: Remove beforeunload events. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 | « sky/engine/core/events/Event.cpp ('k') | sky/engine/core/events/EventTypeNames.in » ('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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 void EventTarget::fireEventListeners(Event* event, EventTargetData* d, EventList enerVector& entry) 282 void EventTarget::fireEventListeners(Event* event, EventTargetData* d, EventList enerVector& entry)
283 { 283 {
284 RefPtrWillBeRawPtr<EventTarget> protect(this); 284 RefPtrWillBeRawPtr<EventTarget> protect(this);
285 285
286 // Fire all listeners registered for this event. Don't fire listeners remove d 286 // Fire all listeners registered for this event. Don't fire listeners remove d
287 // during event dispatch. Also, don't fire event listeners added during even t 287 // during event dispatch. Also, don't fire event listeners added during even t
288 // dispatch. Conveniently, all new event listeners will be added after or at 288 // dispatch. Conveniently, all new event listeners will be added after or at
289 // index |size|, so iterating up to (but not including) |size| naturally exc ludes 289 // index |size|, so iterating up to (but not including) |size| naturally exc ludes
290 // new event listeners. 290 // new event listeners.
291 291
292 if (event->type() == EventTypeNames::beforeunload) { 292 if (event->type() == EventTypeNames::unload) {
293 if (LocalDOMWindow* executingWindow = this->executingWindow())
294 UseCounter::count(executingWindow->document(), UseCounter::DocumentB eforeUnloadFired);
295 } else if (event->type() == EventTypeNames::unload) {
296 if (LocalDOMWindow* executingWindow = this->executingWindow()) 293 if (LocalDOMWindow* executingWindow = this->executingWindow())
297 UseCounter::count(executingWindow->document(), UseCounter::DocumentU nloadFired); 294 UseCounter::count(executingWindow->document(), UseCounter::DocumentU nloadFired);
298 } else if (event->type() == EventTypeNames::DOMFocusIn || event->type() == E ventTypeNames::DOMFocusOut) { 295 } else if (event->type() == EventTypeNames::DOMFocusIn || event->type() == E ventTypeNames::DOMFocusOut) {
299 if (LocalDOMWindow* executingWindow = this->executingWindow()) 296 if (LocalDOMWindow* executingWindow = this->executingWindow())
300 UseCounter::count(executingWindow->document(), UseCounter::DOMFocusI nOutEvent); 297 UseCounter::count(executingWindow->document(), UseCounter::DOMFocusI nOutEvent);
301 } else if (event->type() == EventTypeNames::focusin || event->type() == Even tTypeNames::focusout) { 298 } else if (event->type() == EventTypeNames::focusin || event->type() == Even tTypeNames::focusout) {
302 if (LocalDOMWindow* executingWindow = this->executingWindow()) 299 if (LocalDOMWindow* executingWindow = this->executingWindow())
303 UseCounter::count(executingWindow->document(), UseCounter::FocusInOu tEvent); 300 UseCounter::count(executingWindow->document(), UseCounter::FocusInOu tEvent);
304 } 301 }
305 302
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 // they have one less listener to invoke. 360 // they have one less listener to invoke.
364 if (d->firingEventIterators) { 361 if (d->firingEventIterators) {
365 for (size_t i = 0; i < d->firingEventIterators->size(); ++i) { 362 for (size_t i = 0; i < d->firingEventIterators->size(); ++i) {
366 d->firingEventIterators->at(i).iterator = 0; 363 d->firingEventIterators->at(i).iterator = 0;
367 d->firingEventIterators->at(i).end = 0; 364 d->firingEventIterators->at(i).end = 0;
368 } 365 }
369 } 366 }
370 } 367 }
371 368
372 } // namespace blink 369 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/events/Event.cpp ('k') | sky/engine/core/events/EventTypeNames.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698