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

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorResourceContentLoader.cpp

Issue 1436723005: Oilpan: tidy up InspectorResourceContentLoader's ResourceClient handling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/inspector/InspectorResourceContentLoader.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorResourceContentLoader.cpp b/third_party/WebKit/Source/core/inspector/InspectorResourceContentLoader.cpp
index 11cf4a105649379b920e1a7d449232d92d46d93f..5ce3fd9a73b8d4ca7bd8c4dce209cf5151d852e4 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorResourceContentLoader.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorResourceContentLoader.cpp
@@ -24,9 +24,9 @@
namespace blink {
-class InspectorResourceContentLoader::ResourceClient final : private RawResourceClient, private StyleSheetResourceClient {
+class InspectorResourceContentLoader::ResourceClient final : public NoBaseWillBeGarbageCollectedFinalized<InspectorResourceContentLoader::ResourceClient>, private RawResourceClient, private StyleSheetResourceClient {
public:
- ResourceClient(InspectorResourceContentLoader* loader)
+ explicit ResourceClient(InspectorResourceContentLoader* loader)
: m_loader(loader)
{
}
@@ -39,8 +39,13 @@ public:
resource->addClient(static_cast<StyleSheetResourceClient*>(this));
}
+ DEFINE_INLINE_TRACE()
+ {
+ visitor->trace(m_loader);
+ }
+
private:
- InspectorResourceContentLoader* m_loader;
+ RawPtrWillBeMember<InspectorResourceContentLoader> m_loader;
void setCSSStyleSheet(const String&, const KURL&, const String&, const CSSStyleSheetResource*) override;
void notifyFinished(Resource*) override;
@@ -60,7 +65,9 @@ void InspectorResourceContentLoader::ResourceClient::resourceFinished(Resource*
else
resource->removeClient(static_cast<StyleSheetResourceClient*>(this));
+#if !ENABLE(OILPAN)
delete this;
+#endif
}
void InspectorResourceContentLoader::ResourceClient::setCSSStyleSheet(const String&, const KURL& url, const String&, const CSSStyleSheetResource* resource)
@@ -158,7 +165,10 @@ InspectorResourceContentLoader::~InspectorResourceContentLoader()
DEFINE_TRACE(InspectorResourceContentLoader)
{
+#if ENABLE(OILPAN)
visitor->trace(m_inspectedFrame);
+ visitor->trace(m_pendingResourceClients);
+#endif
}
void InspectorResourceContentLoader::didCommitLoadForLocalFrame(LocalFrame* frame)
@@ -174,7 +184,7 @@ void InspectorResourceContentLoader::dispose()
void InspectorResourceContentLoader::stop()
{
- HashSet<ResourceClient*> pendingResourceClients;
+ WillBeHeapHashSet<RawPtrWillBeMember<ResourceClient>> pendingResourceClients;
m_pendingResourceClients.swap(pendingResourceClients);
for (const auto& client : pendingResourceClients)
client->m_loader = nullptr;

Powered by Google App Engine
This is Rietveld 408576698