| OLD | NEW |
| 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 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 void ResourceFetcher::determineTargetType(ResourceRequest& request, Resource::Ty
pe type) | 762 void ResourceFetcher::determineTargetType(ResourceRequest& request, Resource::Ty
pe type) |
| 763 { | 763 { |
| 764 ResourceRequest::TargetType targetType = requestTargetType(this, request, ty
pe); | 764 ResourceRequest::TargetType targetType = requestTargetType(this, request, ty
pe); |
| 765 request.setTargetType(targetType); | 765 request.setTargetType(targetType); |
| 766 } | 766 } |
| 767 | 767 |
| 768 ResourceRequestCachePolicy ResourceFetcher::resourceRequestCachePolicy(const Res
ourceRequest& request, Resource::Type type) | 768 ResourceRequestCachePolicy ResourceFetcher::resourceRequestCachePolicy(const Res
ourceRequest& request, Resource::Type type) |
| 769 { | 769 { |
| 770 if (type == Resource::MainResource) { | 770 if (type == Resource::MainResource) { |
| 771 FrameLoadType frameLoadType = frame()->loader().loadType(); | 771 FrameLoadType frameLoadType = frame()->loader().loadType(); |
| 772 bool isReload = frameLoadType == FrameLoadTypeReload || frameLoadType ==
FrameLoadTypeReloadFromOrigin; | |
| 773 if (request.httpMethod() == "POST" && frameLoadType == FrameLoadTypeBack
Forward) | 772 if (request.httpMethod() == "POST" && frameLoadType == FrameLoadTypeBack
Forward) |
| 774 return ReturnCacheDataDontLoad; | 773 return ReturnCacheDataDontLoad; |
| 775 if (!m_documentLoader->overrideEncoding().isEmpty() || frameLoadType ==
FrameLoadTypeBackForward) | 774 if (!m_documentLoader->overrideEncoding().isEmpty() || frameLoadType ==
FrameLoadTypeBackForward) |
| 776 return ReturnCacheDataElseLoad; | 775 return ReturnCacheDataElseLoad; |
| 777 if (isReload || frameLoadType == FrameLoadTypeSame || request.isConditio
nal() || request.httpMethod() == "POST") | 776 if (frameLoadType == FrameLoadTypeReloadFromOrigin) |
| 777 return ReloadBypassingCache; |
| 778 if (frameLoadType == FrameLoadTypeReload || frameLoadType == FrameLoadTy
peSame || request.isConditional() || request.httpMethod() == "POST") |
| 778 return ReloadIgnoringCacheData; | 779 return ReloadIgnoringCacheData; |
| 779 Frame* parent = frame()->tree().parent(); | 780 Frame* parent = frame()->tree().parent(); |
| 780 if (parent && parent->isLocalFrame()) | 781 if (parent && parent->isLocalFrame()) |
| 781 return toLocalFrame(parent)->document()->fetcher()->resourceRequestC
achePolicy(request, type); | 782 return toLocalFrame(parent)->document()->fetcher()->resourceRequestC
achePolicy(request, type); |
| 782 return UseProtocolCachePolicy; | 783 return UseProtocolCachePolicy; |
| 783 } | 784 } |
| 784 | 785 |
| 785 if (request.isConditional()) | 786 if (request.isConditional()) |
| 786 return ReloadIgnoringCacheData; | 787 return ReloadIgnoringCacheData; |
| 787 | 788 |
| (...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1463 } | 1464 } |
| 1464 } | 1465 } |
| 1465 | 1466 |
| 1466 void ResourceFetcher::trace(Visitor* visitor) | 1467 void ResourceFetcher::trace(Visitor* visitor) |
| 1467 { | 1468 { |
| 1468 visitor->trace(m_document); | 1469 visitor->trace(m_document); |
| 1469 ResourceLoaderHost::trace(visitor); | 1470 ResourceLoaderHost::trace(visitor); |
| 1470 } | 1471 } |
| 1471 | 1472 |
| 1472 } | 1473 } |
| OLD | NEW |