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

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp

Issue 2266913002: DevTools Disable cache should properly handle LoadOnlyFromCache resources (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use shouldBlockRequest instead Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp
index 7da58c0f2c09343933a9d7f0a8d50b3d5843ccc7..763327705d99c67d7139773e70dac0d652325716 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp
@@ -467,6 +467,9 @@ DEFINE_TRACE(InspectorNetworkAgent)
bool InspectorNetworkAgent::shouldBlockRequest(const ResourceRequest& request)
{
+ if (m_state->booleanProperty(NetworkAgentState::cacheDisabled, false) && request.getCachePolicy() == WebCachePolicy::ReturnCacheDataDontLoad)
+ return true;
+
protocol::DictionaryValue* blockedURLs = m_state->getObject(NetworkAgentState::blockedURLs);
if (!blockedURLs)
return false;
@@ -550,7 +553,7 @@ void InspectorNetworkAgent::willSendRequest(LocalFrame* frame, unsigned long ide
request.setReportRawHeaders(true);
- if (m_state->booleanProperty(NetworkAgentState::cacheDisabled, false)) {
+ if (m_state->booleanProperty(NetworkAgentState::cacheDisabled, false) && request.getCachePolicy() != WebCachePolicy::ReturnCacheDataDontLoad) {
Nate Chapin 2016/08/23 17:56:48 Can this be reached with policy ReturnCacheDataDon
jkarlin 2016/08/23 18:14:28 Ah, yes, thanks. Done.
request.setCachePolicy(WebCachePolicy::BypassingCache);
request.setShouldResetAppCache(true);
}

Powered by Google App Engine
This is Rietveld 408576698