| 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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 DOMWindowSet::iterator it = set.find(domWindow); | 258 DOMWindowSet::iterator it = set.find(domWindow); |
| 259 if (it == set.end()) | 259 if (it == set.end()) |
| 260 return; | 260 return; |
| 261 set.removeAll(it); | 261 set.removeAll(it); |
| 262 if (set.isEmpty()) | 262 if (set.isEmpty()) |
| 263 updateSuddenTerminationStatus(domWindow, false, FrameLoaderClient::Befor
eUnloadHandler); | 263 updateSuddenTerminationStatus(domWindow, false, FrameLoaderClient::Befor
eUnloadHandler); |
| 264 } | 264 } |
| 265 | 265 |
| 266 static bool allowsBeforeUnloadListeners(LocalDOMWindow* window) | 266 static bool allowsBeforeUnloadListeners(LocalDOMWindow* window) |
| 267 { | 267 { |
| 268 ASSERT_ARG(window, window); | 268 DCHECK(window); |
| 269 LocalFrame* frame = window->frame(); | 269 LocalFrame* frame = window->frame(); |
| 270 if (!frame) | 270 if (!frame) |
| 271 return false; | 271 return false; |
| 272 return frame->isMainFrame(); | 272 return frame->isMainFrame(); |
| 273 } | 273 } |
| 274 | 274 |
| 275 unsigned LocalDOMWindow::pendingUnloadEventListeners() const | 275 unsigned LocalDOMWindow::pendingUnloadEventListeners() const |
| 276 { | 276 { |
| 277 return windowsWithUnloadEventListeners().count(const_cast<LocalDOMWindow*>(t
his)); | 277 return windowsWithUnloadEventListeners().count(const_cast<LocalDOMWindow*>(t
his)); |
| 278 } | 278 } |
| (...skipping 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1526 { | 1526 { |
| 1527 // If the LocalDOMWindow still has a frame reference, that frame must point | 1527 // If the LocalDOMWindow still has a frame reference, that frame must point |
| 1528 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation | 1528 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation |
| 1529 // where script execution leaks between different LocalDOMWindows. | 1529 // where script execution leaks between different LocalDOMWindows. |
| 1530 if (m_frameObserver->frame()) | 1530 if (m_frameObserver->frame()) |
| 1531 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() =
= this); | 1531 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() =
= this); |
| 1532 return m_frameObserver->frame(); | 1532 return m_frameObserver->frame(); |
| 1533 } | 1533 } |
| 1534 | 1534 |
| 1535 } // namespace blink | 1535 } // namespace blink |
| OLD | NEW |