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

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

Issue 234063004: Refactoring: Get rid of HTMLImportRoot. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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/HTMLImportChild.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/HTMLImportChild.cpp
diff --git a/Source/core/html/imports/HTMLImportChild.cpp b/Source/core/html/imports/HTMLImportChild.cpp
index 2b0c6c9f653109d295bfaacdb4f0eae67b63f633..4a6b89a5939ae3f0fcc99b0c23fac782fb4e9a38 100644
--- a/Source/core/html/imports/HTMLImportChild.cpp
+++ b/Source/core/html/imports/HTMLImportChild.cpp
@@ -132,14 +132,14 @@ void HTMLImportChild::importDestroyed()
}
}
-HTMLImportRoot* HTMLImportChild::root()
+Document* HTMLImportChild::document() const
{
- return parent() ? parent()->root() : 0;
+ return (m_loader && m_loader->isOwnedBy(this)) ? m_loader->document() : 0;
}
-Document* HTMLImportChild::document() const
+void HTMLImportChild::stateWillChange()
{
- return (m_loader && m_loader->isOwnedBy(this)) ? m_loader->document() : 0;
+ toHTMLImportsController(root())->scheduleRecalcState();
}
void HTMLImportChild::stateDidChange()
@@ -160,7 +160,7 @@ void HTMLImportChild::ensureLoader()
if (m_loader)
return;
- if (HTMLImportChild* found = root()->findLinkFor(m_url, this))
+ if (HTMLImportChild* found = toHTMLImportsController(root())->findLinkFor(m_url, this))
shareLoader(found);
else
createLoader();
@@ -170,7 +170,7 @@ void HTMLImportChild::createLoader()
{
ASSERT(!state().shouldBlockDocumentCreation());
ASSERT(!m_loader);
- m_loader = root()->toController()->createLoader();
+ m_loader = toHTMLImportsController(root())->createLoader();
m_loader->addImport(this);
m_loader->startLoading(resource());
}
« no previous file with comments | « Source/core/html/imports/HTMLImportChild.h ('k') | Source/core/html/imports/HTMLImportsController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698