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 18 matching lines...) Expand all Loading... |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 #include "core/html/imports/LinkImport.h" | 32 #include "core/html/imports/LinkImport.h" |
33 | 33 |
34 #include "core/dom/Document.h" | 34 #include "core/dom/Document.h" |
35 #include "core/fetch/CrossOriginAccessControl.h" | 35 #include "core/fetch/CrossOriginAccessControl.h" |
36 #include "core/html/HTMLLinkElement.h" | 36 #include "core/html/HTMLLinkElement.h" |
37 #include "core/html/imports/HTMLImportChild.h" | 37 #include "core/html/imports/HTMLImportChild.h" |
38 #include "core/html/imports/HTMLImportLoader.h" | 38 #include "core/html/imports/HTMLImportLoader.h" |
| 39 #include "core/html/imports/HTMLImportTreeRoot.h" |
39 #include "core/html/imports/HTMLImportsController.h" | 40 #include "core/html/imports/HTMLImportsController.h" |
40 | 41 |
41 | |
42 namespace WebCore { | 42 namespace WebCore { |
43 | 43 |
44 PassOwnPtrWillBeRawPtr<LinkImport> LinkImport::create(HTMLLinkElement* owner) | 44 PassOwnPtrWillBeRawPtr<LinkImport> LinkImport::create(HTMLLinkElement* owner) |
45 { | 45 { |
46 return adoptPtrWillBeNoop(new LinkImport(owner)); | 46 return adoptPtrWillBeNoop(new LinkImport(owner)); |
47 } | 47 } |
48 | 48 |
49 LinkImport::LinkImport(HTMLLinkElement* owner) | 49 LinkImport::LinkImport(HTMLLinkElement* owner) |
50 : LinkResource(owner) | 50 : LinkResource(owner) |
51 , m_child(0) | 51 , m_child(0) |
(...skipping 30 matching lines...) Expand all Loading... |
82 } | 82 } |
83 | 83 |
84 LinkRequestBuilder builder(m_owner); | 84 LinkRequestBuilder builder(m_owner); |
85 if (!builder.isValid()) { | 85 if (!builder.isValid()) { |
86 didFinish(); | 86 didFinish(); |
87 return; | 87 return; |
88 } | 88 } |
89 | 89 |
90 HTMLImportsController* controller = m_owner->document().importsController(); | 90 HTMLImportsController* controller = m_owner->document().importsController(); |
91 HTMLImportLoader* loader = m_owner->document().importLoader(); | 91 HTMLImportLoader* loader = m_owner->document().importLoader(); |
92 HTMLImport* parent = loader ? static_cast<HTMLImport*>(loader->firstImport()
) : static_cast<HTMLImport*>(controller); | 92 HTMLImport* parent = loader ? static_cast<HTMLImport*>(loader->firstImport()
) : static_cast<HTMLImport*>(controller->root()); |
93 m_child = controller->load(parent, this, builder.build(true)); | 93 m_child = controller->load(parent, this, builder.build(true)); |
94 if (!m_child) { | 94 if (!m_child) { |
95 didFinish(); | 95 didFinish(); |
96 return; | 96 return; |
97 } | 97 } |
98 } | 98 } |
99 | 99 |
100 void LinkImport::didFinish() | 100 void LinkImport::didFinish() |
101 { | 101 { |
102 if (!m_owner || !m_owner->inDocument()) | 102 if (!m_owner || !m_owner->inDocument()) |
(...skipping 22 matching lines...) Expand all Loading... |
125 { | 125 { |
126 return m_child && m_child->isDone() && !m_child->loaderHasError(); | 126 return m_child && m_child->isDone() && !m_child->loaderHasError(); |
127 } | 127 } |
128 | 128 |
129 void LinkImport::trace(Visitor* visitor) | 129 void LinkImport::trace(Visitor* visitor) |
130 { | 130 { |
131 LinkResource::trace(visitor); | 131 LinkResource::trace(visitor); |
132 } | 132 } |
133 | 133 |
134 } // namespace WebCore | 134 } // namespace WebCore |
OLD | NEW |