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

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

Issue 1986083002: Check RawResourceClient destruction in RawResource::didAddClient() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/fetch/RawResource.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/fetch/RawResource.h
diff --git a/third_party/WebKit/Source/core/fetch/RawResource.h b/third_party/WebKit/Source/core/fetch/RawResource.h
index 46f8cc036bc6556d45cc7d5e29413dcfcb8a9e4f..84b702679dbf358c60ba93339aa20ed0e6a83092 100644
--- a/third_party/WebKit/Source/core/fetch/RawResource.h
+++ b/third_party/WebKit/Source/core/fetch/RawResource.h
@@ -28,6 +28,7 @@
#include "core/fetch/ResourceClient.h"
#include "public/platform/WebDataConsumerHandle.h"
#include "wtf/PassOwnPtr.h"
+#include "wtf/WeakPtr.h"
namespace blink {
class FetchRequest;
@@ -103,6 +104,9 @@ inline RawResource* toRawResource(Resource* resource)
class CORE_EXPORT RawResourceClient : public ResourceClient {
public:
+ RawResourceClient()
+ : m_weakFactory(this) { }
+ WeakPtr<RawResourceClient> createWeakPtr() { return m_weakFactory.createWeakPtr(); }
~RawResourceClient() override {}
static bool isExpectedType(ResourceClient* client) { return client->getResourceClientType() == RawResourceType; }
ResourceClientType getResourceClientType() const final { return RawResourceType; }
@@ -115,6 +119,9 @@ public:
virtual void redirectBlocked() {}
virtual void dataDownloaded(Resource*, int) { }
virtual void didReceiveResourceTiming(Resource*, const ResourceTimingInfo&) { }
+
+private:
+ WeakPtrFactory<RawResourceClient> m_weakFactory;
};
} // namespace blink
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/fetch/RawResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698