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

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

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 | « third_party/WebKit/Source/core/fetch/RawResource.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/fetch/RawResource.cpp
diff --git a/third_party/WebKit/Source/core/fetch/RawResource.cpp b/third_party/WebKit/Source/core/fetch/RawResource.cpp
index 48eadab9c2642b1e7d8f8605d0f8ed1ba74ec627..37c225d31083b9380e64516edee3504b4d1296fc 100644
--- a/third_party/WebKit/Source/core/fetch/RawResource.cpp
+++ b/third_party/WebKit/Source/core/fetch/RawResource.cpp
@@ -106,20 +106,21 @@ void RawResource::didAddClient(ResourceClient* c)
return;
ASSERT(RawResourceClient::isExpectedType(c));
RawResourceClient* client = static_cast<RawResourceClient*>(c);
+ WeakPtr<RawResourceClient> clientWeak = client->createWeakPtr();
for (const auto& redirect : redirectChain()) {
ResourceRequest request(redirect.m_request);
client->redirectReceived(this, request, redirect.m_redirectResponse);
- if (!hasClient(c))
+ if (!clientWeak || !hasClient(c))
return;
}
if (!m_response.isNull())
client->responseReceived(this, m_response, nullptr);
- if (!hasClient(c))
+ if (!clientWeak || !hasClient(c))
return;
if (m_data)
client->dataReceived(this, m_data->data(), m_data->size());
- if (!hasClient(c))
+ if (!clientWeak || !hasClient(c))
return;
Resource::didAddClient(client);
}
« no previous file with comments | « third_party/WebKit/Source/core/fetch/RawResource.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698