OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 13 matching lines...) Expand all Loading... |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef HTMLImportChild_h | 31 #ifndef HTMLImportChild_h |
32 #define HTMLImportChild_h | 32 #define HTMLImportChild_h |
33 | 33 |
34 #include "core/fetch/RawResource.h" | |
35 #include "core/html/imports/HTMLImport.h" | 34 #include "core/html/imports/HTMLImport.h" |
36 #include "platform/heap/Handle.h" | 35 #include "platform/heap/Handle.h" |
37 #include "platform/weborigin/KURL.h" | 36 #include "platform/weborigin/KURL.h" |
38 #include "wtf/Vector.h" | 37 #include "wtf/Vector.h" |
39 #include "wtf/WeakPtr.h" | 38 #include "wtf/WeakPtr.h" |
40 | 39 |
41 namespace WebCore { | 40 namespace WebCore { |
42 | 41 |
43 class CustomElementMicrotaskImportStep; | 42 class CustomElementMicrotaskImportStep; |
44 class HTMLImportLoader; | 43 class HTMLImportLoader; |
45 class HTMLImportChildClient; | 44 class HTMLImportChildClient; |
46 class HTMLLinkElement; | 45 class HTMLLinkElement; |
47 | 46 |
48 // | 47 // |
49 // An import tree node subclas to encapsulate imported document | 48 // An import tree node subclas to encapsulate imported document |
50 // lifecycle. This class is owned by HTMLImportsController. The actual loading | 49 // lifecycle. This class is owned by HTMLImportsController. The actual loading |
51 // is done by HTMLImportLoader, which can be shared among multiple | 50 // is done by HTMLImportLoader, which can be shared among multiple |
52 // HTMLImportChild of same link URL. | 51 // HTMLImportChild of same link URL. |
53 // | 52 // |
54 class HTMLImportChild FINAL : public HTMLImport { | 53 class HTMLImportChild FINAL : public HTMLImport { |
55 public: | 54 public: |
56 HTMLImportChild(const KURL&, SyncMode); | 55 HTMLImportChild(const KURL&, HTMLImportLoader*, SyncMode); |
57 virtual ~HTMLImportChild(); | 56 virtual ~HTMLImportChild(); |
58 | 57 |
59 HTMLLinkElement* link() const; | 58 HTMLLinkElement* link() const; |
60 Document* importedDocument() const; | 59 Document* importedDocument() const; |
61 const KURL& url() const { return m_url; } | 60 const KURL& url() const { return m_url; } |
62 | 61 |
63 void wasAlreadyLoaded(); | 62 void didShareLoader(); |
64 void startLoading(const ResourcePtr<RawResource>&); | 63 void didStartLoading(); |
65 void importDestroyed(); | 64 void importDestroyed(); |
66 WeakPtr<HTMLImportChild> weakPtr() { return m_weakFactory.createWeakPtr(); } | 65 WeakPtr<HTMLImportChild> weakPtr() { return m_weakFactory.createWeakPtr(); } |
67 | 66 |
68 // HTMLImport | 67 // HTMLImport |
69 virtual bool isChild() const OVERRIDE { return true; } | 68 virtual bool isChild() const OVERRIDE { return true; } |
70 virtual Document* document() const OVERRIDE; | 69 virtual Document* document() const OVERRIDE; |
71 virtual bool isDone() const OVERRIDE; | 70 virtual bool isDone() const OVERRIDE; |
72 virtual HTMLImportLoader* loader() const OVERRIDE { return m_loader; } | 71 virtual HTMLImportLoader* loader() const OVERRIDE { return m_loader; } |
73 virtual void stateWillChange() OVERRIDE; | 72 virtual void stateWillChange() OVERRIDE; |
74 virtual void stateDidChange() OVERRIDE; | 73 virtual void stateDidChange() OVERRIDE; |
(...skipping 26 matching lines...) Expand all Loading... |
101 | 100 |
102 inline HTMLImportChild* toHTMLImportChild(HTMLImport* import) | 101 inline HTMLImportChild* toHTMLImportChild(HTMLImport* import) |
103 { | 102 { |
104 ASSERT(!import || import->isChild()); | 103 ASSERT(!import || import->isChild()); |
105 return static_cast<HTMLImportChild*>(import); | 104 return static_cast<HTMLImportChild*>(import); |
106 } | 105 } |
107 | 106 |
108 } // namespace WebCore | 107 } // namespace WebCore |
109 | 108 |
110 #endif // HTMLImportChild_h | 109 #endif // HTMLImportChild_h |
OLD | NEW |