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

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

Issue 410223003: location.reload() after POST should re-POST (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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
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 799 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 if (formData) { 810 if (formData) {
811 request.setHTTPMethod("POST"); 811 request.setHTTPMethod("POST");
812 request.setHTTPBody(formData); 812 request.setHTTPBody(formData);
813 request.setHTTPContentType(item->formContentType()); 813 request.setHTTPContentType(item->formContentType());
814 RefPtr<SecurityOrigin> securityOrigin = SecurityOrigin::createFromString (item->referrer().referrer); 814 RefPtr<SecurityOrigin> securityOrigin = SecurityOrigin::createFromString (item->referrer().referrer);
815 request.addHTTPOriginIfNeeded(securityOrigin->toAtomicString()); 815 request.addHTTPOriginIfNeeded(securityOrigin->toAtomicString());
816 } 816 }
817 return request; 817 return request;
818 } 818 }
819 819
820 void FrameLoader::reload(ReloadPolicy reloadPolicy, const KURL& overrideURL, con st AtomicString& overrideEncoding) 820 void FrameLoader::reload(ReloadPolicy reloadPolicy, const KURL& overrideURL, con st AtomicString& overrideEncoding, ClientRedirectPolicy clientRedirectPolicy)
821 { 821 {
822 if (!m_currentItem) 822 if (!m_currentItem)
823 return; 823 return;
824 824
825 ResourceRequestCachePolicy cachePolicy = reloadPolicy == EndToEndReload ? Re loadBypassingCache : ReloadIgnoringCacheData; 825 ResourceRequestCachePolicy cachePolicy = reloadPolicy == EndToEndReload ? Re loadBypassingCache : ReloadIgnoringCacheData;
826 ResourceRequest request = requestFromHistoryItem(m_currentItem.get(), cacheP olicy); 826 ResourceRequest request = requestFromHistoryItem(m_currentItem.get(), cacheP olicy);
827 request.setFrameType(m_frame->isMainFrame() ? WebURLRequest::FrameTypeTopLev el : WebURLRequest::FrameTypeNested); 827 request.setFrameType(m_frame->isMainFrame() ? WebURLRequest::FrameTypeTopLev el : WebURLRequest::FrameTypeNested);
828 request.setRequestContext(WebURLRequest::RequestContextInternal); 828 request.setRequestContext(WebURLRequest::RequestContextInternal);
829
830 if (clientRedirectPolicy == ClientRedirect)
Nate Chapin 2014/07/28 20:05:04 This effectively makes the policy: Use m_currenIte
abarth-chromium 2014/07/29 16:58:40 Sure
831 request.setHTTPReferrer(Referrer(m_frame->document()->outgoingReferrer() , m_frame->document()->referrerPolicy()));
829 if (!overrideURL.isEmpty()) { 832 if (!overrideURL.isEmpty()) {
830 request.setURL(overrideURL); 833 request.setURL(overrideURL);
831 request.clearHTTPReferrer(); 834 request.clearHTTPReferrer();
832 } 835 }
833 836
834 FrameLoadType type = reloadPolicy == EndToEndReload ? FrameLoadTypeReloadFro mOrigin : FrameLoadTypeReload; 837 FrameLoadType type = reloadPolicy == EndToEndReload ? FrameLoadTypeReloadFro mOrigin : FrameLoadTypeReload;
835 loadWithNavigationAction(NavigationAction(request, type), type, nullptr, Sub stituteData(), CheckContentSecurityPolicy, NotClientRedirect, overrideEncoding); 838 loadWithNavigationAction(NavigationAction(request, type), type, nullptr, Sub stituteData(), CheckContentSecurityPolicy, clientRedirectPolicy, overrideEncodin g);
836 } 839 }
837 840
838 void FrameLoader::stopAllLoaders() 841 void FrameLoader::stopAllLoaders()
839 { 842 {
840 if (m_frame->document()->pageDismissalEventBeingDispatched() != Document::No Dismissal) 843 if (m_frame->document()->pageDismissalEventBeingDispatched() != Document::No Dismissal)
841 return; 844 return;
842 845
843 // If this method is called from within this method, infinite recursion can occur (3442218). Avoid this. 846 // If this method is called from within this method, infinite recursion can occur (3442218). Avoid this.
844 if (m_inStopAllLoaders) 847 if (m_inStopAllLoaders)
845 return; 848 return;
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after
1515 // FIXME: We need a way to propagate sandbox flags to out-of-process frames. 1518 // FIXME: We need a way to propagate sandbox flags to out-of-process frames.
1516 Frame* parentFrame = m_frame->tree().parent(); 1519 Frame* parentFrame = m_frame->tree().parent();
1517 if (parentFrame && parentFrame->isLocalFrame()) 1520 if (parentFrame && parentFrame->isLocalFrame())
1518 flags |= toLocalFrame(parentFrame)->document()->sandboxFlags(); 1521 flags |= toLocalFrame(parentFrame)->document()->sandboxFlags();
1519 if (FrameOwner* frameOwner = m_frame->owner()) 1522 if (FrameOwner* frameOwner = m_frame->owner())
1520 flags |= frameOwner->sandboxFlags(); 1523 flags |= frameOwner->sandboxFlags();
1521 return flags; 1524 return flags;
1522 } 1525 }
1523 1526
1524 } // namespace blink 1527 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698