#ifndef CustomElementMicrotaskImportStep_h
#define CustomElementMicrotaskImportStep_h
-#include "core/dom/custom/CustomElementMicrotaskQueue.h"
#include "core/dom/custom/CustomElementMicrotaskStep.h"
#include "wtf/Noncopyable.h"
#include "wtf/PassOwnPtr.h"
+#include "wtf/PassRefPtr.h"
+#include "wtf/RefPtr.h"
+#include "wtf/WeakPtr.h"
namespace WebCore {
+class CustomElementMicrotaskQueue;
+class HTMLImportChild;
+
// Processes the Custom Elements in an HTML Import. This is a
// composite step which processes the Custom Elements created by
// parsing the import, and its sub-imports.
class CustomElementMicrotaskImportStep : public CustomElementMicrotaskStep {
WTF_MAKE_NONCOPYABLE(CustomElementMicrotaskImportStep);
public:
- static PassOwnPtr<CustomElementMicrotaskImportStep> create();
- virtual ~CustomElementMicrotaskImportStep() { }
-
- // API for CustomElementScheduler
- void enqueue(PassOwnPtr<CustomElementMicrotaskStep>);
+ static PassOwnPtr<CustomElementMicrotaskImportStep> create(HTMLImportChild*);
+ virtual ~CustomElementMicrotaskImportStep();
// API for HTML Imports
- void importDidFinish();
+ void importDidFinishLoading();
+ WeakPtr<CustomElementMicrotaskImportStep> weakPtr() { return m_weakFactory.createWeakPtr(); }
private:
- CustomElementMicrotaskImportStep() : m_importFinished(false) { }
+ CustomElementMicrotaskImportStep(HTMLImportChild*);
+
+ void didUpgradeAllCustomElements();
+ bool shouldWaitForImport() const;
+ bool shouldStopProcessing() const;
// CustomElementMicrotaskStep
virtual Result process() OVERRIDE FINAL;
- bool m_importFinished;
- CustomElementMicrotaskQueue m_queue;
+#if !defined(NDEBUG)
+ virtual void show(unsigned indent) OVERRIDE;
+#endif
+ WeakPtr<HTMLImportChild> m_import;
+ RefPtr<CustomElementMicrotaskQueue> m_queue;
+ WeakPtrFactory<CustomElementMicrotaskImportStep> m_weakFactory;
};
}