Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Unified Diff: third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.h

Issue 2867333002: Revert "Separate preaload matching from MemoryCache" (Closed)
Patch Set: Revert "Separate preaload matching from MemoryCache" Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 f6b486350d247ab232949a44e737a97a0297498d..4944daa34f198a8533d060bc1d70bfbb248ce776 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.h
+++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.h
@@ -33,7 +33,6 @@
#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"
@@ -107,6 +106,7 @@ class PLATFORM_EXPORT ResourceFetcher
int CountPreloads() const { return preloads_.size(); }
void ClearPreloads(ClearPreloadsPolicy = kClearAllPreloads);
+ void PreloadStarted(Resource*);
void LogPreloadStats(ClearPreloadsPolicy);
void WarnUnusedPreloads();
@@ -145,10 +145,9 @@ class PLATFORM_EXPORT ResourceFetcher
// Calling this method before main document resource is fetched is invalid.
ResourceTimingInfo* GetNavigationTimingInfo();
- // Returns whether the given resource is contained as a preloaded resource.
- bool ContainsAsPreload(Resource*) const;
-
- void RemovePreload(Resource*);
+ bool ContainsAsPreloadForTesting(Resource* resource) const {
+ return preloads_.Contains(resource);
+ }
// Workaround for https://crbug.com/666214.
// TODO(hiroshige): Remove this hack.
@@ -191,14 +190,6 @@ class PLATFORM_EXPORT ResourceFetcher
const ResourceFactory&,
ResourceRequestBlockedReason);
- Resource* MatchPreload(const FetchParameters& params, Resource::Type);
- void InsertAsPreloadIfNecessary(Resource*,
- const FetchParameters& params,
- Resource::Type);
-
- bool IsReusableForPreloading(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,
@@ -242,7 +233,7 @@ class PLATFORM_EXPORT ResourceFetcher
HashSet<String> validated_urls_;
mutable DocumentResourceMap document_resources_;
- HeapHashMap<PreloadKey, Member<Resource>> preloads_;
+ HeapListHashSet<Member<Resource>> preloads_;
Member<MHTMLArchive> archive_;
TaskRunnerTimer<ResourceFetcher> resource_timing_report_timer_;

Powered by Google App Engine
This is Rietveld 408576698