| 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 a51befa492dba9b7ec60015dfbb1337314de5664..d0de8259a3b53162531e2bb2d529296f5f0cf925 100644
|
| --- a/third_party/WebKit/Source/core/fetch/Resource.cpp
|
| +++ b/third_party/WebKit/Source/core/fetch/Resource.cpp
|
| @@ -27,6 +27,8 @@
|
| #include "core/fetch/CachedMetadata.h"
|
| #include "core/fetch/CrossOriginAccessControl.h"
|
| #include "core/fetch/FetchInitiatorTypeNames.h"
|
| +#include "core/fetch/FetchRequest.h"
|
| +#include "core/fetch/IntegrityMetadata.h"
|
| #include "core/fetch/MemoryCache.h"
|
| #include "core/fetch/ResourceClient.h"
|
| #include "core/fetch/ResourceClientWalker.h"
|
| @@ -313,6 +315,7 @@
|
| m_linkPreload(false),
|
| m_isRevalidating(false),
|
| m_isAlive(false),
|
| + m_integrityDisposition(ResourceIntegrityDisposition::NotChecked),
|
| m_isAddRemoveClientProhibited(false),
|
| m_options(options),
|
| m_responseTimestamp(currentTime()),
|
| @@ -447,6 +450,22 @@
|
| String ignoredErrorDescription;
|
| return securityOrigin->canRequest(resourceRequest().url()) ||
|
| 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,
|
| + request.integrityMetadata());
|
| }
|
|
|
| static double currentAge(const ResourceResponse& response,
|
|
|