Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(357)

Side by Side Diff: Source/core/page/Page.cpp

Issue 339493002: Remove redundant calls to FrameLoader::frameDetached(). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix layout tests. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/inspector/InspectorOverlay.cpp ('k') | Source/core/svg/graphics/SVGImage.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 visitor->trace(m_dragCaretController); 594 visitor->trace(m_dragCaretController);
595 visitor->trace(m_dragController); 595 visitor->trace(m_dragController);
596 visitor->trace(m_pointerLockController); 596 visitor->trace(m_pointerLockController);
597 visitor->trace(m_multisamplingChangedObservers); 597 visitor->trace(m_multisamplingChangedObservers);
598 visitor->trace(m_frameHost); 598 visitor->trace(m_frameHost);
599 WillBeHeapSupplementable<Page>::trace(visitor); 599 WillBeHeapSupplementable<Page>::trace(visitor);
600 } 600 }
601 601
602 void Page::willBeDestroyed() 602 void Page::willBeDestroyed()
603 { 603 {
604 if (m_mainFrame && m_mainFrame->isLocalFrame())
605 deprecatedLocalMainFrame()->loader().frameDetached();
606
604 // Disable all agents prior to resetting the frame view. 607 // Disable all agents prior to resetting the frame view.
605 m_inspectorController->willBeDestroyed(); 608 m_inspectorController->willBeDestroyed();
606 609
607 if (m_mainFrame->isLocalFrame()) { 610 if (m_mainFrame->isLocalFrame()) {
608 toLocalFrame(m_mainFrame.get())->setView(nullptr); 611 toLocalFrame(m_mainFrame.get())->setView(nullptr);
609 } else { 612 } else {
610 ASSERT(m_mainFrame->isRemoteFrame()); 613 ASSERT(m_mainFrame->isRemoteFrame());
611 toRemoteFrame(m_mainFrame.get())->setView(nullptr); 614 toRemoteFrame(m_mainFrame.get())->setView(nullptr);
612 } 615 }
613 616
614 allPages().remove(this); 617 allPages().remove(this);
615 if (ordinaryPages().contains(this)) 618 if (ordinaryPages().contains(this))
616 ordinaryPages().remove(this); 619 ordinaryPages().remove(this);
617 620
618 for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext() ) {
619 if (frame->isLocalFrame())
620 toLocalFrame(frame)->loader().frameDetached();
621 }
622
623 if (m_scrollingCoordinator) 621 if (m_scrollingCoordinator)
624 m_scrollingCoordinator->willBeDestroyed(); 622 m_scrollingCoordinator->willBeDestroyed();
625 623
626 #ifndef NDEBUG 624 #ifndef NDEBUG
627 pageCounter.decrement(); 625 pageCounter.decrement();
628 #endif 626 #endif
629 627
630 m_chrome->willBeDestroyed(); 628 m_chrome->willBeDestroyed();
631 m_mainFrame.clear(); 629 m_mainFrame.clear();
632 if (m_validationMessageClient) 630 if (m_validationMessageClient)
(...skipping 11 matching lines...) Expand all
644 , spellCheckerClient(0) 642 , spellCheckerClient(0)
645 , storageClient(0) 643 , storageClient(0)
646 { 644 {
647 } 645 }
648 646
649 Page::PageClients::~PageClients() 647 Page::PageClients::~PageClients()
650 { 648 {
651 } 649 }
652 650
653 } // namespace WebCore 651 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorOverlay.cpp ('k') | Source/core/svg/graphics/SVGImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698