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

Unified Diff: third_party/WebKit/Source/core/fetch/ResourceFetcher.h

Issue 1667843003: Make Resource RefCountedWillBeGarbageCollectedFinalized, attempt #2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase + address review comments Created 4 years, 10 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/core/fetch/ResourceFetcher.h
diff --git a/third_party/WebKit/Source/core/fetch/ResourceFetcher.h b/third_party/WebKit/Source/core/fetch/ResourceFetcher.h
index c45cdf7c75b6635e59b6a1689589a4edca47cde1..d3bd7fe22dd294cb5c2989c455a22d26c4c92c99 100644
--- a/third_party/WebKit/Source/core/fetch/ResourceFetcher.h
+++ b/third_party/WebKit/Source/core/fetch/ResourceFetcher.h
@@ -33,7 +33,6 @@
#include "core/fetch/FetchRequest.h"
#include "core/fetch/Resource.h"
#include "core/fetch/ResourceLoaderOptions.h"
-#include "core/fetch/ResourcePtr.h"
#include "core/fetch/SubstituteData.h"
#include "platform/Timer.h"
#include "platform/network/ResourceError.h"
@@ -74,7 +73,7 @@ public:
virtual ~ResourceFetcher();
DECLARE_VIRTUAL_TRACE();
- ResourcePtr<Resource> requestResource(FetchRequest&, const ResourceFactory&, const SubstituteData& = SubstituteData());
+ PassRefPtrWillBeRawPtr<Resource> requestResource(FetchRequest&, const ResourceFactory&, const SubstituteData& = SubstituteData());
Resource* cachedResource(const KURL&) const;
@@ -154,7 +153,7 @@ public:
void reloadLoFiImages();
// This is only exposed for testing purposes.
- WillBeHeapListHashSet<RawPtrWillBeMember<Resource>>* preloads() { return m_preloads.get(); }
+ WillBeHeapListHashSet<RefPtrWillBeMember<Resource>>* preloads() { return m_preloads.get(); }
private:
friend class ResourceCacheValidationSuppressor;
@@ -162,10 +161,10 @@ private:
explicit ResourceFetcher(FetchContext*);
void initializeRevalidation(const FetchRequest&, Resource*);
- ResourcePtr<Resource> createResourceForLoading(FetchRequest&, const String& charset, const ResourceFactory&);
+ PassRefPtrWillBeRawPtr<Resource> createResourceForLoading(FetchRequest&, const String& charset, const ResourceFactory&);
void storeResourceTimingInitiatorInformation(Resource*);
bool scheduleArchiveLoad(Resource*, const ResourceRequest&);
- ResourcePtr<Resource> preCacheData(const FetchRequest&, const ResourceFactory&, const SubstituteData&);
+ void preCacheData(const FetchRequest&, const ResourceFactory&, const SubstituteData&);
// RevalidationPolicy enum values are used in UMAs https://crbug.com/579496.
enum RevalidationPolicy { Use, Revalidate, Reload, Load };
@@ -190,18 +189,11 @@ private:
HashSet<String> m_validatedURLs;
mutable DocumentResourceMap m_documentResources;
- // We intentionally use a Member instead of a ResourcePtr.
- // Using a ResourcePtrs can lead to a wrong behavior because
- // the underlying Resource of the ResourcePtr is updated when the Resource
- // is revalidated. What we really want to hold here is not the ResourcePtr
- // but the underlying Resource.
- OwnPtrWillBeMember<WillBeHeapListHashSet<RawPtrWillBeMember<Resource>>> m_preloads;
+ OwnPtrWillBeMember<WillBeHeapListHashSet<RefPtrWillBeMember<Resource>>> m_preloads;
RefPtrWillBeMember<MHTMLArchive> m_archive;
Timer<ResourceFetcher> m_resourceTimingReportTimer;
- // We intentionally use a Member instead of a ResourcePtr.
- // See the comment on m_preloads.
using ResourceTimingInfoMap = WillBeHeapHashMap<RawPtrWillBeMember<Resource>, OwnPtr<ResourceTimingInfo>>;
ResourceTimingInfoMap m_resourceTimingInfoMap;
« no previous file with comments | « third_party/WebKit/Source/core/fetch/Resource.cpp ('k') | third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698