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

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

Issue 303643005: Straighten up HTML Imports load vs. share loader logic. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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/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 78bcdc1f052976603139429a1ae55da995c33d77..1078cad0757a474f2d0b7b456edeecf5a4d214ea 100644
--- a/Source/core/html/imports/HTMLImportChild.cpp
+++ b/Source/core/html/imports/HTMLImportChild.cpp
@@ -41,11 +41,11 @@
namespace WebCore {
-HTMLImportChild::HTMLImportChild(const KURL& url, SyncMode sync)
+HTMLImportChild::HTMLImportChild(const KURL& url, HTMLImportLoader* loader, SyncMode sync)
: HTMLImport(sync)
, m_url(url)
, m_weakFactory(this)
- , m_loader(0)
+ , m_loader(loader)
, m_client(0)
{
}
@@ -59,25 +59,14 @@ HTMLImportChild::~HTMLImportChild()
m_client->importChildWasDestroyed(this);
}
-void HTMLImportChild::wasAlreadyLoaded()
+void HTMLImportChild::didShareLoader()
{
- ASSERT(!m_loader);
- ASSERT(m_client);
- shareLoader();
+ createCustomElementMicrotaskStepIfNeeded();
stateWillChange();
}
-void HTMLImportChild::startLoading(const ResourcePtr<RawResource>& resource)
+void HTMLImportChild::didStartLoading()
{
- ASSERT(!m_loader);
-
- if (m_loader)
- return;
-
- m_loader = toHTMLImportsController(root())->createLoader();
- m_loader->addImport(this);
- m_loader->startLoading(resource);
-
createCustomElementMicrotaskStepIfNeeded();
}
@@ -167,18 +156,6 @@ void HTMLImportChild::createCustomElementMicrotaskStepIfNeeded()
toHTMLImportChild(child)->createCustomElementMicrotaskStepIfNeeded();
}
-void HTMLImportChild::shareLoader()
-{
- ASSERT(!m_loader);
-
- if (HTMLImportChild* childToShareWith = toHTMLImportsController(root())->findLinkFor(m_url, this)) {
- m_loader = childToShareWith->m_loader;
- m_loader->addImport(this);
- }
-
- createCustomElementMicrotaskStepIfNeeded();
-}
-
bool HTMLImportChild::isDone() const
{
return m_loader && m_loader->isDone() && !m_loader->microtaskQueue()->needsProcessOrStop() && !m_customElementMicrotaskStep;
« 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