| 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 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 CustomElementMicrotaskImportStep_h | 31 #ifndef CustomElementMicrotaskImportStep_h |
| 32 #define CustomElementMicrotaskImportStep_h | 32 #define CustomElementMicrotaskImportStep_h |
| 33 | 33 |
| 34 #include "core/dom/custom/CustomElementMicrotaskQueue.h" | |
| 35 #include "core/dom/custom/CustomElementMicrotaskStep.h" | 34 #include "core/dom/custom/CustomElementMicrotaskStep.h" |
| 36 #include "wtf/Noncopyable.h" | 35 #include "wtf/Noncopyable.h" |
| 37 #include "wtf/PassOwnPtr.h" | 36 #include "wtf/PassOwnPtr.h" |
| 37 #include "wtf/PassRefPtr.h" |
| 38 #include "wtf/RefPtr.h" |
| 38 | 39 |
| 39 namespace WebCore { | 40 namespace WebCore { |
| 40 | 41 |
| 42 class RefCountedCustomElementMicrotaskQueue; |
| 43 |
| 41 // Processes the Custom Elements in an HTML Import. This is a | 44 // Processes the Custom Elements in an HTML Import. This is a |
| 42 // composite step which processes the Custom Elements created by | 45 // composite step which processes the Custom Elements created by |
| 43 // parsing the import, and its sub-imports. | 46 // parsing the import, and its sub-imports. |
| 44 // | 47 // |
| 45 // This step blocks further Custom Element microtask processing if its | 48 // This step blocks further Custom Element microtask processing if its |
| 46 // import isn't "ready" (finished parsing and running script.) | 49 // import isn't "ready" (finished parsing and running script.) |
| 47 class CustomElementMicrotaskImportStep : public CustomElementMicrotaskStep { | 50 class CustomElementMicrotaskImportStep : public CustomElementMicrotaskStep { |
| 48 WTF_MAKE_NONCOPYABLE(CustomElementMicrotaskImportStep); | 51 WTF_MAKE_NONCOPYABLE(CustomElementMicrotaskImportStep); |
| 49 public: | 52 public: |
| 50 static PassOwnPtr<CustomElementMicrotaskImportStep> create(); | 53 static PassOwnPtr<CustomElementMicrotaskImportStep> create(PassRefPtr<RefCou
ntedCustomElementMicrotaskQueue>); |
| 51 virtual ~CustomElementMicrotaskImportStep() { } | 54 virtual ~CustomElementMicrotaskImportStep(); |
| 52 | |
| 53 // API for CustomElementScheduler | |
| 54 void enqueue(PassOwnPtr<CustomElementMicrotaskStep>); | |
| 55 | 55 |
| 56 // API for HTML Imports | 56 // API for HTML Imports |
| 57 void importDidFinish(); | 57 void importDidFinish(); |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 CustomElementMicrotaskImportStep() : m_importFinished(false) { } | 60 CustomElementMicrotaskImportStep(PassRefPtr<RefCountedCustomElementMicrotask
Queue>); |
| 61 | 61 |
| 62 // CustomElementMicrotaskStep | 62 // CustomElementMicrotaskStep |
| 63 virtual Result process() OVERRIDE FINAL; | 63 virtual Result process() OVERRIDE FINAL; |
| 64 | 64 |
| 65 bool m_importFinished; | 65 bool m_importFinished; |
| 66 CustomElementMicrotaskQueue m_queue; | 66 RefPtr<RefCountedCustomElementMicrotaskQueue> m_queue; |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 } | 69 } |
| 70 | 70 |
| 71 #endif // CustomElementMicrotaskImportStep_h | 71 #endif // CustomElementMicrotaskImportStep_h |
| OLD | NEW |