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

Unified Diff: Source/core/html/HTMLImport.h

Issue 21182004: [HTML Imports] Make import loading in order. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Addressed feedback. Created 7 years, 5 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/dom/Document.cpp ('k') | Source/core/html/HTMLImport.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLImport.h
diff --git a/Source/core/html/HTMLImport.h b/Source/core/html/HTMLImport.h
index 96df1fb3d23e88537710794b888fff389ddb2768..ecdfd5f8f7a4f54c5eae02a370af38f386627869 100644
--- a/Source/core/html/HTMLImport.h
+++ b/Source/core/html/HTMLImport.h
@@ -31,6 +31,8 @@
#ifndef HTMLImport_h
#define HTMLImport_h
+#include "wtf/Vector.h"
+
namespace WebCore {
class Frame;
@@ -40,17 +42,43 @@ class HTMLImportsController;
class HTMLImport {
public:
+ static bool unblock(HTMLImport*);
+
virtual ~HTMLImport() { }
- bool haveChildrenLoaded();
Frame* frame();
Document* master();
+ bool isLoaded() const { return !isBlocked() && !isProcessing(); }
+ bool isBlocked() const { return m_blocked; }
+ void appendChild(HTMLImport*);
+
virtual HTMLImportsController* controller() = 0;
- virtual HTMLImport* parent() = 0;
- virtual Document* document() = 0;
+ virtual HTMLImport* parent() const = 0;
+ virtual Document* document() const = 0;
virtual void wasDetachedFromDocument() = 0;
virtual void didFinishParsing() = 0;
+ virtual bool isProcessing() const = 0;
+
+protected:
+ HTMLImport()
+ : m_blocked(false)
+ { }
+
+private:
+ static void block(HTMLImport*);
+
+ void blockAfter(HTMLImport* child);
+ void block();
+ void unblock();
+ void didUnblock();
+
+ bool arePredecessorsLoaded() const;
+ bool areChilrenLoaded() const;
+ bool hasChildren() const { return !m_children.isEmpty(); }
+
+ Vector<HTMLImport*> m_children;
+ bool m_blocked; // If any of decendants or predecessors is in processing, it is blocked.
};
} // namespace WebCore
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/html/HTMLImport.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698