| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All R
ights Reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All R
ights Reserved. |
| 3 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 3 * Copyright (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 533 return static_cast<PageLifecycleNotifier&>(LifecycleContext<Page>::lifecycle
Notifier()); | 533 return static_cast<PageLifecycleNotifier&>(LifecycleContext<Page>::lifecycle
Notifier()); |
| 534 } | 534 } |
| 535 | 535 |
| 536 PassOwnPtr<LifecycleNotifier<Page> > Page::createLifecycleNotifier() | 536 PassOwnPtr<LifecycleNotifier<Page> > Page::createLifecycleNotifier() |
| 537 { | 537 { |
| 538 return PageLifecycleNotifier::create(this); | 538 return PageLifecycleNotifier::create(this); |
| 539 } | 539 } |
| 540 | 540 |
| 541 void Page::trace(Visitor* visitor) | 541 void Page::trace(Visitor* visitor) |
| 542 { | 542 { |
| 543 visitor->registerWeakMembers<Page, &Page::clearWeakMembers>(this); | |
| 544 visitor->trace(m_multisamplingChangedObservers); | 543 visitor->trace(m_multisamplingChangedObservers); |
| 545 Supplementable<Page>::trace(visitor); | 544 WillBeHeapSupplementable<Page>::trace(visitor); |
| 546 } | |
| 547 | |
| 548 void Page::clearWeakMembers(Visitor* visitor) | |
| 549 { | |
| 550 #if ENABLE(INPUT_SPEECH) | |
| 551 SpeechInput* input = SpeechInput::from(this); | |
| 552 if (input) | |
| 553 input->clearWeakMembers(visitor); | |
| 554 #endif | |
| 555 } | 545 } |
| 556 | 546 |
| 557 void Page::willBeDestroyed() | 547 void Page::willBeDestroyed() |
| 558 { | 548 { |
| 559 // Disable all agents prior to resetting the frame view. | 549 // Disable all agents prior to resetting the frame view. |
| 560 m_inspectorController->willBeDestroyed(); | 550 m_inspectorController->willBeDestroyed(); |
| 561 | 551 |
| 562 m_mainFrame->setView(nullptr); | 552 m_mainFrame->setView(nullptr); |
| 563 | 553 |
| 564 allPages().remove(this); | 554 allPages().remove(this); |
| 565 if (ordinaryPages().contains(this)) | 555 if (ordinaryPages().contains(this)) |
| 566 ordinaryPages().remove(this); | 556 ordinaryPages().remove(this); |
| 567 | 557 |
| 568 for (LocalFrame* frame = mainFrame(); frame; frame = frame->tree().traverseN
ext()) | 558 for (LocalFrame* frame = mainFrame(); frame; frame = frame->tree().traverseN
ext()) |
| 569 frame->loader().frameDetached(); | 559 frame->loader().frameDetached(); |
| 570 | 560 |
| 571 if (m_scrollingCoordinator) | 561 if (m_scrollingCoordinator) |
| 572 m_scrollingCoordinator->willBeDestroyed(); | 562 m_scrollingCoordinator->willBeDestroyed(); |
| 573 | 563 |
| 574 #ifndef NDEBUG | 564 #ifndef NDEBUG |
| 575 pageCounter.decrement(); | 565 pageCounter.decrement(); |
| 576 #endif | 566 #endif |
| 577 | 567 |
| 578 m_chrome->willBeDestroyed(); | 568 m_chrome->willBeDestroyed(); |
| 579 m_mainFrame.clear(); | 569 m_mainFrame.clear(); |
| 580 if (m_validationMessageClient) | 570 if (m_validationMessageClient) |
| 581 m_validationMessageClient->willBeDestroyed(); | 571 m_validationMessageClient->willBeDestroyed(); |
| 582 Supplementable<Page>::willBeDestroyed(); | 572 WillBeHeapSupplementable<Page>::willBeDestroyed(); |
| 583 } | 573 } |
| 584 | 574 |
| 585 Page::PageClients::PageClients() | 575 Page::PageClients::PageClients() |
| 586 : chromeClient(0) | 576 : chromeClient(0) |
| 587 , contextMenuClient(0) | 577 , contextMenuClient(0) |
| 588 , editorClient(0) | 578 , editorClient(0) |
| 589 , dragClient(0) | 579 , dragClient(0) |
| 590 , inspectorClient(0) | 580 , inspectorClient(0) |
| 591 , backForwardClient(0) | 581 , backForwardClient(0) |
| 592 , spellCheckerClient(0) | 582 , spellCheckerClient(0) |
| 593 , storageClient(0) | 583 , storageClient(0) |
| 594 { | 584 { |
| 595 } | 585 } |
| 596 | 586 |
| 597 Page::PageClients::~PageClients() | 587 Page::PageClients::~PageClients() |
| 598 { | 588 { |
| 599 } | 589 } |
| 600 | 590 |
| 601 } // namespace WebCore | 591 } // namespace WebCore |
| OLD | NEW |