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

Side by Side Diff: third_party/WebKit/Source/core/loader/FrameLoader.cpp

Issue 2769263004: Remove Frame::host() method (Closed)
Patch Set: Created 3 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 4 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
5 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 5 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
6 * (http://www.torchmobile.com/) 6 * (http://www.torchmobile.com/)
7 * Copyright (C) 2008 Alp Toker <alp@atoker.com> 7 * Copyright (C) 2008 Alp Toker <alp@atoker.com>
8 * Copyright (C) Research In Motion Limited 2009. All rights reserved. 8 * Copyright (C) Research In Motion Limited 2009. All rights reserved.
9 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> 9 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com>
10 * Copyright (C) 2011 Google Inc. All rights reserved. 10 * Copyright (C) 2011 Google Inc. All rights reserved.
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after
753 HistoryLoadType historyLoadType, 753 HistoryLoadType historyLoadType,
754 ClientRedirectPolicy clientRedirect, 754 ClientRedirectPolicy clientRedirect,
755 Document* initiatingDocument) { 755 Document* initiatingDocument) {
756 // If we have a state object, we cannot also be a new navigation. 756 // If we have a state object, we cannot also be a new navigation.
757 DCHECK(!stateObject || frameLoadType == FrameLoadTypeBackForward); 757 DCHECK(!stateObject || frameLoadType == FrameLoadTypeBackForward);
758 758
759 // If we have a provisional request for a different document, a fragment 759 // If we have a provisional request for a different document, a fragment
760 // scroll should cancel it. 760 // scroll should cancel it.
761 detachDocumentLoader(m_provisionalDocumentLoader); 761 detachDocumentLoader(m_provisionalDocumentLoader);
762 762
763 if (!m_frame->host()) 763 if (!m_frame->page())
764 return; 764 return;
765 saveScrollState(); 765 saveScrollState();
766 766
767 KURL oldURL = m_frame->document()->url(); 767 KURL oldURL = m_frame->document()->url();
768 bool hashChange = equalIgnoringFragmentIdentifier(url, oldURL) && 768 bool hashChange = equalIgnoringFragmentIdentifier(url, oldURL) &&
769 url.fragmentIdentifier() != oldURL.fragmentIdentifier(); 769 url.fragmentIdentifier() != oldURL.fragmentIdentifier();
770 if (hashChange) { 770 if (hashChange) {
771 // If we were in the autoscroll/middleClickAutoscroll mode we want to stop 771 // If we were in the autoscroll/middleClickAutoscroll mode we want to stop
772 // it before following the link to the anchor 772 // it before following the link to the anchor
773 m_frame->eventHandler().stopAutoscroll(); 773 m_frame->eventHandler().stopAutoscroll();
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after
1642 1642
1643 // For PlzNavigate placeholder DocumentLoaders, don't send failure callbacks 1643 // For PlzNavigate placeholder DocumentLoaders, don't send failure callbacks
1644 // for a placeholder simply being replaced with a new DocumentLoader. 1644 // for a placeholder simply being replaced with a new DocumentLoader.
1645 if (hadPlaceholderClientDocumentLoader) 1645 if (hadPlaceholderClientDocumentLoader)
1646 m_provisionalDocumentLoader->setSentDidFinishLoad(); 1646 m_provisionalDocumentLoader->setSentDidFinishLoad();
1647 m_frame->document()->cancelParsing(); 1647 m_frame->document()->cancelParsing();
1648 detachDocumentLoader(m_provisionalDocumentLoader); 1648 detachDocumentLoader(m_provisionalDocumentLoader);
1649 1649
1650 // beforeunload fired above, and detaching a DocumentLoader can fire events, 1650 // beforeunload fired above, and detaching a DocumentLoader can fire events,
1651 // which can detach this frame. 1651 // which can detach this frame.
1652 if (!m_frame->host()) 1652 if (!m_frame->page())
1653 return; 1653 return;
1654 1654
1655 m_progressTracker->progressStarted(type); 1655 m_progressTracker->progressStarted(type);
1656 // TODO(japhet): This case wants to flag the frame as loading and do nothing 1656 // TODO(japhet): This case wants to flag the frame as loading and do nothing
1657 // else. It'd be nice if it could go through the placeholder DocumentLoader 1657 // else. It'd be nice if it could go through the placeholder DocumentLoader
1658 // path, too. 1658 // path, too.
1659 if (navigationPolicy == NavigationPolicyHandledByClientForInitialHistory) 1659 if (navigationPolicy == NavigationPolicyHandledByClientForInitialHistory)
1660 return; 1660 return;
1661 DCHECK(navigationPolicy == NavigationPolicyCurrentTab || 1661 DCHECK(navigationPolicy == NavigationPolicyCurrentTab ||
1662 navigationPolicy == NavigationPolicyHandledByClient); 1662 navigationPolicy == NavigationPolicyHandledByClient);
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
1902 frameLoadRequest.clientRedirect()); 1902 frameLoadRequest.clientRedirect());
1903 1903
1904 loader->setLoadType(loadType); 1904 loader->setLoadType(loadType);
1905 loader->setNavigationType(navigationType); 1905 loader->setNavigationType(navigationType);
1906 loader->setReplacesCurrentHistoryItem(loadType == 1906 loader->setReplacesCurrentHistoryItem(loadType ==
1907 FrameLoadTypeReplaceCurrentItem); 1907 FrameLoadTypeReplaceCurrentItem);
1908 return loader; 1908 return loader;
1909 } 1909 }
1910 1910
1911 } // namespace blink 1911 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698