| Index: third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
|
| diff --git a/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp b/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
|
| index 043757333de76590275489104f18f2b95f0389cd..538830a9c898adb94eb8ba7f46b8af0a79a185d5 100644
|
| --- a/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
|
| +++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
|
| @@ -579,11 +579,9 @@ Resource* ResourceFetcher::requestResource(
|
| }
|
| if (!resource)
|
| return nullptr;
|
| - if (resource->getType() != factory.type()) {
|
| - DCHECK(request.isSpeculativePreload() || request.isLinkPreload());
|
| - // TODO(yoav): What's the scenario where this can actually happen?
|
| - return nullptr;
|
| - }
|
| +
|
| + // TODO(yoav): turn to a DCHECK. See https://crbug.com/690632
|
| + CHECK_EQ(resource->getType(), factory.type());
|
|
|
| if (!resource->isAlive())
|
| m_deadStatsRecorder.update(policy);
|
| @@ -827,10 +825,6 @@ ResourceFetcher::determineRevalidationPolicy(Resource::Type type,
|
| if (existingResource->response().wasFallbackRequiredByServiceWorker())
|
| return Reload;
|
|
|
| - // We already have a preload going for this URL.
|
| - if (fetchRequest.isSpeculativePreload() && existingResource->isPreloaded())
|
| - return Use;
|
| -
|
| // If the same URL has been loaded as a different type, we need to reload.
|
| if (existingResource->getType() != type) {
|
| // FIXME: If existingResource is a Preload and the new type is LinkPrefetch
|
| @@ -842,6 +836,10 @@ ResourceFetcher::determineRevalidationPolicy(Resource::Type type,
|
| return Reload;
|
| }
|
|
|
| + // We already have a preload going for this URL.
|
| + if (fetchRequest.isSpeculativePreload() && existingResource->isPreloaded())
|
| + return Use;
|
| +
|
| // Do not load from cache if images are not enabled. There are two general
|
| // cases:
|
| //
|
|
|