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;
16 class HTMLImportTreeRoot : public HTMLImport {
18 static PassOwnPtrWillBeRawPtr<HTMLImportTreeRoot> create(Document*);
20 virtual ~HTMLImportTreeRoot();
23 virtual Document* document() const OVERRIDE;
24 virtual bool isDone() const OVERRIDE;
25 virtual void stateWillChange() OVERRIDE;
26 virtual void stateDidChange() OVERRIDE;
28 void scheduleRecalcState();
30 HTMLImportChild* add(PassOwnPtrWillBeRawPtr<HTMLImportChild>);
31 HTMLImportChild* find(const KURL&) const;
33 virtual void trace(Visitor*) OVERRIDE;
36 explicit HTMLImportTreeRoot(Document*);
38 void recalcTimerFired(Timer<HTMLImportTreeRoot>*);
40 RawPtrWillBeMember<Document> m_document;
41 Timer<HTMLImportTreeRoot> m_recalcTimer;
43 // List of import which has been loaded or being loaded.
44 typedef WillBeHeapVector<OwnPtrWillBeMember<HTMLImportChild> > ImportList;
48 DEFINE_TYPE_CASTS(HTMLImportTreeRoot, HTMLImport, import, import->isRoot(), import.isRoot());