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

Unified Diff: third_party/WebKit/Source/core/loader/DocumentThreadableLoader.h

Issue 1569273004: Move ResourceOwner on to the oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: win_chromium_compile_dbg_ng is the worst Created 4 years, 11 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/loader/DocumentThreadableLoader.h
diff --git a/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.h b/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.h
index 124db54f2dfb93e8f185dc556c7ab57434c3e541..7907c2e936d3c8e4eb51d06a5b43d95d30844f24 100644
--- a/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.h
+++ b/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.h
@@ -53,7 +53,7 @@ class ResourceRequest;
class SecurityOrigin;
class ThreadableLoaderClient;
-class CORE_EXPORT DocumentThreadableLoader final : public ThreadableLoader, private ResourceOwner<RawResource> {
+class CORE_EXPORT DocumentThreadableLoader final : public ThreadableLoader, private RawResourceClient {
USING_FAST_MALLOC(DocumentThreadableLoader);
public:
static void loadResourceSynchronously(Document&, const ResourceRequest&, ThreadableLoaderClient&, const ThreadableLoaderOptions&, const ResourceLoaderOptions&);
@@ -146,6 +146,31 @@ class CORE_EXPORT DocumentThreadableLoader final : public ThreadableLoader, priv
// returns allowCredentials value of m_resourceLoaderOptions.
StoredCredentials effectiveAllowCredentials() const;
+ // TODO(oilpan): DocumentThreadableLoader used to be a ResourceOwner,
+ // but ResourceOwner was moved onto the oilpan heap before
+ // DocumentThreadableLoader was ready. When DocumentThreadableLoader
+ // moves onto the oilpan heap, make it a ResourceOwner again and remove
+ // this re-implementation of ResourceOwner.
+ RawResource* resource() const { return m_resource.get(); }
+ void clearResource() { setResource(nullptr); }
+ void setResource(const ResourcePtr<RawResource>& newResource)
+ {
+ if (newResource == m_resource)
+ return;
+
+ if (ResourcePtr<RawResource> oldResource = m_resource) {
+ m_resource.clear();
+ oldResource->removeClient(this);
+ }
+
+ if (newResource) {
+ m_resource = newResource;
+ m_resource->addClient(this);
+ }
+ }
+ ResourcePtr<RawResource> m_resource;
+ // End of ResourceOwner re-implementation, see above.
+
SecurityOrigin* securityOrigin() const;
Document& document() const;

Powered by Google App Engine
This is Rietveld 408576698