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

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: 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..9a24fb7f3609fb0062c59329599c3d06f8695c8d 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)
haraken 2015/03/26 23:27:26 It seems that HTMLImportsController::removeFrom is
sof 2015/03/27 06:30:23 removeFrom() is called from Document upon detach;
{
+ HTMLImportsController* controller = master.importsController();
+ ASSERT(controller);
+ controller->dispose();
static_cast<DocumentSupplementable&>(master).removeSupplement(supplementName());
master.setImportsController(nullptr);
}
@@ -70,12 +73,20 @@ HTMLImportsController::HTMLImportsController(Document& master)
HTMLImportsController::~HTMLImportsController()
{
#if !ENABLE(OILPAN)
- m_root.clear();
+ dispose();
haraken 2015/03/26 23:27:26 As described above, I'm wondering why we need to c
sof 2015/03/27 08:44:31 You're right, it's not needed. Replaced with a non
+#endif
haraken 2015/03/26 23:27:26 In oilpan, we want to have an ASSERT to verify tha
+}
+
+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