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

Unified Diff: Source/core/html/imports/HTMLImportsController.cpp

Issue 1032293002: Oilpan: dispose an HTMLImportsController on document detach/removal. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: No need to call dispose() when destructing HTMLImportsController Created 5 years, 9 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 | « Source/core/html/imports/HTMLImportsController.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/imports/HTMLImportsController.cpp
diff --git a/Source/core/html/imports/HTMLImportsController.cpp b/Source/core/html/imports/HTMLImportsController.cpp
index dde4127a28b524dfd83b0e014e4f6701b5e81acf..18b24eaa8d6a4cae801ca521c3f03c7918e99cb9 100644
--- a/Source/core/html/imports/HTMLImportsController.cpp
+++ b/Source/core/html/imports/HTMLImportsController.cpp
@@ -57,6 +57,9 @@ void HTMLImportsController::provideTo(Document& master)
void HTMLImportsController::removeFrom(Document& master)
{
+ HTMLImportsController* controller = master.importsController();
+ ASSERT(controller);
+ controller->dispose();
static_cast<DocumentSupplementable&>(master).removeSupplement(supplementName());
master.setImportsController(nullptr);
}
@@ -70,12 +73,21 @@ HTMLImportsController::HTMLImportsController(Document& master)
HTMLImportsController::~HTMLImportsController()
{
#if !ENABLE(OILPAN)
- m_root.clear();
+ // Verify that dispose() has been called.
+ ASSERT(!m_root);
+#endif
+}
+
+void HTMLImportsController::dispose()
+{
+ if (m_root) {
+ m_root->dispose();
+ m_root.clear();
+ }
for (size_t i = 0; i < m_loaders.size(); ++i)
- m_loaders[i]->importDestroyed();
+ m_loaders[i]->dispose();
m_loaders.clear();
-#endif
}
static bool makesCycle(HTMLImport* parent, const KURL& url)
« no previous file with comments | « Source/core/html/imports/HTMLImportsController.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698