| 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 14 matching lines...) Expand all Loading... |
| 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 #include "config.h" | 31 #include "config.h" |
| 32 #include "core/dom/custom/CustomElementMicrotaskImportStep.h" | 32 #include "core/dom/custom/CustomElementMicrotaskImportStep.h" |
| 33 | 33 |
| 34 #include "core/dom/custom/CustomElementMicrotaskDispatcher.h" | 34 #include "core/dom/custom/CustomElementMicrotaskDispatcher.h" |
| 35 #include "core/dom/custom/CustomElementMicrotaskQueue.h" | 35 #include "core/dom/custom/CustomElementSyncMicrotaskQueue.h" |
| 36 #include "core/html/imports/HTMLImportChild.h" | 36 #include "core/html/imports/HTMLImportChild.h" |
| 37 #include "core/html/imports/HTMLImportLoader.h" | 37 #include "core/html/imports/HTMLImportLoader.h" |
| 38 #include <stdio.h> | 38 #include <stdio.h> |
| 39 | 39 |
| 40 namespace WebCore { | 40 namespace WebCore { |
| 41 | 41 |
| 42 PassOwnPtrWillBeRawPtr<CustomElementMicrotaskImportStep> CustomElementMicrotaskI
mportStep::create(HTMLImportChild* import) | 42 PassOwnPtrWillBeRawPtr<CustomElementMicrotaskImportStep> CustomElementMicrotaskI
mportStep::create(HTMLImportChild* import) |
| 43 { | 43 { |
| 44 return adoptPtrWillBeNoop(new CustomElementMicrotaskImportStep(import)); | 44 return adoptPtrWillBeNoop(new CustomElementMicrotaskImportStep(import)); |
| 45 } | 45 } |
| 46 | 46 |
| 47 CustomElementMicrotaskImportStep::CustomElementMicrotaskImportStep(HTMLImportChi
ld* import) | 47 CustomElementMicrotaskImportStep::CustomElementMicrotaskImportStep(HTMLImportChi
ld* import) |
| 48 #if ENABLE(OILPAN) | 48 #if ENABLE(OILPAN) |
| 49 : m_import(import) | 49 : m_import(import) |
| 50 #else | 50 #else |
| 51 : m_import(import->weakPtr()) | 51 : m_import(import->weakPtr()) |
| 52 , m_weakFactory(this) | 52 , m_weakFactory(this) |
| 53 #endif | 53 #endif |
| 54 , m_queue(import->loader()->microtaskQueue()) | 54 , m_queue(import->loader()->microtaskQueue()) |
| 55 { | 55 { |
| 56 } | 56 } |
| 57 | 57 |
| 58 CustomElementMicrotaskImportStep::~CustomElementMicrotaskImportStep() | 58 CustomElementMicrotaskImportStep::~CustomElementMicrotaskImportStep() |
| 59 { | 59 { |
| 60 } | 60 } |
| 61 | 61 |
| 62 void CustomElementMicrotaskImportStep::parentWasChanged() | 62 void CustomElementMicrotaskImportStep::parentWasChanged() |
| 63 { | 63 { |
| 64 m_queue = CustomElementMicrotaskQueue::create(); | 64 m_queue = CustomElementSyncMicrotaskQueue::create(); |
| 65 m_import.clear(); | 65 m_import.clear(); |
| 66 } | 66 } |
| 67 | 67 |
| 68 bool CustomElementMicrotaskImportStep::shouldWaitForImport() const | 68 bool CustomElementMicrotaskImportStep::shouldWaitForImport() const |
| 69 { | 69 { |
| 70 return m_import && !m_import->loader()->isDone(); | 70 return m_import && !m_import->loader()->isDone(); |
| 71 } | 71 } |
| 72 | 72 |
| 73 void CustomElementMicrotaskImportStep::didUpgradeAllCustomElements() | 73 void CustomElementMicrotaskImportStep::didUpgradeAllCustomElements() |
| 74 { | 74 { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 96 | 96 |
| 97 #if !defined(NDEBUG) | 97 #if !defined(NDEBUG) |
| 98 void CustomElementMicrotaskImportStep::show(unsigned indent) | 98 void CustomElementMicrotaskImportStep::show(unsigned indent) |
| 99 { | 99 { |
| 100 fprintf(stderr, "%*sImport(wait=%d sync=%d, url=%s)\n", indent, "", shouldWa
itForImport(), m_import && m_import->isSync(), m_import ? m_import->url().string
().utf8().data() : "null"); | 100 fprintf(stderr, "%*sImport(wait=%d sync=%d, url=%s)\n", indent, "", shouldWa
itForImport(), m_import && m_import->isSync(), m_import ? m_import->url().string
().utf8().data() : "null"); |
| 101 m_queue->show(indent + 1); | 101 m_queue->show(indent + 1); |
| 102 } | 102 } |
| 103 #endif | 103 #endif |
| 104 | 104 |
| 105 } // namespace WebCore | 105 } // namespace WebCore |
| OLD | NEW |