diff options
author | Ben Kelly <ben@wanderview.com> | 2018-03-01 07:37:31 -0800 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-03-14 12:33:47 +0100 |
commit | 2d689a1bc3454e42a241724ad72007a5ee215742 (patch) | |
tree | 038bcba0d375994bbfe6d23934a56e652ef756f9 /netwerk | |
parent | 8bd0f36bf1604dcf757b0941e5a61c4decf11511 (diff) | |
download | UXP-2d689a1bc3454e42a241724ad72007a5ee215742.tar UXP-2d689a1bc3454e42a241724ad72007a5ee215742.tar.gz UXP-2d689a1bc3454e42a241724ad72007a5ee215742.tar.lz UXP-2d689a1bc3454e42a241724ad72007a5ee215742.tar.xz UXP-2d689a1bc3454e42a241724ad72007a5ee215742.zip |
Bug 1440775 - Make fetch API force-cache and only-if-cached use VALIDATE_NEVER instead of LOAD_FROM_CACHE. r=mayhemer, a=RyanVM
--HG--
extra : source : 60fb09de57ec145923da102f856399d3323f632b
extra : amend_source : b42db87defcc5615773cfa4659af9ff5b9cd4b72
extra : intermediate-source : 599641c7992def734cb352d9413aa51bf0e9793f
extra : histedit_source : 1d42c837225bdf000d3a68bef46a862be87d4044
Diffstat (limited to 'netwerk')
-rw-r--r-- | netwerk/protocol/http/HttpBaseChannel.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/netwerk/protocol/http/HttpBaseChannel.cpp b/netwerk/protocol/http/HttpBaseChannel.cpp index 0ff792280..278c94db0 100644 --- a/netwerk/protocol/http/HttpBaseChannel.cpp +++ b/netwerk/protocol/http/HttpBaseChannel.cpp @@ -2480,9 +2480,9 @@ HttpBaseChannel::GetFetchCacheMode(uint32_t* aFetchCacheMode) *aFetchCacheMode = nsIHttpChannelInternal::FETCH_CACHE_MODE_RELOAD; } else if (mLoadFlags & VALIDATE_ALWAYS) { *aFetchCacheMode = nsIHttpChannelInternal::FETCH_CACHE_MODE_NO_CACHE; - } else if (mLoadFlags & (LOAD_FROM_CACHE | nsICachingChannel::LOAD_ONLY_FROM_CACHE)) { + } else if (mLoadFlags & (VALIDATE_NEVER | nsICachingChannel::LOAD_ONLY_FROM_CACHE)) { *aFetchCacheMode = nsIHttpChannelInternal::FETCH_CACHE_MODE_ONLY_IF_CACHED; - } else if (mLoadFlags & LOAD_FROM_CACHE) { + } else if (mLoadFlags & VALIDATE_NEVER) { *aFetchCacheMode = nsIHttpChannelInternal::FETCH_CACHE_MODE_FORCE_CACHE; } else { *aFetchCacheMode = nsIHttpChannelInternal::FETCH_CACHE_MODE_DEFAULT; @@ -2518,7 +2518,7 @@ HttpBaseChannel::SetFetchCacheMode(uint32_t aFetchCacheMode) break; case nsIHttpChannelInternal::FETCH_CACHE_MODE_FORCE_CACHE: // force-cache means don't validate unless if the response would vary. - mLoadFlags |= LOAD_FROM_CACHE; + mLoadFlags |= VALIDATE_NEVER; break; case nsIHttpChannelInternal::FETCH_CACHE_MODE_ONLY_IF_CACHED: // only-if-cached means only from cache, no network, no validation, generate @@ -2527,7 +2527,7 @@ HttpBaseChannel::SetFetchCacheMode(uint32_t aFetchCacheMode) // the user has things in their cache without any network traffic side // effects) are addressed in the Request constructor which enforces/requires // same-origin request mode. - mLoadFlags |= LOAD_FROM_CACHE | nsICachingChannel::LOAD_ONLY_FROM_CACHE; + mLoadFlags |= VALIDATE_NEVER | nsICachingChannel::LOAD_ONLY_FROM_CACHE; break; } |