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

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

Issue 2225733002: Revert of Move ThreadableLoader to Oilpan heap (3/3) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@onheap-threadable-loader
Patch Set: Created 4 years, 4 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 79e8336d7cd4c0cb5dbb45cb5293dd69c5222cb4..227541be515c738c74ac6cae5ff628d15698b6d3 100644
--- a/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.h
+++ b/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.h
@@ -54,8 +54,7 @@
class SecurityOrigin;
class ThreadableLoaderClient;
-class CORE_EXPORT DocumentThreadableLoader final : public ThreadableLoader, private ResourceOwner<RawResource> {
- USING_GARBAGE_COLLECTED_MIXIN(DocumentThreadableLoader);
+class CORE_EXPORT DocumentThreadableLoader final : public ThreadableLoader, private RawResourceClient {
public:
static void loadResourceSynchronously(Document&, const ResourceRequest&, ThreadableLoaderClient&, const ThreadableLoaderOptions&, const ResourceLoaderOptions&);
static DocumentThreadableLoader* create(Document&, ThreadableLoaderClient*, const ThreadableLoaderOptions&, const ResourceLoaderOptions&);
@@ -151,6 +150,29 @@
// 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(RawResource* newResource)
+ {
+ if (newResource == m_resource)
+ return;
+
+ if (RawResource* oldResource = m_resource.release())
+ oldResource->removeClient(this);
+
+ if (newResource) {
+ m_resource = newResource;
+ m_resource->addClient(this);
+ }
+ }
+ Member<RawResource> m_resource;
+ // End of ResourceOwner re-implementation, see above.
+
SecurityOrigin* getSecurityOrigin() const;
Document& document() const;
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698