Index: third_party/WebKit/Source/core/fetch/Resource.cpp |
diff --git a/third_party/WebKit/Source/core/fetch/Resource.cpp b/third_party/WebKit/Source/core/fetch/Resource.cpp |
index 968fa5594a8f3b4cbf8a0794991f4cf11be0ad59..adf843dd7e9831f464f8fd72224979f566c5ea9f 100644 |
--- a/third_party/WebKit/Source/core/fetch/Resource.cpp |
+++ b/third_party/WebKit/Source/core/fetch/Resource.cpp |
@@ -39,6 +39,7 @@ |
#include "platform/network/HTTPParsers.h" |
#include "platform/weborigin/KURL.h" |
#include "public/platform/Platform.h" |
+#include "public/platform/WebCachePolicy.h" |
#include "public/platform/WebScheduler.h" |
#include "public/platform/WebSecurityOrigin.h" |
#include "wtf/CurrentTime.h" |
@@ -294,8 +295,7 @@ void Resource::ResourceCallback::runTask() |
} |
Resource::Resource(const ResourceRequest& request, Type type, const ResourceLoaderOptions& options) |
- : m_resourceRequest(request) |
- , m_loadFinishTime(0) |
+ : m_loadFinishTime(0) |
, m_identifier(0) |
, m_encodedSize(0) |
, m_decodedSize(0) |
@@ -312,6 +312,7 @@ Resource::Resource(const ResourceRequest& request, Type type, const ResourceLoad |
, m_options(options) |
, m_responseTimestamp(currentTime()) |
, m_cancelTimer(this, &Resource::cancelTimerFired) |
+ , m_resourceRequest(request) |
{ |
ASSERT(m_type == unsigned(type)); // m_type is a bitfield, so this tests careless updates of the enum. |
InstanceCounters::incrementCounter(InstanceCounters::ResourceCounter); |
@@ -900,6 +901,16 @@ String Resource::getMemoryDumpName() const |
return String::format("web_cache/%s_resources/%ld", resourceTypeToString(getType(), options().initiatorInfo), m_identifier); |
} |
+void Resource::setCachePolicyBypassingCache() |
+{ |
+ m_resourceRequest.setCachePolicy(WebCachePolicy::BypassingCache); |
+} |
+ |
+void Resource::setLoFiStateOff() |
+{ |
+ m_resourceRequest.setLoFiState(WebURLRequest::LoFiOff); |
+} |
+ |
void Resource::revalidationSucceeded(const ResourceResponse& validatingResponse) |
{ |
SECURITY_CHECK(m_redirectChain.isEmpty()); |