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

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

Issue 2437783002: DevTools Disable cache should properly handle LoadOnlyFromCache resources (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5ba7721a6d89a7aac96383f1d2aba363ad39933e..3c7f778ce95beb32d80f6ef3c2cd48bc554d1a0a 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorNetworkAgent.cpp
@@ -511,6 +511,11 @@ 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)
@@ -630,6 +635,10 @@ void InspectorNetworkAgent::willSendRequest(
request.setReportRawHeaders(true);
if (m_state->booleanProperty(NetworkAgentState::cacheDisabled, false)) {
+ // It shouldn't be a ReturnCacheDataDontLoad request as those are blocked
+ // in shouldBlockRequest.
+ DCHECK_NE(WebCachePolicy::ReturnCacheDataDontLoad,
+ request.getCachePolicy());
request.setCachePolicy(WebCachePolicy::BypassingCache);
request.setShouldResetAppCache(true);
}
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698