| 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 FrameLoaderClient::SuddenTerminationDisablerType disablerType) { | 170 FrameLoaderClient::SuddenTerminationDisablerType disablerType) { |
| 171 Platform::current()->suddenTerminationChanged(!addedListener); | 171 Platform::current()->suddenTerminationChanged(!addedListener); |
| 172 if (domWindow->frame() && domWindow->frame()->loader().client()) | 172 if (domWindow->frame() && domWindow->frame()->loader().client()) |
| 173 domWindow->frame()->loader().client()->suddenTerminationDisablerChanged( | 173 domWindow->frame()->loader().client()->suddenTerminationDisablerChanged( |
| 174 addedListener, disablerType); | 174 addedListener, disablerType); |
| 175 } | 175 } |
| 176 | 176 |
| 177 using DOMWindowSet = PersistentHeapHashCountedSet<WeakMember<LocalDOMWindow>>; | 177 using DOMWindowSet = PersistentHeapHashCountedSet<WeakMember<LocalDOMWindow>>; |
| 178 | 178 |
| 179 static DOMWindowSet& windowsWithUnloadEventListeners() { | 179 static DOMWindowSet& windowsWithUnloadEventListeners() { |
| 180 ALLOW_UNSAFE_SINGLETON() |
| 180 DEFINE_STATIC_LOCAL(DOMWindowSet, windowsWithUnloadEventListeners, ()); | 181 DEFINE_STATIC_LOCAL(DOMWindowSet, windowsWithUnloadEventListeners, ()); |
| 181 return windowsWithUnloadEventListeners; | 182 return windowsWithUnloadEventListeners; |
| 182 } | 183 } |
| 183 | 184 |
| 184 static DOMWindowSet& windowsWithBeforeUnloadEventListeners() { | 185 static DOMWindowSet& windowsWithBeforeUnloadEventListeners() { |
| 186 ALLOW_UNSAFE_SINGLETON() |
| 185 DEFINE_STATIC_LOCAL(DOMWindowSet, windowsWithBeforeUnloadEventListeners, ()); | 187 DEFINE_STATIC_LOCAL(DOMWindowSet, windowsWithBeforeUnloadEventListeners, ()); |
| 186 return windowsWithBeforeUnloadEventListeners; | 188 return windowsWithBeforeUnloadEventListeners; |
| 187 } | 189 } |
| 188 | 190 |
| 189 static void addUnloadEventListener(LocalDOMWindow* domWindow) { | 191 static void addUnloadEventListener(LocalDOMWindow* domWindow) { |
| 190 DOMWindowSet& set = windowsWithUnloadEventListeners(); | 192 DOMWindowSet& set = windowsWithUnloadEventListeners(); |
| 191 if (set.isEmpty()) | 193 if (set.isEmpty()) |
| 192 updateSuddenTerminationStatus(domWindow, true, | 194 updateSuddenTerminationStatus(domWindow, true, |
| 193 FrameLoaderClient::UnloadHandler); | 195 FrameLoaderClient::UnloadHandler); |
| 194 | 196 |
| (...skipping 1437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1632 DOMWindow::trace(visitor); | 1634 DOMWindow::trace(visitor); |
| 1633 Supplementable<LocalDOMWindow>::trace(visitor); | 1635 Supplementable<LocalDOMWindow>::trace(visitor); |
| 1634 } | 1636 } |
| 1635 | 1637 |
| 1636 DEFINE_TRACE_WRAPPERS(LocalDOMWindow) { | 1638 DEFINE_TRACE_WRAPPERS(LocalDOMWindow) { |
| 1637 visitor->traceWrappers(m_customElements); | 1639 visitor->traceWrappers(m_customElements); |
| 1638 DOMWindow::traceWrappers(visitor); | 1640 DOMWindow::traceWrappers(visitor); |
| 1639 } | 1641 } |
| 1640 | 1642 |
| 1641 } // namespace blink | 1643 } // namespace blink |
| OLD | NEW |