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

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

Issue 1846733004: Rename IgnoringCacheData to ValidatingCacheData (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git cl format Created 4 years, 8 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 reserv ed. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com>
6 * Copyright (C) Research In Motion Limited 2009. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2009. All rights reserved.
7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> 7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com>
8 * Copyright (C) 2011 Google Inc. All rights reserved. 8 * Copyright (C) 2011 Google Inc. All rights reserved.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 RefPtr<SecurityOrigin> securityOrigin = SecurityOrigin::createFromString (item->referrer().referrer); 129 RefPtr<SecurityOrigin> securityOrigin = SecurityOrigin::createFromString (item->referrer().referrer);
130 request.addHTTPOriginIfNeeded(securityOrigin); 130 request.addHTTPOriginIfNeeded(securityOrigin);
131 } 131 }
132 return request; 132 return request;
133 } 133 }
134 134
135 ResourceRequest FrameLoader::resourceRequestForReload(FrameLoadType frameLoadTyp e, 135 ResourceRequest FrameLoader::resourceRequestForReload(FrameLoadType frameLoadTyp e,
136 const KURL& overrideURL, ClientRedirectPolicy clientRedirectPolicy) 136 const KURL& overrideURL, ClientRedirectPolicy clientRedirectPolicy)
137 { 137 {
138 ASSERT(frameLoadType == FrameLoadTypeReload || frameLoadType == FrameLoadTyp eReloadFromOrigin); 138 ASSERT(frameLoadType == FrameLoadTypeReload || frameLoadType == FrameLoadTyp eReloadFromOrigin);
139 ResourceRequestCachePolicy cachePolicy = frameLoadType == FrameLoadTypeReloa dFromOrigin ? 139 ResourceRequestCachePolicy cachePolicy = frameLoadType == FrameLoadTypeReloa dFromOrigin ? BypassingCache : ValidatingCacheData;
140 ReloadBypassingCache : ReloadIgnoringCacheData;
141 if (!m_currentItem) 140 if (!m_currentItem)
142 return ResourceRequest(); 141 return ResourceRequest();
143 ResourceRequest request = resourceRequestFromHistoryItem(m_currentItem.get() , cachePolicy); 142 ResourceRequest request = resourceRequestFromHistoryItem(m_currentItem.get() , cachePolicy);
144 143
145 // ClientRedirectPolicy is an indication that this load was triggered by 144 // ClientRedirectPolicy is an indication that this load was triggered by
146 // some direct interaction with the page. If this reload is not a client 145 // some direct interaction with the page. If this reload is not a client
147 // redirect, we should reuse the referrer from the original load of the 146 // redirect, we should reuse the referrer from the original load of the
148 // current document. If this reload is a client redirect (e.g., location.rel oad()), 147 // current document. If this reload is a client redirect (e.g., location.rel oad()),
149 // it was initiated by something in the current document and should 148 // it was initiated by something in the current document and should
150 // therefore show the current document's url as the referrer. 149 // therefore show the current document's url as the referrer.
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 } 766 }
768 767
769 FrameLoadType FrameLoader::determineFrameLoadType(const FrameLoadRequest& reques t) 768 FrameLoadType FrameLoader::determineFrameLoadType(const FrameLoadRequest& reques t)
770 { 769 {
771 if (m_frame->tree().parent() && !m_stateMachine.committedFirstRealDocumentLo ad()) 770 if (m_frame->tree().parent() && !m_stateMachine.committedFirstRealDocumentLo ad())
772 return FrameLoadTypeInitialInChildFrame; 771 return FrameLoadTypeInitialInChildFrame;
773 if (!m_frame->tree().parent() && !client()->backForwardLength()) 772 if (!m_frame->tree().parent() && !client()->backForwardLength())
774 return FrameLoadTypeStandard; 773 return FrameLoadTypeStandard;
775 if (m_provisionalDocumentLoader && request.substituteData().failingURL() == m_provisionalDocumentLoader->url() && m_loadType == FrameLoadTypeBackForward) 774 if (m_provisionalDocumentLoader && request.substituteData().failingURL() == m_provisionalDocumentLoader->url() && m_loadType == FrameLoadTypeBackForward)
776 return FrameLoadTypeBackForward; 775 return FrameLoadTypeBackForward;
777 if (request.resourceRequest().getCachePolicy() == ReloadIgnoringCacheData) 776 if (request.resourceRequest().getCachePolicy() == ValidatingCacheData)
778 return FrameLoadTypeReload; 777 return FrameLoadTypeReload;
779 if (request.resourceRequest().getCachePolicy() == ReloadBypassingCache) 778 if (request.resourceRequest().getCachePolicy() == BypassingCache)
780 return FrameLoadTypeReloadFromOrigin; 779 return FrameLoadTypeReloadFromOrigin;
781 // From the HTML5 spec for location.assign(): 780 // From the HTML5 spec for location.assign():
782 // "If the browsing context's session history contains only one Document, 781 // "If the browsing context's session history contains only one Document,
783 // and that was the about:blank Document created when the browsing context 782 // and that was the about:blank Document created when the browsing context
784 // was created, then the navigation must be done with replacement enabled. " 783 // was created, then the navigation must be done with replacement enabled. "
785 if (request.replacesCurrentItem() 784 if (request.replacesCurrentItem()
786 || (!m_stateMachine.committedMultipleRealLoads() 785 || (!m_stateMachine.committedMultipleRealLoads()
787 && equalIgnoringCase(m_frame->document()->url(), blankURL()))) 786 && equalIgnoringCase(m_frame->document()->url(), blankURL())))
788 return FrameLoadTypeReplaceCurrentItem; 787 return FrameLoadTypeReplaceCurrentItem;
789 788
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after
1585 // FIXME: We need a way to propagate insecure requests policy flags to 1584 // FIXME: We need a way to propagate insecure requests policy flags to
1586 // out-of-process frames. For now, we'll always use default behavior. 1585 // out-of-process frames. For now, we'll always use default behavior.
1587 if (!parentFrame->isLocalFrame()) 1586 if (!parentFrame->isLocalFrame())
1588 return nullptr; 1587 return nullptr;
1589 1588
1590 ASSERT(toLocalFrame(parentFrame)->document()); 1589 ASSERT(toLocalFrame(parentFrame)->document());
1591 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ; 1590 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ;
1592 } 1591 }
1593 1592
1594 } // namespace blink 1593 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp ('k') | third_party/WebKit/Source/core/loader/ImageLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698