1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef HTMLImportTreeRoot_h
6 #define HTMLImportTreeRoot_h
8 #include "core/html/imports/HTMLImport.h"
9 #include "platform/Timer.h"
10 #include "wtf/PassOwnPtr.h"
14 class HTMLImportChild;
17 class HTMLImportTreeRoot : public HTMLImport {
19 static PassOwnPtrWillBeRawPtr<HTMLImportTreeRoot> create(Document*);
21 virtual ~HTMLImportTreeRoot();
24 virtual Document* document() const override;
25 virtual bool isDone() const override;
26 virtual void stateWillChange() override;
27 virtual void stateDidChange() override;
29 void scheduleRecalcState();
31 HTMLImportChild* add(PassOwnPtrWillBeRawPtr<HTMLImportChild>);
32 HTMLImportChild* find(const KURL&) const;
34 virtual void trace(Visitor*) override;
37 explicit HTMLImportTreeRoot(Document*);
39 void recalcTimerFired(Timer<HTMLImportTreeRoot>*);
41 RawPtrWillBeMember<Document> m_document;
42 Timer<HTMLImportTreeRoot> m_recalcTimer;
44 // List of import which has been loaded or being loaded.
45 typedef WillBeHeapVector<OwnPtrWillBeMember<HTMLImportChild>> ImportList;
49 DEFINE_TYPE_CASTS(HTMLImportTreeRoot, HTMLImport, import, import->isRoot(), import.isRoot());