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

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

Issue 141143006: [import] Cleanup: get rid of ad-hoc state machine. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated to ToT Created 6 years, 11 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/HTMLImportsController.h ('k') | Source/core/html/HTMLLinkElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLImportsController.cpp
diff --git a/Source/core/html/HTMLImportsController.cpp b/Source/core/html/HTMLImportsController.cpp
index 0aaf43abf3da71453d9f5615c73a4ce95dbd0361..7baf599522817cc645c893d627d627555d868cb3 100644
--- a/Source/core/html/HTMLImportsController.cpp
+++ b/Source/core/html/HTMLImportsController.cpp
@@ -48,8 +48,9 @@ void HTMLImportsController::provideTo(Document* master)
HTMLImportsController::HTMLImportsController(Document* master)
: m_master(master)
- , m_unblockTimer(this, &HTMLImportsController::unblockTimerFired)
+ , m_recalcTimer(this, &HTMLImportsController::recalcTimerFired)
{
+ recalcTreeState(this); // This recomputes initial state.
}
HTMLImportsController::~HTMLImportsController()
@@ -107,7 +108,7 @@ HTMLImportChild* HTMLImportsController::findLinkFor(const KURL& url, HTMLImport*
{
for (size_t i = 0; i < m_imports.size(); ++i) {
HTMLImportChild* candidate = m_imports[i].get();
- if (candidate != excluding && equalIgnoringFragmentIdentifier(candidate->url(), url) && !candidate->isBlockedFromCreatingDocument())
+ if (candidate != excluding && equalIgnoringFragmentIdentifier(candidate->url(), url) && candidate->hasLoader())
return candidate;
}
@@ -139,10 +140,6 @@ void HTMLImportsController::wasDetachedFromDocument()
clear();
}
-void HTMLImportsController::didFinishParsing()
-{
-}
-
bool HTMLImportsController::hasLoader() const
{
return true;
@@ -153,24 +150,19 @@ bool HTMLImportsController::isDone() const
return !m_master->parsing();
}
-void HTMLImportsController::blockerGone()
-{
- scheduleUnblock();
-}
-
-void HTMLImportsController::scheduleUnblock()
+void HTMLImportsController::scheduleRecalcState()
{
- if (m_unblockTimer.isActive())
+ if (m_recalcTimer.isActive())
return;
- m_unblockTimer.startOneShot(0);
+ m_recalcTimer.startOneShot(0);
}
-void HTMLImportsController::unblockTimerFired(Timer<HTMLImportsController>*)
+void HTMLImportsController::recalcTimerFired(Timer<HTMLImportsController>*)
{
do {
- m_unblockTimer.stop();
- HTMLImport::unblock(this);
- } while (m_unblockTimer.isActive());
+ m_recalcTimer.stop();
+ HTMLImport::recalcTreeState(this);
+ } while (m_recalcTimer.isActive());
}
} // namespace WebCore
« no previous file with comments | « Source/core/html/HTMLImportsController.h ('k') | Source/core/html/HTMLLinkElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698