| 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 17 matching lines...) Expand all Loading... |
| 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 #include "config.h" | 31 #include "config.h" |
| 32 #include "core/html/imports/HTMLImportChild.h" | 32 #include "core/html/imports/HTMLImportChild.h" |
| 33 | 33 |
| 34 #include "core/dom/Document.h" | 34 #include "core/dom/Document.h" |
| 35 #include "core/dom/custom/CustomElement.h" | 35 #include "core/dom/custom/CustomElement.h" |
| 36 #include "core/dom/custom/CustomElementMicrotaskDispatcher.h" | 36 #include "core/dom/custom/CustomElementMicrotaskDispatcher.h" |
| 37 #include "core/dom/custom/CustomElementMicrotaskImportStep.h" | 37 #include "core/dom/custom/CustomElementMicrotaskImportStep.h" |
| 38 #include "core/dom/custom/CustomElementMicrotaskQueue.h" |
| 38 #include "core/html/imports/HTMLImportChildClient.h" | 39 #include "core/html/imports/HTMLImportChildClient.h" |
| 39 #include "core/html/imports/HTMLImportLoader.h" | 40 #include "core/html/imports/HTMLImportLoader.h" |
| 40 #include "core/html/imports/HTMLImportsController.h" | 41 #include "core/html/imports/HTMLImportsController.h" |
| 41 | 42 |
| 42 namespace WebCore { | 43 namespace WebCore { |
| 43 | 44 |
| 44 HTMLImportChild::HTMLImportChild(const KURL& url, SyncMode sync) | 45 HTMLImportChild::HTMLImportChild(const KURL& url, SyncMode sync) |
| 45 : HTMLImport(sync) | 46 : HTMLImport(sync) |
| 46 , m_url(url) | 47 , m_url(url) |
| 47 , m_weakFactory(this) | 48 , m_weakFactory(this) |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 if (HTMLImportChild* childToShareWith = toHTMLImportsController(root())->fin
dLinkFor(m_url, this)) { | 175 if (HTMLImportChild* childToShareWith = toHTMLImportsController(root())->fin
dLinkFor(m_url, this)) { |
| 175 m_loader = childToShareWith->m_loader; | 176 m_loader = childToShareWith->m_loader; |
| 176 m_loader->addImport(this); | 177 m_loader->addImport(this); |
| 177 } | 178 } |
| 178 | 179 |
| 179 createCustomElementMicrotaskStepIfNeeded(); | 180 createCustomElementMicrotaskStepIfNeeded(); |
| 180 } | 181 } |
| 181 | 182 |
| 182 bool HTMLImportChild::isDone() const | 183 bool HTMLImportChild::isDone() const |
| 183 { | 184 { |
| 184 return m_loader && m_loader->isDone() && !m_loader->microtaskQueue()->needsP
rocessOrStop() && !m_customElementMicrotaskStep; | 185 return m_loader && m_loader->isDone() && m_loader->microtaskQueue()->isEmpty
() && !m_customElementMicrotaskStep; |
| 185 } | 186 } |
| 186 | 187 |
| 187 bool HTMLImportChild::loaderHasError() const | 188 bool HTMLImportChild::loaderHasError() const |
| 188 { | 189 { |
| 189 return m_loader && m_loader->hasError(); | 190 return m_loader && m_loader->hasError(); |
| 190 } | 191 } |
| 191 | 192 |
| 192 | 193 |
| 193 void HTMLImportChild::setClient(HTMLImportChildClient* client) | 194 void HTMLImportChild::setClient(HTMLImportChildClient* client) |
| 194 { | 195 { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 fprintf(stderr, " loader=%p first=%d, step=%p sync=%s url=%s", | 235 fprintf(stderr, " loader=%p first=%d, step=%p sync=%s url=%s", |
| 235 m_loader, | 236 m_loader, |
| 236 isFirst, | 237 isFirst, |
| 237 m_customElementMicrotaskStep.get(), | 238 m_customElementMicrotaskStep.get(), |
| 238 isSync() ? "Y" : "N", | 239 isSync() ? "Y" : "N", |
| 239 url().string().utf8().data()); | 240 url().string().utf8().data()); |
| 240 } | 241 } |
| 241 #endif | 242 #endif |
| 242 | 243 |
| 243 } // namespace WebCore | 244 } // namespace WebCore |
| OLD | NEW |