| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "core/html/imports/HTMLImportTreeRoot.h" | 6 #include "core/html/imports/HTMLImportTreeRoot.h" |
| 7 | 7 |
| 8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
| 9 #include "core/dom/StyleEngine.h" | 9 #include "core/dom/StyleEngine.h" |
| 10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 : HTMLImport(HTMLImport::Sync) | 21 : HTMLImport(HTMLImport::Sync) |
| 22 , m_document(document) | 22 , m_document(document) |
| 23 , m_recalcTimer(this, &HTMLImportTreeRoot::recalcTimerFired) | 23 , m_recalcTimer(this, &HTMLImportTreeRoot::recalcTimerFired) |
| 24 { | 24 { |
| 25 scheduleRecalcState(); // This recomputes initial state. | 25 scheduleRecalcState(); // This recomputes initial state. |
| 26 } | 26 } |
| 27 | 27 |
| 28 HTMLImportTreeRoot::~HTMLImportTreeRoot() | 28 HTMLImportTreeRoot::~HTMLImportTreeRoot() |
| 29 { | 29 { |
| 30 #if !ENABLE(OILPAN) | 30 #if !ENABLE(OILPAN) |
| 31 for (size_t i = 0; i < m_imports.size(); ++i) | 31 dispose(); |
| 32 m_imports[i]->importDestroyed(); | |
| 33 m_imports.clear(); | |
| 34 m_document = nullptr; | |
| 35 #endif | 32 #endif |
| 36 } | 33 } |
| 37 | 34 |
| 35 void HTMLImportTreeRoot::dispose() |
| 36 { |
| 37 for (size_t i = 0; i < m_imports.size(); ++i) |
| 38 m_imports[i]->dispose(); |
| 39 m_imports.clear(); |
| 40 m_document = nullptr; |
| 41 m_recalcTimer.stop(); |
| 42 } |
| 43 |
| 38 Document* HTMLImportTreeRoot::document() const | 44 Document* HTMLImportTreeRoot::document() const |
| 39 { | 45 { |
| 40 return m_document; | 46 return m_document; |
| 41 } | 47 } |
| 42 | 48 |
| 43 bool HTMLImportTreeRoot::isDone() const | 49 bool HTMLImportTreeRoot::isDone() const |
| 44 { | 50 { |
| 45 return !m_document->parsing() && m_document->styleEngine().haveStylesheetsLo
aded(); | 51 return !m_document->parsing() && m_document->styleEngine().haveStylesheetsLo
aded(); |
| 46 } | 52 } |
| 47 | 53 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 } | 108 } |
| 103 | 109 |
| 104 DEFINE_TRACE(HTMLImportTreeRoot) | 110 DEFINE_TRACE(HTMLImportTreeRoot) |
| 105 { | 111 { |
| 106 visitor->trace(m_document); | 112 visitor->trace(m_document); |
| 107 visitor->trace(m_imports); | 113 visitor->trace(m_imports); |
| 108 HTMLImport::trace(visitor); | 114 HTMLImport::trace(visitor); |
| 109 } | 115 } |
| 110 | 116 |
| 111 } | 117 } |
| OLD | NEW |