| 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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 return false; | 316 return false; |
| 317 FrameHost* host = frame->host(); | 317 FrameHost* host = frame->host(); |
| 318 if (!host) | 318 if (!host) |
| 319 return false; | 319 return false; |
| 320 return host->chrome().canRunModalNow(); | 320 return host->chrome().canRunModalNow(); |
| 321 } | 321 } |
| 322 | 322 |
| 323 DOMWindow::DOMWindow(LocalFrame& frame) | 323 DOMWindow::DOMWindow(LocalFrame& frame) |
| 324 : FrameDestructionObserver(&frame) | 324 : FrameDestructionObserver(&frame) |
| 325 , m_shouldPrintWhenFinishedLoading(false) | 325 , m_shouldPrintWhenFinishedLoading(false) |
| 326 #if ASSERT_ENABLED |
| 327 , m_hasBeenReset(false) |
| 328 #endif |
| 326 { | 329 { |
| 327 ScriptWrappable::init(this); | 330 ScriptWrappable::init(this); |
| 328 } | 331 } |
| 329 | 332 |
| 330 void DOMWindow::clearDocument() | 333 void DOMWindow::clearDocument() |
| 331 { | 334 { |
| 332 if (!m_document) | 335 if (!m_document) |
| 333 return; | 336 return; |
| 334 | 337 |
| 335 if (m_document->isActive()) { | 338 if (m_document->isActive()) { |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 // Per step 11 of section 6.5.9 (history traversal) of the HTML5 spec, we | 473 // Per step 11 of section 6.5.9 (history traversal) of the HTML5 spec, we |
| 471 // defer firing of popstate until we're in the complete state. | 474 // defer firing of popstate until we're in the complete state. |
| 472 if (document()->isLoadCompleted()) | 475 if (document()->isLoadCompleted()) |
| 473 enqueuePopstateEvent(stateObject); | 476 enqueuePopstateEvent(stateObject); |
| 474 else | 477 else |
| 475 m_pendingStateObject = stateObject; | 478 m_pendingStateObject = stateObject; |
| 476 } | 479 } |
| 477 | 480 |
| 478 DOMWindow::~DOMWindow() | 481 DOMWindow::~DOMWindow() |
| 479 { | 482 { |
| 480 ASSERT(!m_screen); | 483 ASSERT(m_hasBeenReset); |
| 481 ASSERT(!m_history); | |
| 482 ASSERT(!m_locationbar); | |
| 483 ASSERT(!m_menubar); | |
| 484 ASSERT(!m_personalbar); | |
| 485 ASSERT(!m_scrollbars); | |
| 486 ASSERT(!m_statusbar); | |
| 487 ASSERT(!m_toolbar); | |
| 488 ASSERT(!m_console); | |
| 489 ASSERT(!m_navigator); | |
| 490 ASSERT(!m_performance); | |
| 491 ASSERT(!m_location); | |
| 492 ASSERT(!m_media); | |
| 493 ASSERT(!m_sessionStorage); | |
| 494 ASSERT(!m_localStorage); | |
| 495 ASSERT(!m_applicationCache); | |
| 496 | |
| 497 reset(); | 484 reset(); |
| 498 | 485 |
| 499 removeAllEventListeners(); | 486 removeAllEventListeners(); |
| 500 | 487 |
| 501 ASSERT(m_document->isStopped()); | 488 ASSERT(m_document->isStopped()); |
| 502 clearDocument(); | 489 clearDocument(); |
| 503 } | 490 } |
| 504 | 491 |
| 505 const AtomicString& DOMWindow::interfaceName() const | 492 const AtomicString& DOMWindow::interfaceName() const |
| 506 { | 493 { |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 587 m_statusbar = nullptr; | 574 m_statusbar = nullptr; |
| 588 m_toolbar = nullptr; | 575 m_toolbar = nullptr; |
| 589 m_console = nullptr; | 576 m_console = nullptr; |
| 590 m_navigator = nullptr; | 577 m_navigator = nullptr; |
| 591 m_performance = nullptr; | 578 m_performance = nullptr; |
| 592 m_location = nullptr; | 579 m_location = nullptr; |
| 593 m_media = nullptr; | 580 m_media = nullptr; |
| 594 m_sessionStorage = nullptr; | 581 m_sessionStorage = nullptr; |
| 595 m_localStorage = nullptr; | 582 m_localStorage = nullptr; |
| 596 m_applicationCache = nullptr; | 583 m_applicationCache = nullptr; |
| 584 #if ASSERT_ENABLED |
| 585 m_hasBeenReset = true; |
| 586 #endif |
| 597 } | 587 } |
| 598 | 588 |
| 599 bool DOMWindow::isCurrentlyDisplayedInFrame() const | 589 bool DOMWindow::isCurrentlyDisplayedInFrame() const |
| 600 { | 590 { |
| 601 return m_frame && m_frame->domWindow() == this && m_frame->host(); | 591 return m_frame && m_frame->domWindow() == this && m_frame->host(); |
| 602 } | 592 } |
| 603 | 593 |
| 604 int DOMWindow::orientation() const | 594 int DOMWindow::orientation() const |
| 605 { | 595 { |
| 606 ASSERT(RuntimeEnabledFeatures::orientationEventEnabled()); | 596 ASSERT(RuntimeEnabledFeatures::orientationEventEnabled()); |
| (...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1878 visitor->trace(m_media); | 1868 visitor->trace(m_media); |
| 1879 visitor->trace(m_sessionStorage); | 1869 visitor->trace(m_sessionStorage); |
| 1880 visitor->trace(m_localStorage); | 1870 visitor->trace(m_localStorage); |
| 1881 visitor->trace(m_applicationCache); | 1871 visitor->trace(m_applicationCache); |
| 1882 visitor->trace(m_performance); | 1872 visitor->trace(m_performance); |
| 1883 visitor->trace(m_css); | 1873 visitor->trace(m_css); |
| 1884 WillBeHeapSupplementable<DOMWindow>::trace(visitor); | 1874 WillBeHeapSupplementable<DOMWindow>::trace(visitor); |
| 1885 } | 1875 } |
| 1886 | 1876 |
| 1887 } // namespace WebCore | 1877 } // namespace WebCore |
| OLD | NEW |