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

Unified Diff: Source/modules/fetch/FetchManager.cpp

Issue 872703002: Oilpan: Tidily dispose of FetchManager loader objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/fetch/FetchManager.cpp
diff --git a/Source/modules/fetch/FetchManager.cpp b/Source/modules/fetch/FetchManager.cpp
index 7da441c1d9fc87a213b524726eea6ac19b568418..ca7657093254d0a8c34780c604d70453c37622a4 100644
--- a/Source/modules/fetch/FetchManager.cpp
+++ b/Source/modules/fetch/FetchManager.cpp
@@ -49,7 +49,7 @@ public:
void didFailRedirectCheck() override;
void start();
- void cleanup();
+ void dispose();
private:
Loader(ExecutionContext*, FetchManager*, PassRefPtrWillBeRawPtr<ScriptPromiseResolver>, const FetchRequestData*);
@@ -79,8 +79,7 @@ FetchManager::Loader::Loader(ExecutionContext* executionContext, FetchManager* f
FetchManager::Loader::~Loader()
{
- if (m_loader)
- m_loader->cancel();
+ ASSERT(!m_loader);
}
void FetchManager::Loader::trace(Visitor* visitor)
@@ -256,11 +255,10 @@ void FetchManager::Loader::start()
performHTTPFetch(true, false);
}
-void FetchManager::Loader::cleanup()
+void FetchManager::Loader::dispose()
{
// Prevent notification
- m_fetchManager = 0;
-
+ m_fetchManager = nullptr;
if (m_loader) {
m_loader->cancel();
m_loader.clear();
@@ -414,16 +412,16 @@ void FetchManager::stop()
{
ASSERT(!m_isStopped);
m_isStopped = true;
- for (auto& loader : m_loaders) {
- loader->cleanup();
- }
+ for (auto& loader : m_loaders)
+ loader->dispose();
}
void FetchManager::onLoaderFinished(Loader* loader)
{
// We don't use remove here, because it may cause recursive deletion.
OwnPtrWillBeRawPtr<Loader> p = m_loaders.take(loader);
- ALLOW_UNUSED_LOCAL(p);
+ ASSERT(p);
+ p->dispose();
}
void FetchManager::trace(Visitor* visitor)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698