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 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 | 500 |
501 ResourceRequestCachePolicy CachedResourceLoader::resourceRequestCachePolicy(cons
t ResourceRequest& request, CachedResource::Type type) | 501 ResourceRequestCachePolicy CachedResourceLoader::resourceRequestCachePolicy(cons
t ResourceRequest& request, CachedResource::Type type) |
502 { | 502 { |
503 if (type == CachedResource::MainResource) { | 503 if (type == CachedResource::MainResource) { |
504 FrameLoadType frameLoadType = frame()->loader()->loadType(); | 504 FrameLoadType frameLoadType = frame()->loader()->loadType(); |
505 bool isReload = frameLoadType == FrameLoadTypeReload || frameLoadType ==
FrameLoadTypeReloadFromOrigin; | 505 bool isReload = frameLoadType == FrameLoadTypeReload || frameLoadType ==
FrameLoadTypeReloadFromOrigin; |
506 if (request.httpMethod() == "POST" && (isReload || frameLoadType == Fram
eLoadTypeBackForward)) | 506 if (request.httpMethod() == "POST" && (isReload || frameLoadType == Fram
eLoadTypeBackForward)) |
507 return ReturnCacheDataDontLoad; | 507 return ReturnCacheDataDontLoad; |
508 if (!m_documentLoader->overrideEncoding().isEmpty() || frameLoadType ==
FrameLoadTypeBackForward) | 508 if (!m_documentLoader->overrideEncoding().isEmpty() || frameLoadType ==
FrameLoadTypeBackForward) |
509 return ReturnCacheDataElseLoad; | 509 return ReturnCacheDataElseLoad; |
510 if (isReload || request.isConditional()) | 510 if (isReload || frameLoadType == FrameLoadTypeSame || request.isConditio
nal()) |
511 return ReloadIgnoringCacheData; | 511 return ReloadIgnoringCacheData; |
512 return UseProtocolCachePolicy; | 512 return UseProtocolCachePolicy; |
513 } | 513 } |
514 | 514 |
515 if (request.isConditional()) | 515 if (request.isConditional()) |
516 return ReloadIgnoringCacheData; | 516 return ReloadIgnoringCacheData; |
517 | 517 |
518 if (m_documentLoader->isLoadingInAPISense()) { | 518 if (m_documentLoader->isLoadingInAPISense()) { |
519 // For POST requests, we mutate the main resource's cache policy to avoi
d form resubmission. | 519 // For POST requests, we mutate the main resource's cache policy to avoi
d form resubmission. |
520 // This policy should not be inherited by subresources. | 520 // This policy should not be inherited by subresources. |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1040 info.ignoreMember(m_initiatorMap); | 1040 info.ignoreMember(m_initiatorMap); |
1041 } | 1041 } |
1042 | 1042 |
1043 const ResourceLoaderOptions& CachedResourceLoader::defaultCachedResourceOptions(
) | 1043 const ResourceLoaderOptions& CachedResourceLoader::defaultCachedResourceOptions(
) |
1044 { | 1044 { |
1045 static ResourceLoaderOptions options(SendCallbacks, SniffContent, BufferData
, AllowStoredCredentials, AskClientForCrossOriginCredentials, DoSecurityCheck); | 1045 static ResourceLoaderOptions options(SendCallbacks, SniffContent, BufferData
, AllowStoredCredentials, AskClientForCrossOriginCredentials, DoSecurityCheck); |
1046 return options; | 1046 return options; |
1047 } | 1047 } |
1048 | 1048 |
1049 } | 1049 } |
OLD | NEW |