OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. |
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 1407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1418 | 1418 |
1419 for (auto& it : m_eventListenerObservers) { | 1419 for (auto& it : m_eventListenerObservers) { |
1420 it->didAddEventListener(this, eventType); | 1420 it->didAddEventListener(this, eventType); |
1421 } | 1421 } |
1422 | 1422 |
1423 if (eventType == EventTypeNames::unload) { | 1423 if (eventType == EventTypeNames::unload) { |
1424 UseCounter::count(document(), UseCounter::DocumentUnloadRegistered); | 1424 UseCounter::count(document(), UseCounter::DocumentUnloadRegistered); |
1425 addUnloadEventListener(this); | 1425 addUnloadEventListener(this); |
1426 } else if (eventType == EventTypeNames::beforeunload) { | 1426 } else if (eventType == EventTypeNames::beforeunload) { |
1427 UseCounter::count(document(), UseCounter::DocumentBeforeUnloadRegistered); | 1427 UseCounter::count(document(), UseCounter::DocumentBeforeUnloadRegistered); |
1428 // This is confusingly named. It doesn't actually add the listener. It | |
1429 // just increments a count so that we know we have listeners registered | |
1430 // for the purposes of determining if we can fast terminate the renderer | |
1431 // process. | |
dcheng
2017/03/30 19:16:57
Nit: move this to line 1423 (since it applies equa
| |
1428 addBeforeUnloadEventListener(this); | 1432 addBeforeUnloadEventListener(this); |
1429 if (frame() && !frame()->isMainFrame()) | 1433 if (frame() && !frame()->isMainFrame()) |
1430 UseCounter::count(document(), UseCounter::SubFrameBeforeUnloadRegistered); | 1434 UseCounter::count(document(), UseCounter::SubFrameBeforeUnloadRegistered); |
1431 } | 1435 } |
1432 } | 1436 } |
1433 | 1437 |
1434 void LocalDOMWindow::removedEventListener( | 1438 void LocalDOMWindow::removedEventListener( |
1435 const AtomicString& eventType, | 1439 const AtomicString& eventType, |
1436 const RegisteredEventListener& registeredListener) { | 1440 const RegisteredEventListener& registeredListener) { |
1437 DOMWindow::removedEventListener(eventType, registeredListener); | 1441 DOMWindow::removedEventListener(eventType, registeredListener); |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1643 DOMWindow::trace(visitor); | 1647 DOMWindow::trace(visitor); |
1644 Supplementable<LocalDOMWindow>::trace(visitor); | 1648 Supplementable<LocalDOMWindow>::trace(visitor); |
1645 } | 1649 } |
1646 | 1650 |
1647 DEFINE_TRACE_WRAPPERS(LocalDOMWindow) { | 1651 DEFINE_TRACE_WRAPPERS(LocalDOMWindow) { |
1648 visitor->traceWrappers(m_customElements); | 1652 visitor->traceWrappers(m_customElements); |
1649 DOMWindow::traceWrappers(visitor); | 1653 DOMWindow::traceWrappers(visitor); |
1650 } | 1654 } |
1651 | 1655 |
1652 } // namespace blink | 1656 } // namespace blink |
OLD | NEW |