| 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 15 matching lines...) Expand all Loading... |
| 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/CustomElementMicrotaskStep.h" | 34 #include "core/dom/custom/CustomElementMicrotaskStep.h" |
| 35 #include "platform/heap/Handle.h" | 35 #include "platform/heap/Handle.h" |
| 36 #include "wtf/WeakPtr.h" | |
| 37 | 36 |
| 38 namespace blink { | 37 namespace blink { |
| 39 | 38 |
| 40 class CustomElementSyncMicrotaskQueue; | 39 class CustomElementSyncMicrotaskQueue; |
| 41 class HTMLImportChild; | 40 class HTMLImportChild; |
| 42 | 41 |
| 43 // Processes the Custom Elements in an HTML Import. This is a | 42 // Processes the Custom Elements in an HTML Import. This is a |
| 44 // composite step which processes the Custom Elements created by | 43 // composite step which processes the Custom Elements created by |
| 45 // parsing the import, and its sub-imports. | 44 // parsing the import, and its sub-imports. |
| 46 // | 45 // |
| 47 // This step blocks further Custom Element microtask processing if its | 46 // This step blocks further Custom Element microtask processing if its |
| 48 // import isn't "ready" (finished parsing and running script.) | 47 // import isn't "ready" (finished parsing and running script.) |
| 49 class CustomElementMicrotaskImportStep final : public CustomElementMicrotaskStep
{ | 48 class CustomElementMicrotaskImportStep final : public CustomElementMicrotaskStep
{ |
| 50 public: | 49 public: |
| 51 static CustomElementMicrotaskImportStep* create(HTMLImportChild*); | 50 static CustomElementMicrotaskImportStep* create(HTMLImportChild* import) |
| 51 { |
| 52 return new CustomElementMicrotaskImportStep(import); |
| 53 } |
| 54 |
| 52 ~CustomElementMicrotaskImportStep() override; | 55 ~CustomElementMicrotaskImportStep() override; |
| 53 | 56 |
| 54 // API for HTML Imports | 57 // API for HTML Imports |
| 55 void invalidate(); | 58 void invalidate(); |
| 56 void importDidFinishLoading(); | 59 void importDidFinishLoading(); |
| 57 #if !ENABLE(OILPAN) | |
| 58 WeakPtr<CustomElementMicrotaskImportStep> weakPtr() { return m_weakFactory.c
reateWeakPtr(); } | |
| 59 #endif | |
| 60 | 60 |
| 61 DECLARE_VIRTUAL_TRACE(); | 61 DECLARE_VIRTUAL_TRACE(); |
| 62 | 62 |
| 63 private: | 63 private: |
| 64 explicit CustomElementMicrotaskImportStep(HTMLImportChild*); | 64 explicit CustomElementMicrotaskImportStep(HTMLImportChild*); |
| 65 | 65 |
| 66 void didUpgradeAllCustomElements(); | 66 void didUpgradeAllCustomElements(); |
| 67 bool shouldWaitForImport() const; | 67 bool shouldWaitForImport() const; |
| 68 | 68 |
| 69 // CustomElementMicrotaskStep | 69 // CustomElementMicrotaskStep |
| 70 Result process() final; | 70 Result process() final; |
| 71 | 71 |
| 72 #if !defined(NDEBUG) | 72 #if !defined(NDEBUG) |
| 73 void show(unsigned indent) override; | 73 void show(unsigned indent) override; |
| 74 #endif | 74 #endif |
| 75 WeakMember<HTMLImportChild> m_import; | 75 WeakMember<HTMLImportChild> m_import; |
| 76 #if !ENABLE(OILPAN) | |
| 77 WeakPtrFactory<CustomElementMicrotaskImportStep> m_weakFactory; | |
| 78 #endif | |
| 79 Member<CustomElementSyncMicrotaskQueue> m_queue; | 76 Member<CustomElementSyncMicrotaskQueue> m_queue; |
| 80 }; | 77 }; |
| 81 | 78 |
| 82 } // namespace blink | 79 } // namespace blink |
| 83 | 80 |
| 84 #endif // CustomElementMicrotaskImportStep_h | 81 #endif // CustomElementMicrotaskImportStep_h |
| OLD | NEW |