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

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: 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
Index: Source/core/html/HTMLImport.h
diff --git a/Source/core/html/HTMLImport.h b/Source/core/html/HTMLImport.h
index 96df1fb3d23e88537710794b888fff389ddb2768..653b94a3c85c57acf319626aab8647a63aec8497 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,40 @@ 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:
+ void blockAfter(HTMLImport* child);
+ void didUnblock();
+ void setBlocked(bool blocked) { m_blocked = blocked; }
+ void setTreeBlocked(bool);
+ 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

Powered by Google App Engine
This is Rietveld 408576698