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

Side by Side Diff: Source/core/fetch/ResourceFetcher.cpp

Issue 22982011: Reland "Fix form resubmissions happening silently." (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de)
3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org)
4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org)
5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ 6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
7 7
8 This library is free software; you can redistribute it and/or 8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public 9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either 10 License as published by the Free Software Foundation; either
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 622
623 ResourceRequestCachePolicy ResourceFetcher::resourceRequestCachePolicy(const Res ourceRequest& request, Resource::Type type) 623 ResourceRequestCachePolicy ResourceFetcher::resourceRequestCachePolicy(const Res ourceRequest& request, Resource::Type type)
624 { 624 {
625 if (type == Resource::MainResource) { 625 if (type == Resource::MainResource) {
626 FrameLoadType frameLoadType = frame()->loader()->loadType(); 626 FrameLoadType frameLoadType = frame()->loader()->loadType();
627 bool isReload = frameLoadType == FrameLoadTypeReload || frameLoadType == FrameLoadTypeReloadFromOrigin; 627 bool isReload = frameLoadType == FrameLoadTypeReload || frameLoadType == FrameLoadTypeReloadFromOrigin;
628 if (request.httpMethod() == "POST" && (isReload || frameLoadType == Fram eLoadTypeBackForward)) 628 if (request.httpMethod() == "POST" && (isReload || frameLoadType == Fram eLoadTypeBackForward))
629 return ReturnCacheDataDontLoad; 629 return ReturnCacheDataDontLoad;
630 if (!m_documentLoader->overrideEncoding().isEmpty() || frameLoadType == FrameLoadTypeBackForward) 630 if (!m_documentLoader->overrideEncoding().isEmpty() || frameLoadType == FrameLoadTypeBackForward)
631 return ReturnCacheDataElseLoad; 631 return ReturnCacheDataElseLoad;
632 if (isReload || frameLoadType == FrameLoadTypeSame || request.isConditio nal()) 632 if (isReload || frameLoadType == FrameLoadTypeSame || request.isConditio nal() || request.httpMethod() == "POST")
633 return ReloadIgnoringCacheData; 633 return ReloadIgnoringCacheData;
634 return UseProtocolCachePolicy; 634 return UseProtocolCachePolicy;
635 } 635 }
636 636
637 if (request.isConditional()) 637 if (request.isConditional())
638 return ReloadIgnoringCacheData; 638 return ReloadIgnoringCacheData;
639 639
640 if (m_documentLoader && m_documentLoader->isLoadingInAPISense()) { 640 if (m_documentLoader && m_documentLoader->isLoadingInAPISense()) {
641 // For POST requests, we mutate the main resource's cache policy to avoi d form resubmission. 641 // For POST requests, we mutate the main resource's cache policy to avoi d form resubmission.
642 // This policy should not be inherited by subresources. 642 // This policy should not be inherited by subresources.
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after
1318 } 1318 }
1319 #endif 1319 #endif
1320 1320
1321 const ResourceLoaderOptions& ResourceFetcher::defaultResourceOptions() 1321 const ResourceLoaderOptions& ResourceFetcher::defaultResourceOptions()
1322 { 1322 {
1323 DEFINE_STATIC_LOCAL(ResourceLoaderOptions, options, (SendCallbacks, SniffCon tent, BufferData, AllowStoredCredentials, ClientRequestedCredentials, AskClientF orCrossOriginCredentials, DoSecurityCheck, CheckContentSecurityPolicy, UseDefaul tOriginRestrictionsForType, DocumentContext)); 1323 DEFINE_STATIC_LOCAL(ResourceLoaderOptions, options, (SendCallbacks, SniffCon tent, BufferData, AllowStoredCredentials, ClientRequestedCredentials, AskClientF orCrossOriginCredentials, DoSecurityCheck, CheckContentSecurityPolicy, UseDefaul tOriginRestrictionsForType, DocumentContext));
1324 return options; 1324 return options;
1325 } 1325 }
1326 1326
1327 } 1327 }
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/history/back-to-post-expected.txt ('k') | Source/core/loader/DocumentLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698