| 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 return windowsWithBeforeUnloadEventListeners; | 186 return windowsWithBeforeUnloadEventListeners; |
| 187 } | 187 } |
| 188 | 188 |
| 189 static void addUnloadEventListener(LocalDOMWindow* domWindow) { | 189 static void addUnloadEventListener(LocalDOMWindow* domWindow) { |
| 190 DOMWindowSet& set = windowsWithUnloadEventListeners(); | 190 DOMWindowSet& set = windowsWithUnloadEventListeners(); |
| 191 if (set.isEmpty()) { | 191 if (set.isEmpty()) { |
| 192 updateSuddenTerminationStatus(domWindow, true, | 192 updateSuddenTerminationStatus(domWindow, true, |
| 193 LocalFrameClient::UnloadHandler); | 193 LocalFrameClient::UnloadHandler); |
| 194 } | 194 } |
| 195 | 195 |
| 196 set.add(domWindow); | 196 set.insert(domWindow); |
| 197 } | 197 } |
| 198 | 198 |
| 199 static void removeUnloadEventListener(LocalDOMWindow* domWindow) { | 199 static void removeUnloadEventListener(LocalDOMWindow* domWindow) { |
| 200 DOMWindowSet& set = windowsWithUnloadEventListeners(); | 200 DOMWindowSet& set = windowsWithUnloadEventListeners(); |
| 201 DOMWindowSet::iterator it = set.find(domWindow); | 201 DOMWindowSet::iterator it = set.find(domWindow); |
| 202 if (it == set.end()) | 202 if (it == set.end()) |
| 203 return; | 203 return; |
| 204 set.remove(it); | 204 set.remove(it); |
| 205 if (set.isEmpty()) { | 205 if (set.isEmpty()) { |
| 206 updateSuddenTerminationStatus(domWindow, false, | 206 updateSuddenTerminationStatus(domWindow, false, |
| (...skipping 13 matching lines...) Expand all Loading... |
| 220 } | 220 } |
| 221 } | 221 } |
| 222 | 222 |
| 223 static void addBeforeUnloadEventListener(LocalDOMWindow* domWindow) { | 223 static void addBeforeUnloadEventListener(LocalDOMWindow* domWindow) { |
| 224 DOMWindowSet& set = windowsWithBeforeUnloadEventListeners(); | 224 DOMWindowSet& set = windowsWithBeforeUnloadEventListeners(); |
| 225 if (set.isEmpty()) { | 225 if (set.isEmpty()) { |
| 226 updateSuddenTerminationStatus(domWindow, true, | 226 updateSuddenTerminationStatus(domWindow, true, |
| 227 LocalFrameClient::BeforeUnloadHandler); | 227 LocalFrameClient::BeforeUnloadHandler); |
| 228 } | 228 } |
| 229 | 229 |
| 230 set.add(domWindow); | 230 set.insert(domWindow); |
| 231 } | 231 } |
| 232 | 232 |
| 233 static void removeBeforeUnloadEventListener(LocalDOMWindow* domWindow) { | 233 static void removeBeforeUnloadEventListener(LocalDOMWindow* domWindow) { |
| 234 DOMWindowSet& set = windowsWithBeforeUnloadEventListeners(); | 234 DOMWindowSet& set = windowsWithBeforeUnloadEventListeners(); |
| 235 DOMWindowSet::iterator it = set.find(domWindow); | 235 DOMWindowSet::iterator it = set.find(domWindow); |
| 236 if (it == set.end()) | 236 if (it == set.end()) |
| 237 return; | 237 return; |
| 238 set.remove(it); | 238 set.remove(it); |
| 239 if (set.isEmpty()) { | 239 if (set.isEmpty()) { |
| 240 updateSuddenTerminationStatus(domWindow, false, | 240 updateSuddenTerminationStatus(domWindow, false, |
| (...skipping 1406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1647 DOMWindow::trace(visitor); | 1647 DOMWindow::trace(visitor); |
| 1648 Supplementable<LocalDOMWindow>::trace(visitor); | 1648 Supplementable<LocalDOMWindow>::trace(visitor); |
| 1649 } | 1649 } |
| 1650 | 1650 |
| 1651 DEFINE_TRACE_WRAPPERS(LocalDOMWindow) { | 1651 DEFINE_TRACE_WRAPPERS(LocalDOMWindow) { |
| 1652 visitor->traceWrappers(m_customElements); | 1652 visitor->traceWrappers(m_customElements); |
| 1653 DOMWindow::traceWrappers(visitor); | 1653 DOMWindow::traceWrappers(visitor); |
| 1654 } | 1654 } |
| 1655 | 1655 |
| 1656 } // namespace blink | 1656 } // namespace blink |
| OLD | NEW |