| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 return new WindowFrameObserver(window, frame); | 97 return new WindowFrameObserver(window, frame); |
| 98 } | 98 } |
| 99 | 99 |
| 100 DEFINE_INLINE_VIRTUAL_TRACE() | 100 DEFINE_INLINE_VIRTUAL_TRACE() |
| 101 { | 101 { |
| 102 visitor->trace(m_window); | 102 visitor->trace(m_window); |
| 103 LocalFrameLifecycleObserver::trace(visitor); | 103 LocalFrameLifecycleObserver::trace(visitor); |
| 104 } | 104 } |
| 105 | 105 |
| 106 // LocalFrameLifecycleObserver overrides: | 106 // LocalFrameLifecycleObserver overrides: |
| 107 void willDetachFrameHost() override | |
| 108 { | |
| 109 m_window->willDetachFrameHost(); | |
| 110 } | |
| 111 | |
| 112 void contextDestroyed() override | 107 void contextDestroyed() override |
| 113 { | 108 { |
| 114 m_window->frameDestroyed(); | 109 m_window->frameDestroyed(); |
| 115 LocalFrameLifecycleObserver::contextDestroyed(); | 110 LocalFrameLifecycleObserver::contextDestroyed(); |
| 116 } | 111 } |
| 117 | 112 |
| 118 private: | 113 private: |
| 119 WindowFrameObserver(LocalDOMWindow* window, LocalFrame& frame) | 114 WindowFrameObserver(LocalDOMWindow* window, LocalFrame& frame) |
| 120 : LocalFrameLifecycleObserver(&frame) | 115 : LocalFrameLifecycleObserver(&frame) |
| 121 , m_window(window) | 116 , m_window(window) |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 LocalDOMWindow* LocalDOMWindow::toLocalDOMWindow() | 483 LocalDOMWindow* LocalDOMWindow::toLocalDOMWindow() |
| 489 { | 484 { |
| 490 return this; | 485 return this; |
| 491 } | 486 } |
| 492 | 487 |
| 493 MediaQueryList* LocalDOMWindow::matchMedia(const String& media) | 488 MediaQueryList* LocalDOMWindow::matchMedia(const String& media) |
| 494 { | 489 { |
| 495 return document() ? document()->mediaQueryMatcher().matchMedia(media) : null
ptr; | 490 return document() ? document()->mediaQueryMatcher().matchMedia(media) : null
ptr; |
| 496 } | 491 } |
| 497 | 492 |
| 498 void LocalDOMWindow::willDetachFrameHost() | |
| 499 { | |
| 500 frame()->host()->eventHandlerRegistry().didRemoveAllEventHandlers(*this); | |
| 501 } | |
| 502 | |
| 503 void LocalDOMWindow::frameDestroyed() | 493 void LocalDOMWindow::frameDestroyed() |
| 504 { | 494 { |
| 505 willDestroyDocumentInFrame(); | 495 willDestroyDocumentInFrame(); |
| 506 resetLocation(); | 496 resetLocation(); |
| 507 m_properties.clear(); | 497 m_properties.clear(); |
| 508 removeAllEventListeners(); | 498 removeAllEventListeners(); |
| 509 } | 499 } |
| 510 | 500 |
| 511 void LocalDOMWindow::willDestroyDocumentInFrame() | 501 void LocalDOMWindow::willDestroyDocumentInFrame() |
| 512 { | 502 { |
| (...skipping 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1559 { | 1549 { |
| 1560 // If the LocalDOMWindow still has a frame reference, that frame must point | 1550 // If the LocalDOMWindow still has a frame reference, that frame must point |
| 1561 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation | 1551 // back to this LocalDOMWindow: otherwise, it's easy to get into a situation |
| 1562 // where script execution leaks between different LocalDOMWindows. | 1552 // where script execution leaks between different LocalDOMWindows. |
| 1563 if (m_frameObserver->frame()) | 1553 if (m_frameObserver->frame()) |
| 1564 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() =
= this); | 1554 ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() =
= this); |
| 1565 return m_frameObserver->frame(); | 1555 return m_frameObserver->frame(); |
| 1566 } | 1556 } |
| 1567 | 1557 |
| 1568 } // namespace blink | 1558 } // namespace blink |
| OLD | NEW |