| 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/frame/BarProp.h" | 53 #include "core/frame/BarProp.h" |
| 54 #include "core/frame/DOMVisualViewport.h" | 54 #include "core/frame/DOMVisualViewport.h" |
| 55 #include "core/frame/EventHandlerRegistry.h" | 55 #include "core/frame/EventHandlerRegistry.h" |
| 56 #include "core/frame/External.h" |
| 56 #include "core/frame/FrameConsole.h" | 57 #include "core/frame/FrameConsole.h" |
| 57 #include "core/frame/FrameView.h" | 58 #include "core/frame/FrameView.h" |
| 58 #include "core/frame/History.h" | 59 #include "core/frame/History.h" |
| 59 #include "core/frame/LocalFrame.h" | 60 #include "core/frame/LocalFrame.h" |
| 60 #include "core/frame/Navigator.h" | 61 #include "core/frame/Navigator.h" |
| 61 #include "core/frame/Screen.h" | 62 #include "core/frame/Screen.h" |
| 62 #include "core/frame/ScrollToOptions.h" | 63 #include "core/frame/ScrollToOptions.h" |
| 63 #include "core/frame/Settings.h" | 64 #include "core/frame/Settings.h" |
| 64 #include "core/frame/SuspendableTimer.h" | 65 #include "core/frame/SuspendableTimer.h" |
| 65 #include "core/frame/VisualViewport.h" | 66 #include "core/frame/VisualViewport.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 79 #include "core/page/scrolling/ScrollingCoordinator.h" | 80 #include "core/page/scrolling/ScrollingCoordinator.h" |
| 80 #include "core/timing/DOMWindowPerformance.h" | 81 #include "core/timing/DOMWindowPerformance.h" |
| 81 #include "core/timing/Performance.h" | 82 #include "core/timing/Performance.h" |
| 82 #include "platform/EventDispatchForbiddenScope.h" | 83 #include "platform/EventDispatchForbiddenScope.h" |
| 83 #include "platform/WebFrameScheduler.h" | 84 #include "platform/WebFrameScheduler.h" |
| 84 #include "platform/loader/fetch/ResourceFetcher.h" | 85 #include "platform/loader/fetch/ResourceFetcher.h" |
| 85 #include "platform/weborigin/SecurityOrigin.h" | 86 #include "platform/weborigin/SecurityOrigin.h" |
| 86 #include "platform/weborigin/Suborigin.h" | 87 #include "platform/weborigin/Suborigin.h" |
| 87 #include "public/platform/Platform.h" | 88 #include "public/platform/Platform.h" |
| 88 #include "public/platform/WebScreenInfo.h" | 89 #include "public/platform/WebScreenInfo.h" |
| 90 |
| 89 #include <memory> | 91 #include <memory> |
| 90 | 92 |
| 91 namespace blink { | 93 namespace blink { |
| 92 | 94 |
| 93 // Timeout for link preloads to be used after window.onload | 95 // Timeout for link preloads to be used after window.onload |
| 94 static const int unusedPreloadTimeoutInSeconds = 3; | 96 static const int unusedPreloadTimeoutInSeconds = 3; |
| 95 | 97 |
| 96 class PostMessageTimer final | 98 class PostMessageTimer final |
| 97 : public GarbageCollectedFinalized<PostMessageTimer>, | 99 : public GarbageCollectedFinalized<PostMessageTimer>, |
| 98 public SuspendableTimer { | 100 public SuspendableTimer { |
| (...skipping 1274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1373 CustomElementRegistry* LocalDOMWindow::customElements() const { | 1375 CustomElementRegistry* LocalDOMWindow::customElements() const { |
| 1374 if (!m_customElements && m_document) | 1376 if (!m_customElements && m_document) |
| 1375 m_customElements = CustomElementRegistry::create(this); | 1377 m_customElements = CustomElementRegistry::create(this); |
| 1376 return m_customElements; | 1378 return m_customElements; |
| 1377 } | 1379 } |
| 1378 | 1380 |
| 1379 CustomElementRegistry* LocalDOMWindow::maybeCustomElements() const { | 1381 CustomElementRegistry* LocalDOMWindow::maybeCustomElements() const { |
| 1380 return m_customElements; | 1382 return m_customElements; |
| 1381 } | 1383 } |
| 1382 | 1384 |
| 1385 External* LocalDOMWindow::external() { |
| 1386 if (!m_external) |
| 1387 m_external = new External; |
| 1388 return m_external; |
| 1389 } |
| 1390 |
| 1391 bool LocalDOMWindow::isSecureContext() const { |
| 1392 if (!frame()) |
| 1393 return false; |
| 1394 |
| 1395 return document()->isSecureContext( |
| 1396 ExecutionContext::StandardSecureContextCheck); |
| 1397 } |
| 1398 |
| 1383 void LocalDOMWindow::addedEventListener( | 1399 void LocalDOMWindow::addedEventListener( |
| 1384 const AtomicString& eventType, | 1400 const AtomicString& eventType, |
| 1385 RegisteredEventListener& registeredListener) { | 1401 RegisteredEventListener& registeredListener) { |
| 1386 DOMWindow::addedEventListener(eventType, registeredListener); | 1402 DOMWindow::addedEventListener(eventType, registeredListener); |
| 1387 if (frame() && frame()->host()) | 1403 if (frame() && frame()->host()) |
| 1388 frame()->host()->eventHandlerRegistry().didAddEventHandler( | 1404 frame()->host()->eventHandlerRegistry().didAddEventHandler( |
| 1389 *this, eventType, registeredListener.options()); | 1405 *this, eventType, registeredListener.options()); |
| 1390 | 1406 |
| 1391 if (Document* document = this->document()) | 1407 if (Document* document = this->document()) |
| 1392 document->addListenerTypeIfNeeded(eventType); | 1408 document->addListenerTypeIfNeeded(eventType); |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1600 visitor->trace(m_history); | 1616 visitor->trace(m_history); |
| 1601 visitor->trace(m_locationbar); | 1617 visitor->trace(m_locationbar); |
| 1602 visitor->trace(m_menubar); | 1618 visitor->trace(m_menubar); |
| 1603 visitor->trace(m_personalbar); | 1619 visitor->trace(m_personalbar); |
| 1604 visitor->trace(m_scrollbars); | 1620 visitor->trace(m_scrollbars); |
| 1605 visitor->trace(m_statusbar); | 1621 visitor->trace(m_statusbar); |
| 1606 visitor->trace(m_toolbar); | 1622 visitor->trace(m_toolbar); |
| 1607 visitor->trace(m_navigator); | 1623 visitor->trace(m_navigator); |
| 1608 visitor->trace(m_media); | 1624 visitor->trace(m_media); |
| 1609 visitor->trace(m_customElements); | 1625 visitor->trace(m_customElements); |
| 1626 visitor->trace(m_external); |
| 1610 visitor->trace(m_applicationCache); | 1627 visitor->trace(m_applicationCache); |
| 1611 visitor->trace(m_eventQueue); | 1628 visitor->trace(m_eventQueue); |
| 1612 visitor->trace(m_postMessageTimers); | 1629 visitor->trace(m_postMessageTimers); |
| 1613 visitor->trace(m_visualViewport); | 1630 visitor->trace(m_visualViewport); |
| 1614 visitor->trace(m_eventListenerObservers); | 1631 visitor->trace(m_eventListenerObservers); |
| 1615 DOMWindow::trace(visitor); | 1632 DOMWindow::trace(visitor); |
| 1616 Supplementable<LocalDOMWindow>::trace(visitor); | 1633 Supplementable<LocalDOMWindow>::trace(visitor); |
| 1617 } | 1634 } |
| 1618 | 1635 |
| 1619 DEFINE_TRACE_WRAPPERS(LocalDOMWindow) { | 1636 DEFINE_TRACE_WRAPPERS(LocalDOMWindow) { |
| 1620 visitor->traceWrappers(m_customElements); | 1637 visitor->traceWrappers(m_customElements); |
| 1621 DOMWindow::traceWrappers(visitor); | 1638 DOMWindow::traceWrappers(visitor); |
| 1622 } | 1639 } |
| 1623 | 1640 |
| 1624 } // namespace blink | 1641 } // namespace blink |
| OLD | NEW |