| Index: third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.h
|
| diff --git a/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.h b/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.h
|
| index 4944daa34f198a8533d060bc1d70bfbb248ce776..3b66e019647dafdc85733cf1f432be6124a99662 100644
|
| --- a/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.h
|
| +++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.h
|
| @@ -33,6 +33,7 @@
|
| #include "platform/loader/fetch/FetchContext.h"
|
| #include "platform/loader/fetch/FetchInitiatorInfo.h"
|
| #include "platform/loader/fetch/FetchParameters.h"
|
| +#include "platform/loader/fetch/PreloadKey.h"
|
| #include "platform/loader/fetch/Resource.h"
|
| #include "platform/loader/fetch/ResourceError.h"
|
| #include "platform/loader/fetch/ResourceLoadPriority.h"
|
| @@ -106,7 +107,6 @@ class PLATFORM_EXPORT ResourceFetcher
|
|
|
| int CountPreloads() const { return preloads_.size(); }
|
| void ClearPreloads(ClearPreloadsPolicy = kClearAllPreloads);
|
| - void PreloadStarted(Resource*);
|
| void LogPreloadStats(ClearPreloadsPolicy);
|
| void WarnUnusedPreloads();
|
|
|
| @@ -145,9 +145,10 @@ class PLATFORM_EXPORT ResourceFetcher
|
| // Calling this method before main document resource is fetched is invalid.
|
| ResourceTimingInfo* GetNavigationTimingInfo();
|
|
|
| - bool ContainsAsPreloadForTesting(Resource* resource) const {
|
| - return preloads_.Contains(resource);
|
| - }
|
| + // Returns whether the given resource is contained as a preloaded resource.
|
| + bool ContainsAsPreload(Resource*) const;
|
| +
|
| + void RemovePreload(Resource*);
|
|
|
| // Workaround for https://crbug.com/666214.
|
| // TODO(hiroshige): Remove this hack.
|
| @@ -190,6 +191,14 @@ class PLATFORM_EXPORT ResourceFetcher
|
| const ResourceFactory&,
|
| ResourceRequestBlockedReason);
|
|
|
| + Resource* MatchPreload(const FetchParameters& params, Resource::Type);
|
| + void InsertAsPreloadIfNecessary(Resource*,
|
| + const FetchParameters& params,
|
| + Resource::Type);
|
| +
|
| + bool IsReusableAlsoForPreloading(const FetchParameters&,
|
| + Resource*,
|
| + bool is_static_data) const;
|
| // RevalidationPolicy enum values are used in UMAs https://crbug.com/579496.
|
| enum RevalidationPolicy { kUse, kRevalidate, kReload, kLoad };
|
| RevalidationPolicy DetermineRevalidationPolicy(Resource::Type,
|
| @@ -233,7 +242,8 @@ class PLATFORM_EXPORT ResourceFetcher
|
| HashSet<String> validated_urls_;
|
| mutable DocumentResourceMap document_resources_;
|
|
|
| - HeapListHashSet<Member<Resource>> preloads_;
|
| + HeapHashMap<PreloadKey, Member<Resource>> preloads_;
|
| + HeapVector<Member<Resource>> matched_preloads_;
|
| Member<MHTMLArchive> archive_;
|
|
|
| TaskRunnerTimer<ResourceFetcher> resource_timing_report_timer_;
|
|
|