| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 #include "core/editing/Editor.h" | 46 #include "core/editing/Editor.h" |
| 47 #include "core/events/DOMWindowEventQueue.h" | 47 #include "core/events/DOMWindowEventQueue.h" |
| 48 #include "core/events/HashChangeEvent.h" | 48 #include "core/events/HashChangeEvent.h" |
| 49 #include "core/events/MessageEvent.h" | 49 #include "core/events/MessageEvent.h" |
| 50 #include "core/events/PageTransitionEvent.h" | 50 #include "core/events/PageTransitionEvent.h" |
| 51 #include "core/events/PopStateEvent.h" | 51 #include "core/events/PopStateEvent.h" |
| 52 #include "core/events/ScopedEventQueue.h" | 52 #include "core/events/ScopedEventQueue.h" |
| 53 #include "core/fetch/ResourceFetcher.h" | 53 #include "core/fetch/ResourceFetcher.h" |
| 54 #include "core/frame/BarProp.h" | 54 #include "core/frame/BarProp.h" |
| 55 #include "core/frame/DOMVisualViewport.h" | 55 #include "core/frame/DOMVisualViewport.h" |
| 56 #include "core/frame/DOMWindowProperty.h" | |
| 57 #include "core/frame/EventHandlerRegistry.h" | 56 #include "core/frame/EventHandlerRegistry.h" |
| 58 #include "core/frame/FrameConsole.h" | 57 #include "core/frame/FrameConsole.h" |
| 59 #include "core/frame/FrameView.h" | 58 #include "core/frame/FrameView.h" |
| 60 #include "core/frame/History.h" | 59 #include "core/frame/History.h" |
| 61 #include "core/frame/LocalFrame.h" | 60 #include "core/frame/LocalFrame.h" |
| 62 #include "core/frame/Navigator.h" | 61 #include "core/frame/Navigator.h" |
| 63 #include "core/frame/Screen.h" | 62 #include "core/frame/Screen.h" |
| 64 #include "core/frame/ScrollToOptions.h" | 63 #include "core/frame/ScrollToOptions.h" |
| 65 #include "core/frame/Settings.h" | 64 #include "core/frame/Settings.h" |
| 66 #include "core/frame/SuspendableTimer.h" | 65 #include "core/frame/SuspendableTimer.h" |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 472 LocalDOMWindow* LocalDOMWindow::toLocalDOMWindow() { | 471 LocalDOMWindow* LocalDOMWindow::toLocalDOMWindow() { |
| 473 return this; | 472 return this; |
| 474 } | 473 } |
| 475 | 474 |
| 476 MediaQueryList* LocalDOMWindow::matchMedia(const String& media) { | 475 MediaQueryList* LocalDOMWindow::matchMedia(const String& media) { |
| 477 return document() ? document()->mediaQueryMatcher().matchMedia(media) | 476 return document() ? document()->mediaQueryMatcher().matchMedia(media) |
| 478 : nullptr; | 477 : nullptr; |
| 479 } | 478 } |
| 480 | 479 |
| 481 void LocalDOMWindow::frameDestroyed() { | 480 void LocalDOMWindow::frameDestroyed() { |
| 482 for (const auto& domWindowProperty : m_properties) | |
| 483 domWindowProperty->frameDestroyed(); | |
| 484 | |
| 485 resetLocation(); | 481 resetLocation(); |
| 486 m_properties.clear(); | |
| 487 removeAllEventListeners(); | 482 removeAllEventListeners(); |
| 488 disconnectFromFrame(); | 483 disconnectFromFrame(); |
| 489 } | 484 } |
| 490 | 485 |
| 491 void LocalDOMWindow::registerProperty(DOMWindowProperty* property) { | |
| 492 m_properties.add(property); | |
| 493 } | |
| 494 | |
| 495 void LocalDOMWindow::unregisterProperty(DOMWindowProperty* property) { | |
| 496 m_properties.remove(property); | |
| 497 } | |
| 498 | |
| 499 void LocalDOMWindow::registerEventListenerObserver( | 486 void LocalDOMWindow::registerEventListenerObserver( |
| 500 EventListenerObserver* eventListenerObserver) { | 487 EventListenerObserver* eventListenerObserver) { |
| 501 m_eventListenerObservers.add(eventListenerObserver); | 488 m_eventListenerObservers.add(eventListenerObserver); |
| 502 } | 489 } |
| 503 | 490 |
| 504 void LocalDOMWindow::reset() { | 491 void LocalDOMWindow::reset() { |
| 505 DCHECK(document()); | 492 DCHECK(document()); |
| 506 DCHECK(document()->isContextDestroyed()); | 493 DCHECK(document()->isContextDestroyed()); |
| 507 frameDestroyed(); | 494 frameDestroyed(); |
| 508 | 495 |
| (...skipping 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1602 } | 1589 } |
| 1603 | 1590 |
| 1604 WindowFeatures features(windowFeaturesString); | 1591 WindowFeatures features(windowFeaturesString); |
| 1605 DOMWindow* newWindow = createWindow(urlString, frameName, features, | 1592 DOMWindow* newWindow = createWindow(urlString, frameName, features, |
| 1606 *callingWindow, *firstFrame, *frame()); | 1593 *callingWindow, *firstFrame, *frame()); |
| 1607 return features.noopener ? nullptr : newWindow; | 1594 return features.noopener ? nullptr : newWindow; |
| 1608 } | 1595 } |
| 1609 | 1596 |
| 1610 DEFINE_TRACE(LocalDOMWindow) { | 1597 DEFINE_TRACE(LocalDOMWindow) { |
| 1611 visitor->trace(m_document); | 1598 visitor->trace(m_document); |
| 1612 visitor->trace(m_properties); | |
| 1613 visitor->trace(m_screen); | 1599 visitor->trace(m_screen); |
| 1614 visitor->trace(m_history); | 1600 visitor->trace(m_history); |
| 1615 visitor->trace(m_locationbar); | 1601 visitor->trace(m_locationbar); |
| 1616 visitor->trace(m_menubar); | 1602 visitor->trace(m_menubar); |
| 1617 visitor->trace(m_personalbar); | 1603 visitor->trace(m_personalbar); |
| 1618 visitor->trace(m_scrollbars); | 1604 visitor->trace(m_scrollbars); |
| 1619 visitor->trace(m_statusbar); | 1605 visitor->trace(m_statusbar); |
| 1620 visitor->trace(m_toolbar); | 1606 visitor->trace(m_toolbar); |
| 1621 visitor->trace(m_navigator); | 1607 visitor->trace(m_navigator); |
| 1622 visitor->trace(m_media); | 1608 visitor->trace(m_media); |
| 1623 visitor->trace(m_customElements); | 1609 visitor->trace(m_customElements); |
| 1624 visitor->trace(m_applicationCache); | 1610 visitor->trace(m_applicationCache); |
| 1625 visitor->trace(m_eventQueue); | 1611 visitor->trace(m_eventQueue); |
| 1626 visitor->trace(m_postMessageTimers); | 1612 visitor->trace(m_postMessageTimers); |
| 1627 visitor->trace(m_visualViewport); | 1613 visitor->trace(m_visualViewport); |
| 1628 visitor->trace(m_eventListenerObservers); | 1614 visitor->trace(m_eventListenerObservers); |
| 1629 DOMWindow::trace(visitor); | 1615 DOMWindow::trace(visitor); |
| 1630 Supplementable<LocalDOMWindow>::trace(visitor); | 1616 Supplementable<LocalDOMWindow>::trace(visitor); |
| 1631 } | 1617 } |
| 1632 | 1618 |
| 1633 DEFINE_TRACE_WRAPPERS(LocalDOMWindow) { | 1619 DEFINE_TRACE_WRAPPERS(LocalDOMWindow) { |
| 1634 visitor->traceWrappers(m_customElements); | 1620 visitor->traceWrappers(m_customElements); |
| 1635 DOMWindow::traceWrappers(visitor); | 1621 DOMWindow::traceWrappers(visitor); |
| 1636 } | 1622 } |
| 1637 | 1623 |
| 1638 } // namespace blink | 1624 } // namespace blink |
| OLD | NEW |