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

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

Issue 2772753002: Change FrameLoadTypeReload to take FrameLoadTypeReloadMainResource's behavior (Closed)
Patch Set: remove Reload 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 namespace blink { 106 namespace blink {
107 107
108 using namespace HTMLNames; 108 using namespace HTMLNames;
109 109
110 bool isBackForwardLoadType(FrameLoadType type) { 110 bool isBackForwardLoadType(FrameLoadType type) {
111 return type == FrameLoadTypeBackForward || 111 return type == FrameLoadTypeBackForward ||
112 type == FrameLoadTypeInitialHistoryLoad; 112 type == FrameLoadTypeInitialHistoryLoad;
113 } 113 }
114 114
115 bool isReloadLoadType(FrameLoadType type) { 115 bool isReloadLoadType(FrameLoadType type) {
116 return type == FrameLoadTypeReload || 116 return type == FrameLoadTypeReloadMainResource ||
117 type == FrameLoadTypeReloadMainResource ||
118 type == FrameLoadTypeReloadBypassingCache; 117 type == FrameLoadTypeReloadBypassingCache;
119 } 118 }
120 119
121 static bool needsHistoryItemRestore(FrameLoadType type) { 120 static bool needsHistoryItemRestore(FrameLoadType type) {
122 // FrameLoadtypeInitialHistoryLoad is intentionally excluded. 121 // FrameLoadtypeInitialHistoryLoad is intentionally excluded.
123 return type == FrameLoadTypeBackForward || isReloadLoadType(type); 122 return type == FrameLoadTypeBackForward || isReloadLoadType(type);
124 } 123 }
125 124
126 static void checkForLegacyProtocolInSubresource( 125 static void checkForLegacyProtocolInSubresource(
127 const ResourceRequest& resourceRequest, 126 const ResourceRequest& resourceRequest,
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 return FrameLoadTypeInitialInChildFrame; 827 return FrameLoadTypeInitialInChildFrame;
829 if (!m_frame->tree().parent() && !client()->backForwardLength()) 828 if (!m_frame->tree().parent() && !client()->backForwardLength())
830 return FrameLoadTypeStandard; 829 return FrameLoadTypeStandard;
831 if (m_provisionalDocumentLoader && 830 if (m_provisionalDocumentLoader &&
832 request.substituteData().failingURL() == 831 request.substituteData().failingURL() ==
833 m_provisionalDocumentLoader->url() && 832 m_provisionalDocumentLoader->url() &&
834 m_provisionalDocumentLoader->loadType() == FrameLoadTypeBackForward) 833 m_provisionalDocumentLoader->loadType() == FrameLoadTypeBackForward)
835 return FrameLoadTypeBackForward; 834 return FrameLoadTypeBackForward;
836 if (request.resourceRequest().getCachePolicy() == 835 if (request.resourceRequest().getCachePolicy() ==
837 WebCachePolicy::ValidatingCacheData) 836 WebCachePolicy::ValidatingCacheData)
838 return FrameLoadTypeReload; 837 return FrameLoadTypeReloadMainResource;
Takashi Toyoshima 2017/03/23 08:45:42 non-mechanical. I think reviewers can review this
839 if (request.resourceRequest().getCachePolicy() == 838 if (request.resourceRequest().getCachePolicy() ==
840 WebCachePolicy::BypassingCache) 839 WebCachePolicy::BypassingCache)
841 return FrameLoadTypeReloadBypassingCache; 840 return FrameLoadTypeReloadBypassingCache;
842 // From the HTML5 spec for location.assign(): 841 // From the HTML5 spec for location.assign():
843 // "If the browsing context's session history contains only one Document, 842 // "If the browsing context's session history contains only one Document,
844 // and that was the about:blank Document created when the browsing context 843 // and that was the about:blank Document created when the browsing context
845 // was created, then the navigation must be done with replacement enabled." 844 // was created, then the navigation must be done with replacement enabled."
846 if (request.replacesCurrentItem() || 845 if (request.replacesCurrentItem() ||
847 (!m_stateMachine.committedMultipleRealLoads() && 846 (!m_stateMachine.committedMultipleRealLoads() &&
848 equalIgnoringCase(m_frame->document()->url(), blankURL()))) 847 equalIgnoringCase(m_frame->document()->url(), blankURL())))
849 return FrameLoadTypeReplaceCurrentItem; 848 return FrameLoadTypeReplaceCurrentItem;
850 849
851 if (request.resourceRequest().url() == m_documentLoader->urlForHistory()) { 850 if (request.resourceRequest().url() == m_documentLoader->urlForHistory()) {
852 if (request.resourceRequest().httpMethod() == HTTPNames::POST) 851 if (request.resourceRequest().httpMethod() == HTTPNames::POST)
853 return FrameLoadTypeStandard; 852 return FrameLoadTypeStandard;
854 if (!request.originDocument()) 853 if (!request.originDocument())
855 return FrameLoadTypeReloadMainResource; 854 return FrameLoadTypeReloadMainResource;
856 return FrameLoadTypeReplaceCurrentItem; 855 return FrameLoadTypeReplaceCurrentItem;
857 } 856 }
858 857
859 if (request.substituteData().failingURL() == 858 if (request.substituteData().failingURL() ==
860 m_documentLoader->urlForHistory() && 859 m_documentLoader->urlForHistory() &&
861 m_documentLoader->loadType() == FrameLoadTypeReload) 860 m_documentLoader->loadType() == FrameLoadTypeReloadMainResource)
Takashi Toyoshima 2017/03/23 08:45:42 non-mechanical. I think reviewers can review this
862 return FrameLoadTypeReload; 861 return FrameLoadTypeReloadMainResource;
863 862
864 if (m_frame->settings()->getHistoryEntryRequiresUserGesture() && 863 if (m_frame->settings()->getHistoryEntryRequiresUserGesture() &&
865 request.originDocument() && 864 request.originDocument() &&
866 !request.originDocument()->frame()->hasReceivedUserGesture()) 865 !request.originDocument()->frame()->hasReceivedUserGesture())
867 return FrameLoadTypeReplaceCurrentItem; 866 return FrameLoadTypeReplaceCurrentItem;
868 867
869 return FrameLoadTypeStandard; 868 return FrameLoadTypeStandard;
870 } 869 }
871 870
872 bool FrameLoader::prepareRequestForThisFrame(FrameLoadRequest& request) { 871 bool FrameLoader::prepareRequestForThisFrame(FrameLoadRequest& request) {
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after
1902 frameLoadRequest.clientRedirect()); 1901 frameLoadRequest.clientRedirect());
1903 1902
1904 loader->setLoadType(loadType); 1903 loader->setLoadType(loadType);
1905 loader->setNavigationType(navigationType); 1904 loader->setNavigationType(navigationType);
1906 loader->setReplacesCurrentHistoryItem(loadType == 1905 loader->setReplacesCurrentHistoryItem(loadType ==
1907 FrameLoadTypeReplaceCurrentItem); 1906 FrameLoadTypeReplaceCurrentItem);
1908 return loader; 1907 return loader;
1909 } 1908 }
1910 1909
1911 } // namespace blink 1910 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698