Chromium Code Reviews| 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 1647d362c10f7a3787b83946b6dbdfb9d2cb23a5..425183d0c4427a09fe5c97b2cc6babaeaa8202e7 100644 |
| --- a/third_party/WebKit/Source/core/fetch/Resource.cpp |
| +++ b/third_party/WebKit/Source/core/fetch/Resource.cpp |
| @@ -27,6 +27,7 @@ |
| #include "core/fetch/CachedMetadata.h" |
| #include "core/fetch/CrossOriginAccessControl.h" |
| #include "core/fetch/FetchInitiatorTypeNames.h" |
| +#include "core/fetch/FetchRequest.h" |
| #include "core/fetch/MemoryCache.h" |
| #include "core/fetch/ResourceClient.h" |
| #include "core/fetch/ResourceClientWalker.h" |
| @@ -313,6 +314,7 @@ Resource::Resource(const ResourceRequest& request, |
| m_linkPreload(false), |
| m_isRevalidating(false), |
| m_isAlive(false), |
| + m_integrityDisposition(ResourceIntegrityDisposition::NotChecked), |
| m_options(options), |
| m_responseTimestamp(currentTime()), |
| m_cancelTimer(this, &Resource::cancelTimerFired), |
| @@ -448,6 +450,22 @@ bool Resource::isEligibleForIntegrityCheck( |
| passesAccessControlCheck(securityOrigin, ignoredErrorDescription); |
| } |
| +void Resource::setIntegrityDisposition( |
| + ResourceIntegrityDisposition disposition) { |
| + DCHECK_NE(disposition, ResourceIntegrityDisposition::NotChecked); |
| + DCHECK(m_type == Resource::Script); |
| + m_integrityDisposition = disposition; |
| +} |
| + |
| +bool Resource::mustRefetchDueToIntegrityMetadata( |
| + const FetchRequest& request) const { |
| + if (request.integrityMetadata().isEmpty()) |
| + return false; |
| + |
| + return !IntegrityMetadata::setsEqual(m_integrityMetadata, |
|
jww
2016/10/06 20:42:45
nit: Please #include IntegrityMetadata.h
kouhei (in TOK)
2016/10/07 01:49:16
Done.
|
| + request.integrityMetadata()); |
| +} |
| + |
| static double currentAge(const ResourceResponse& response, |
| double responseTimestamp) { |
| // RFC2616 13.2.3 |