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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 | 267 |
268 bool LocalDOMWindow::allowPopUp() { | 268 bool LocalDOMWindow::allowPopUp() { |
269 return frame() && allowPopUp(*frame()); | 269 return frame() && allowPopUp(*frame()); |
270 } | 270 } |
271 | 271 |
272 LocalDOMWindow::LocalDOMWindow(LocalFrame& frame) | 272 LocalDOMWindow::LocalDOMWindow(LocalFrame& frame) |
273 : m_frame(&frame), | 273 : m_frame(&frame), |
274 m_visualViewport(DOMVisualViewport::create(this)), | 274 m_visualViewport(DOMVisualViewport::create(this)), |
275 m_unusedPreloadsTimer(this, &LocalDOMWindow::warnUnusedPreloads), | 275 m_unusedPreloadsTimer(this, &LocalDOMWindow::warnUnusedPreloads), |
276 m_shouldPrintWhenFinishedLoading(false) { | 276 m_shouldPrintWhenFinishedLoading(false) { |
277 ThreadState::current()->registerPreFinalizer(this); | |
278 } | 277 } |
279 | 278 |
280 void LocalDOMWindow::clearDocument() { | 279 void LocalDOMWindow::clearDocument() { |
281 if (!m_document) | 280 if (!m_document) |
282 return; | 281 return; |
283 | 282 |
284 ASSERT(!m_document->isActive()); | 283 ASSERT(!m_document->isActive()); |
285 | 284 |
286 // FIXME: This should be part of SuspendableObject shutdown | 285 // FIXME: This should be part of SuspendableObject shutdown |
287 clearEventQueue(); | 286 clearEventQueue(); |
(...skipping 1279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1567 | 1566 |
1568 LocalFrame* LocalDOMWindow::frame() const { | 1567 LocalFrame* LocalDOMWindow::frame() const { |
1569 // If the LocalDOMWindow still has a frame reference, that frame must point | 1568 // If the LocalDOMWindow still has a frame reference, that frame must point |
1570 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation | 1569 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation |
1571 // where script execution leaks between different LocalDOMWindows. | 1570 // where script execution leaks between different LocalDOMWindows. |
1572 SECURITY_DCHECK(!m_frame || m_frame->domWindow() == this); | 1571 SECURITY_DCHECK(!m_frame || m_frame->domWindow() == this); |
1573 return m_frame; | 1572 return m_frame; |
1574 } | 1573 } |
1575 | 1574 |
1576 } // namespace blink | 1575 } // namespace blink |
OLD | NEW |