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

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

Issue 305723004: Make HTMLImportTreeNode own the whole import tree. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Comments addressed. Created 6 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 | « Source/core/html/imports/HTMLImportTreeRoot.h ('k') | Source/core/html/imports/HTMLImportsController.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/imports/HTMLImportTreeRoot.cpp
diff --git a/Source/core/html/imports/HTMLImportTreeRoot.cpp b/Source/core/html/imports/HTMLImportTreeRoot.cpp
index d44d93291be97f173f54b87f1c95423d30bae3a6..c28b5203dbd972e00254d35430ca78597a780f14 100644
--- a/Source/core/html/imports/HTMLImportTreeRoot.cpp
+++ b/Source/core/html/imports/HTMLImportTreeRoot.cpp
@@ -8,6 +8,7 @@
#include "core/dom/Document.h"
#include "core/dom/StyleEngine.h"
#include "core/frame/LocalFrame.h"
+#include "core/html/imports/HTMLImportChild.h"
namespace WebCore {
@@ -24,6 +25,13 @@ HTMLImportTreeRoot::HTMLImportTreeRoot(Document* document)
recalcTreeState(this); // This recomputes initial state.
}
+HTMLImportTreeRoot::~HTMLImportTreeRoot()
+{
+ for (size_t i = 0; i < m_imports.size(); ++i)
+ m_imports[i]->importDestroyed();
+ m_imports.clear();
+}
+
Document* HTMLImportTreeRoot::document() const
{
return m_document;
@@ -56,6 +64,23 @@ void HTMLImportTreeRoot::scheduleRecalcState()
m_recalcTimer.startOneShot(0, FROM_HERE);
}
+HTMLImportChild* HTMLImportTreeRoot::add(PassOwnPtr<HTMLImportChild> child)
+{
+ m_imports.append(child);
+ return m_imports.last().get();
+}
+
+HTMLImportChild* HTMLImportTreeRoot::find(const KURL& url) const
+{
+ for (size_t i = 0; i < m_imports.size(); ++i) {
+ HTMLImportChild* candidate = m_imports[i].get();
+ if (equalIgnoringFragmentIdentifier(candidate->url(), url))
+ return candidate;
+ }
+
+ return 0;
+}
+
void HTMLImportTreeRoot::recalcTimerFired(Timer<HTMLImportTreeRoot>*)
{
ASSERT(m_document);
« no previous file with comments | « Source/core/html/imports/HTMLImportTreeRoot.h ('k') | Source/core/html/imports/HTMLImportsController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698