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 da4ad55da5b1c081add729780ce15ac690f786bc..22e0462b45fe97a13f322aa74fae3c4116c4dbcd 100644 |
--- a/third_party/WebKit/Source/core/fetch/Resource.cpp |
+++ b/third_party/WebKit/Source/core/fetch/Resource.cpp |
@@ -30,6 +30,7 @@ |
#include "core/fetch/ResourceClient.h" |
#include "core/fetch/ResourceClientOrObserverWalker.h" |
#include "core/fetch/ResourceLoader.h" |
+#include "core/fetch/ScriptResource.h" |
#include "core/inspector/InstanceCounters.h" |
#include "platform/Histogram.h" |
#include "platform/Logging.h" |
@@ -109,6 +110,8 @@ public: |
// Sets the serialized metadata retrieved from the platform's cache. |
void setSerializedCachedMetadata(const char*, size_t); |
+ void prune() override; |
+ |
protected: |
explicit CachedMetadataHandlerImpl(Resource*); |
virtual void sendToPlatform(); |
@@ -180,6 +183,11 @@ void Resource::CachedMetadataHandlerImpl::sendToPlatform() |
} |
} |
+void Resource::CachedMetadataHandlerImpl::prune() |
+{ |
+ clearCachedMetadata(CachedMetadataHandler::CacheLocally); |
+} |
+ |
class Resource::ServiceWorkerResponseCachedMetadataHandler : public Resource::CachedMetadataHandlerImpl { |
public: |
static Resource::CachedMetadataHandlerImpl* create(Resource* resource, SecurityOrigin* securityOrigin) |
@@ -831,6 +839,8 @@ void Resource::finishPendingClients() |
void Resource::prune() |
{ |
destroyDecodedDataIfPossible(); |
+ if (m_cacheHandler) |
+ m_cacheHandler->prune(); |
unlock(); |
} |